3 ms·
I mean, Java is pretty notorious for sprawling names like INetworkSessionManagerFactorySidecarControllerFactoryHelper. It's pretty hard to argue that that pheno
by dcolkitt 6y ago
I mean, Java is pretty notorious for sprawling names like INetworkSessionManagerFactorySidecarControllerFactoryHelper. It's pretty hard to argue that that phenomenon isn't driven by the ubiquity of IDEs in the Java community.
With high-powered auto-completion and one-button refactoring, your brain stops processing the full name. No one's incentive to pause for a minute and come up with thoughtful variable names. For most developers it's too mentally tempting to just puke out some CamelCase word salad, because the IDE hides all the effort of having to read/write/remember unfortunate names.
- indecisive_user 6y agoThat's a valid complaint, but at the same time it's not always easy to come up with a good name from the start. I often find myself putting in placeholder names for variables/functions because I'm really not sure what it's going to encompass by the time everything is finished. IDE refactoring makes it easy to clean up names after spending some time with the feature and better understanding what the scope of each function is going to be. It's great to pause and come up with meaningful names and I agree more developers should do it, but refactoring is a normal part of coding and I'd rather have an easy way of renaming things as the code evolves.
- pvorb 6y agoSomebody who is too lazy to choose a good variable name in IntelliJ would also have chosen a bad (or even worse) variable name without the tooling. I don't buy that argument. For class names it might be true that long compound names are driven by auto suggestions from the IDE. But I'm wondering if they're really as bad as their reputation. Somehow it's similar as for variables. You can still come up with more meaningful names if you want but I admit that auto suggestions do more harm there.
- Roboprog 6y agoI think the parent post was attributing longFuglyCapsUnpronouncabeName type identifiers to the Java language/culture, As much as (just) the editor? I’m biased, though. I HATE gigantic supposedly “self documenting” (but utterly impossible to actually say aloud) identifiers. My ideal identifiers are 2, maybe 3, syllables, with dashes or underscores, with actual documentation of WHY anything visible beyond The scope of a single function is used.
- pvorb 6y agoI guess any piece of code will have someone who finds it horrifying. I prefer long, self documenting identifiers over short (often misleading) ones any time.
- EdwardDiego 6y agoSure IDEA is primarily aimed at the JVM market, but I use IDEA's refactorings in Python, Go, Bash etc. And I'm unsure about your point about meaningful names - IDEA typically won't suggest a name when renaming an existing language artifact - type, class, object, method, function etc. It will when extracting an expression into a variable, based on the context it was derived from, and that's actually a pretty good heuristic - e.g., if the expression being extracted is <some_var> = dependency.get_campaign_results() It'll suggest things like campaign_results campaigns results Most of which are what a developer would usually use in that situation.