top | item 36993113

(no title)

whywhywhydude | 2 years ago

Perhaps you are using the wrong language. You should probably just stick with python or javascript where they just have simple lists and maps and pretty much nothing else.

discuss

order

coldtea|2 years ago

A Java programmer feeling superior? Who would have though the day will come.

In all seriousness, this is grade school BS.

(a) Literals are a syntax improvement. Much more serious languages than Java have them.

(b) What Python and JS have don't amount to "simple lists and maps". They have the full gamut (including constructor based instantiation of different types).

(c) Literals don't have to be a single ("simple" or not) type. They can be whatever, and in Java these could include different classes of lists and maps initialized with the same literal syntax based on the assigned variable's type.

(d) When Oracle gives literals, Java programmers not familiar with them in other languages will suddenly love them too, and they'd not just be "for Python and Javascript" anymore.

imtringued|2 years ago

You can build a named parameter+varargs based syntax on the JVM that is applicable to every container with the appropriate constructor.