Live data from Hacker News

Java Is Underhyped

jackson.sh

721–730 of 808 posts

Re: Java Is Underhyped

#721
For All those who feel Ibstall of java, using maven/gradle and all the Other ceremony about java is too much give a try to https://jbang.dev.

Setup jbang and install java if needed:

curl -Ls https://sh.jbang.dev | bash -s - app setup jbang

Create a java file that has dependency on picocli and just runs:

jbang init -t cli hello.java

Run it: ./hello.java

Edit it in vscodium with live fetching of dependencies(you can use your own ide too): jbang edit --open --live hello.java

Re: Java Is Underhyped

#722
post #344

Earlier quoted context omitted.

> Java created that hype to market itself. OOP all the things probably wouldn't have been a thing without it, for instance “OOP all the things” predated (and led to) Java, it wasn’t a product of Java (C++, Objective-C, Object Pascal and, well, a bunch of other things from the late 1980s and early 1990s were where it got started.) Java was about a decade into it.

There's a big difference between "OOP is cool" (which Java didn't invent) and "OOP ALL of the things".

But Java clearly didn’t “OOP all the things”, unlike earlier languages like Smalltalk. Java primitives are not objects (despite the fact that I often found myself wishing they were), and static methods are actually just functions. These days Java even supports first-class functions.

I know not everyone will agree with me, and that’s fine, but I always found Java to be far more pragmatic than, for example, C++, which well and truely predated Java.

Re: Java Is Underhyped

#723

Personally, I wonder if/when Java will become the next COBOL: nobody wants to learn it, feels extremely awkward and obtuse compared to whatever is current then, but there will be loads of old code that needs maintaining. Certainly feels like it's on that track now...

well I heard that good COBOL coders nowadays are recalled from retirement and covered in gold in order to maintain old codebases. It's not that bad :)

Re: Java Is Underhyped

#725
post #136

Earlier quoted context omitted.

Python projects that start to grow has a tendency to become hard to manage in a way that I have not seen in Java at all. Java is like you say not the greatest at anything but it is also not the worst at anything. Its great for projects where the you don't know what you should optimize for or don't care. If java is to boring maybe kotlin is the way to go. I really like kotlin and in my personal experience the only dow…

> Python projects that start to grow has a tendency to become hard to manage in a way that I have not seen in Java at all. Mypy is excellent. It has two-way type inference like Haskell. Good usage means catching almost all type errors before running. So is PyCharm, which is IntelliJ for Python.

Except for the fact that absolutely every Java library is typed and maybe 0.1% of Python libraries are typed.

Re: Java Is Underhyped

#726

Earlier quoted context omitted.

It's horses for courses. Some plus points for Java: - you can integrate code from hundreds of developers fairly safely (knowing that no one has changed the default behaviour fo builtins and different dependencies won't clash). - the syntax, although not the most succinct is fairly easily readable and maintainable by other developers.

>the syntax, although not the most succinct is fairly easily readable and maintainable by other developers I dislike that people conflate simple languages with easy to read code. Low level verbose abstractions make code harder to read - going through the layers of IFactoryRepositoryLocatorBullshit because the language abstractions suck doesn't make it easier to read code. It makes the code more accessible, in the sen…

"IFactoryRepositoryLocatorBullshit" really has nothing to do with Java the language. That's just how some developers choose to design their programs.

What specifically is Java terrible at? I find Java to be as expressive as most mainstream languages. Certainly no less expressive than, say, Python or JavaScript.

Re: Java Is Underhyped

#727
post #41

Earlier quoted context omitted.

Namespacing in reverse dns order is something Java got right. It naturally segments things and you can immediately see the relative provenance of classes. It’s just impossible to use without editor support. Nobody who cares for their sanity can type out those package names manually. I think even Gosling said as much.

Just trying to find files relevant to some functionality is incredibly difficult without full-text searching all the files. Namespacing is fine but why must the entire path be reflected in directory structures?

To prevent half assed refactoring in the first place where only namespaces and classes get refactored while folders and filenames remain as they were. It would just further confuse new devs on the project.

Re: Java Is Underhyped

#728
post #136

Earlier quoted context omitted.

Python projects that start to grow has a tendency to become hard to manage in a way that I have not seen in Java at all. Java is like you say not the greatest at anything but it is also not the worst at anything. Its great for projects where the you don't know what you should optimize for or don't care. If java is to boring maybe kotlin is the way to go. I really like kotlin and in my personal experience the only dow…

I write software in Java. I can't stand python - too wishy-washy. But my main complaint about Python is trying to use someone else's software. Then it degenerates into a maze of twisty little passages of trying to install the correct set of dependencies, not knowing where those files are installed (which makes it difficult on a cluster, as you may need to do the install on every node separately). Then you try using p…

I have to say that I use Python a great deal and I just never run into these issues. Nor have I ever even used Anaconda, I just use virtualenvs and pip and it all works.

It's my guess that you are using a lot of Python libraries that are wrappers around C or C++ libraries which have dodgy cross-platform support, because I can't see another way this is happening. If so, it's hardly fair to blame Python for that...

Re: Java Is Underhyped

#729
post #693

Earlier quoted context omitted.

With respect, you're wrong. I say this because we're now seeing widespread adoption of serverside Kotlin at places like Google and Amazon. With the support of Google and Jetbrains they can target whatever they want.

Definitely. There has been a consistent increase in non-Android Kotlin jobs in the last 12 months according to Indeed.com.

Back in 2010…

There has been a consistent increase in Scala jobs in the last 12 months according to Indeed.com

Re: Java Is Underhyped

#730
post #78

Earlier quoted context omitted.

Your jab at TS was lame as Java itself has complete type erasure for generics. >by crystallizing type definitions and guaranteeing type guards by default. Not so crystallizing if you know.. if you've ever used a Java List, Set or a Map. i.e., List . such guarantee. wow. Honestly, I'd prefer TS with strict mode over Java any day because nullability is explicit, don't have to watch out for the dreaded NullPointerExcept…

Thank you, good point. I forgot about HashMap's type unsafety even though I wrote the following monstrocity a few days ago to loop over a HashMap Iterator ghostI = hashtableNPCs.entrySet().iterator(); while (ghostI.hasNext()) { ExpiringEntityPlayer expiringEntityPlayer = (ExpiringEntityPlayer) ((Map.Entry) ghostI.next()).getValue(); } Apparently this is the only way to do it, and the Map.Entry type absolutely nukes a…

In modern Java there are more terse APIs available. For example:

    hashtableNPCs.values().forEach(ExpiringEntityPlayer::something);
Post reply on HN