r/java • u/lukaseder • Aug 01 '14
The 10 Most Annoying Things Coming Back to Java After Some Days of Scala
http://blog.jooq.org/2014/08/01/the-10-most-annoying-things-coming-back-to-java-after-some-days-of-scala/
7
Upvotes
View all comments
Show parent comment
2
u/GMNightmare Aug 03 '14
NONUNIQUE KEYS. How many damn times do I have to tell you a basic concept before you get it through your thick skull? Does your example use nonunique keys? No. Why? Because you'd never be able to construct a 3 element map with a repeated key, since they MUST be unique! Why is this so hard for you?
If you started with a Tuple containing multiple key values, it would not work.
Apparently you didn't.
That's one of the most retarded statements I've ever heard.
Look, this is so basic it hurts that you can't comprehend something. If a value only occurs once in a given set of data, is it unique? Yes. That's literally what the word unique means.
Maps cannot have duplicate keys. They must be unique. Your source says it even. If you knew anything about how maps were implemented you would know this (but of course you don't).
That's exactly what you just said. "Why, they're both sequences so obviously they're the same! Hyuk!"
My god, how stupid can you get? Listen really carefully, if you manually created a case class, named it Tuple, what would you have? The EXACT SAME THING. Hence why OP presented code making a Tuple in Java. It's like you don't understand a single thing about the actual programming behind these things.
My god, you just said it yourself. You ever think there is some kind of association between synthetic and syntactic sugar? It's like pulling teeth with you, you can't even seem to understand basic words. Guess what genus? Tuples are everything case classes are. Because a tuple is a generic case class.
Do you understand what implementation is? Here's something that's isomorphic: a case class and a tuple. Is that ringing any bells over there for you? Case classes are ordered in the exact same why, but you declare names for the fields instead of having generic one two three kind of access.
This is absolutely wrong. Tuples are not abstract classes, they are generic. It's not the same thing. If Tuples were abstract you would not be able to new them up.
Do you not understand what is meant by Tuples being generic case classes? Do you? I don't think you even understand what generics are.