Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Well said! Java is the exact opposite of sane defaults: the programmer must explicitly choose defaults at every turn.

Furthermore, it constantly feels like the arcane minutiae required in Java is Java-specific, in a way that other languages (C-based, functional) aren't.

In Java, if I memorize an incantation, most of the information I've just learned is Java-specific.

In C or C++, it's more computing specific. Other languages will use different syntax, but I will be doing the same thing.

But I guess that's one of the weaknesses of reimplementing a computer in the JVM, and then writing a high-performance language to target that abstracted machine.



view as:

> Java is the exact opposite of sane defaults

That honour belongs to C derived languages.


> In C or C++, it's more computing specific. Other languages will use different syntax, but I will be doing the same thing.

I think you’ve just internalised C-isms. The core Java language is as close to conventional OOP as it gets, and the model is not that different from most OOP languages. It certainly isn’t alien. We ended up conflating C and computing, but it is more an accident of history and because so many languages borrowed so heavily from it.


Java pass by reference vs pass by value vs C pass by reference vs pass by value?

Both languages are strictly pass by value. Java pretty much uses pointers (references in name only) and primitives only, and both languages copies these all by value. For actual reference you have to go to c++.

For intro computer science students, pointers-as-explicit-references are far easier to comprehend than Java's esoterica.

Said as someone who took intro computer science at 2 universities across 3 courses (C/C++, Python, Java), due engineering to art to computer science major switching.

I understand why Java did what they did, from a performance standpoint, but that's a poor highest value to hold for education use.

And in retrospect, was batshit user-hostile. F.ex. with a few more keywords and rules, C# smoothed off so many rough edges.


> pointers-as-explicit-references are far easier to comprehend than Java's esoterica.

What is esoteric about Java’s references? They are basically equivalent to C pointers without arithmetics and marketed as references. It is pretty much the same for most high level languages.


The object/primitive distinction, which seems like something an intro CS student really shouldn't be wasting their time learning.

IMHO, the C-style */& was far clearer when I was first learning to program. Especially since you could just echo out the (virtual) memory address.


The object/primitive distinction is pretty much the very short list of primitives (even written with lower case letters) vs every other type.

> IMHO, the C-style */& was far clearer when I was first learning to program

Tell that to the million segfaults that students learning C experience (or worse, they don’t even get it!!)


Yes, int vs Integer. It does make sense that those would function differently. /s ;)

And C definitely has some inscrutable errors, but to me once I understood them, they always made sense in computer terms. Whereas Java errors and oddities only make sense in Java terms.


> For intro computer science students, pointers-as-explicit-references are far easier to comprehend than Java's esoterica.

C pointers are even worse as an introduction.


Legal | privacy