4 ms·
> Imagine that every time I write a sentence I prepend "Banana699 says" or "Banana699 thinks" It's more like starting paragraphs with ">" here. It'll also cons
by dzaima 5y ago
> Imagine that every time I write a sentence I prepend "Banana699 says" or "Banana699 thinks"
It's more like starting paragraphs with ">" here. It'll also consistently be at the start of single lines, one above each other, so there's a clear guide on what to skip reading if you don't want to. With the benefit that if you do want to read it, you don't have to scan for context. Java likes putting context locally.
> but the mere presence of irrelevant info steals your attention
Except it doesn't. I literally just don't look at it if I don't care. And, unlike your username being repeated, it's actual information, a different value for each line.
> hovering over the identifier
Sure, that's also a way to do it. I have my java editor show the full type after each "var" instance, but even that's messy because it makes the editor more unpredictable (you can't move the cursor mid-type-description, they interfere with alignment, etc)
> Not all info has to be stored in the raw text
But there's still (unfortunately) a lot of value in having it. GitHub, or 'cat'ting in terminal won't provide you with the descriptions, and the cases when I don't have the thing open in an IDE will also be the cases I'm the newest to the project, and as such need as much help reading things as possible!
> Java is not bad enough to require you to use "new foo.bar.baz.class" …. Type inference simply applies a step further
There may be 10 or so classes imported in a file. There may be hundreds of variables in a file. foo.bar.baz.class would be duplicated dozens of times, and so is worth remembering. The type for a variable is duplicated.. twice, max? And, outside of "Type name = new Type();", it's useful duplication too, in most cases.
> because there is (currently) a finite (and very small) number of types that you need to autogenerate
Not quite "currently" as of Primitive Objects[0], which are available as a preview feature. And adding generics of primitive types is also a thing being worked on[1].
> I don't actually understand what that means. What's the fallback and who's doing it? when and why
An existing, pre-generics library has "void setProperties(HashMap map);". You want to pass a "HashMap<String,String>" to it. So you do, and it works.
> For me, liking a language means that, in absence of all other constraints and externalities (back-compat, hype and who-else-is-using-it syndrome, perf considerations,...), you would prefer that language over any other.
People can like multiple languages. Especially different languages for doing different things. Doesn't even have to be that constrained for some to arrive at Java. As-is, Java has wonderful IDEs, nice performance, trivial memory management, acceptable syntax, is portable, quite simple (both in terms of language complexity and usage, even if at the cost of verbosity), is OOP enough (if you're into that kind of thing), and will have libraries when you need them. Which is plenty for at least the things I do.
[0]: http://openjdk.java.net/jeps/401 http://openjdk.java.net/jeps/401
[1]: http://openjdk.java.net/jeps/218 http://openjdk.java.net/jeps/218
- Banana699 5y ago>It's more like starting paragraphs with ">" here. It's a full word, not a single letter operator. Its uses add up to noise pretty fast. >Java likes putting context locally How much 'non-local' would a bunch of declarations become if you factor out a common modifier and hoist it just a few lines above them? is your screen real estate situation really that desperate you can't afford a single new line? >Except it doesn't. I literally just don't look at it if I don't care. I have a feeling we won't reach a productive understanding about this, you don't seem to realize that I'm not talking about conscious control. Your brain have an amazing ability to filter out conversations, you can talk to your friend in the middle of a 10000-person company and still be heard loud and clear. Even with this capability, do you like your conversations to always be in the middle of 10000-person groups or in quiet cafés? >unlike your username being repeated, it's actual information, a different value for each line By this argument why write functions then or generics or really any abstraction at all? Every function invocation or generic instantiation is unique and contains novel information, so why not write the whole thing each time for extra readability? If there is no value in factoring out the repeated boilerplate that doesn't change much why aren't we all itching software ALU-control-signal by ALU-control-signal? >Not quite "currently" as of Primitive Objects I'm indeed aware of that, that's why I said 'currently' meaning the current stable release. This won't break my scheme too because those are full-blown objects that are part of the usual class hierarchy and could be manipulated as such, so they are covered by the generic_for_object version. There is another separate proposal to make the boxing of primitives use primitive objects so as to make it as performant as naked primitives and fix the 25-years-old stupid rookie mistake in the language design. This still wouldn't make HashMap<float, bool> legal, it would just make the boxed version more performant. Basically, you would still be left with a small ugly hole in the language where special-cases are introduced just for fun. Because severing the type system into primitives and classes at the language level was never a good idea. >An existing, pre-generics library has "void setProperties(HashMap map);". You want to pass a "HashMap<String,String>" to it. So you do, and it works The autogen solution isn't contradicting the boxing approach, if you absolutely need to use this function, just declare your HashMap to be of <Integer, Integer> instead of <int, int>. The advantage is that you don't need to most of the time, the generated class would still be there for you when you need the performance and have modern libraries to match. >People can like multiple languages. Especially different languages for doing different things. Sure thing, but Java is out-designed by nearly every serious language made after 2000, and most languages made after 1980. Even its niche is overflowing with superior competitors, so I don't understand why you would like it when everything good minus everything bad in it is offered by languages that fill its exact niche. >nice performance, trivial memory management [...], is portable, That's the praises of the JVM being sung here, not java the language. >simple both in terms of language complexity and usage Java is anything but simple, you're literally commenting on a thread discussing how the designers broke the type system by accident. One designer is on record saying that adding constraints to generics (<T implements some_interface>) made contributing to java compilers require too many PhDs. In terms of usage, Java frameworks are some of the most bloated lovecraftian horrors I have ever seen in my life, countless meaningless configuration here and there with no obvious ryhme or reason why this goes there. That's obviously just a single experience, but I have seen it echoed too many times to not be convinced it captures some underlying truth. >is OOP enough Aped it without understanding from smalltalk (through objective C) and couldn't even do it right. >will have libraries when you need them. Again, a feature of the JVM. A compiled .class knows nothing about Java or any other language it happened to come from.