Live data from Hacker News

Java Is Underhyped

jackson.sh

731–740 of 808 posts

Re: Java Is Underhyped

#731

Earlier quoted context omitted.

Even IO heavy code, it is much easier to write multithreaded async code for the jvm than it is for python

If it's just about I/O, then no, threads in Python are super easy: import random import time from concurrent.futures import ThreadPoolExecutor, as_completed def hello(seconds): print(f"Starting hello in {seconds}s") time.sleep(seconds) print(f"End of hello in {seconds}s") return seconds # At the end of this blocks, it automatically join() and clean with ThreadPoolExecutor(max_workers=2) as executor: # 2 tasks in para…

Are python threads still limited to one core? That’s always been a nasty limitation.

I do enjoy in python that it is quite easy to utilise multiple processes in a code-light fashion, but some things are more natural as threads.

Re: Java Is Underhyped

#732
post #698

Earlier quoted context omitted.

It certainly doesn't help that the software I'm interested in is written for science, so there is a tendency to make it work just well enough on the author's machine to allow a paper to be published, and then abandon it.

There is a clear training problem in science. But I believe part of it is that the knowledge on how to write good software is stuck in companies. You can't learn it in school either. I keep hearong about companies that have to make their new hires unlearn what they learned in class... So where would scientists learn good practices? (in my experience books arent the answer either)

I don't think it is primarily a problem in training. It is a problem in incentive. For the most part, scientific software is written to fulfil a goal, and usually that goal is in order to publish a paper. Paper publication is what scientists are judged on, not the quality of the software they write. The software only needs to work well enough to get the paper published. Once the paper is published, all incentive to maintain or improve the software disappears, especially if the message of the paper is primarily the results obtained using the software, because then all of the citations will be referring to those results, not the software.

There are two main exceptions to this rule. One is when an actual software engineer ends up working as a scientist and having to write papers (like me). Then, the paper is more likely to be about the software itself, and the citations of the paper are from people who have also used the same software. This creates an incentive to make the software high quality, in order to get those citations. The other exception is when an institute decides that the world needs a decent piece of software to fulfil a vital role, and actually funds its development.

Oh, I should probably mention - I just helped out with a programming course for undergraduate medical science students. Most of the time I was tearing my hair out about the terrible programming practices being taught by the module leader, who admittedly had absolutely no computer science qualifications whatsoever (and in fact didn't know the difference between a forward slash and a backslash).

I think a solution to this is to recognise software quality as a common benefit, and divert funding towards it, allowing real software engineers to have an actual meaningful career in university. Universities are usually all over common benefit stuff, so you would have thought this would be easy enough. The Research Software Engineer programme in the UK is a start.

Re: Java Is Underhyped

#733
post #458

Earlier quoted context omitted.

I have seen a lot of projects fail over the years, for many different reasons, but I have never seen a project fail due to the choice of programming language. > I've seen a lot of Java projects fail, over engineered, full of spaghetti code, riddle with inscrutable abstraction, stuck in a glue of badly designed architecture that has been fossilized by the type system. Sure, but do you really think the same organizatio…

It's an anwser to "You use Java because it is low risk". I just don't think it's immune in any way.

Of course Java project are not immune to failure, that is not what "low risk" means! In this context it means the risk is lower for certain specific problems - e.g. unable to hire developers, show-stopping bugs in the platform which never get fixes, lack of documentation, abandonware.

Choosing a less popular platform (like say Clojure or CoffeeScript or whatever) might very well increase productivity compared to the conservative choice. But slightly increased productivity will not save a project, while the additional risks involved could very well sink the whole project. Which is why most businesses seek to reduce risk rather than maximize productivity when it comes to development platforms.

Re: Java Is Underhyped

#735
post #591

Earlier quoted context omitted.

Those are pretty strong assertions with no statistics to back them up. It doesn’t reflect the ecosystem I work in. I think you underestimate the number of huge companies that see major benefit from large teams working large development efforts.

I don’t know where you would even look for that kind of statistics for companies that might use Java. That said, America has: 1,829,875 companies with 5-9 employees 779,922 companies with 10-19 employees 467,634 companies with 20 - 49 employees 170,749 companies with 50 - 99 employees Of that a few are pure software companies, but it’s far more common to want to automate something. Which often means outsourcing it, b…

Clearly you’re not going to arrive at a good answer starting from first principles. Industry research groups have the numbers, but they’re locked behind paywalls.

Starting from the other end, the Stackoverflow survey has 50% of devs identifying as full-stack. Most surveys have Java as the #2 programming language, where it’s been for the last 20 years. That says nothing about how those devs are organized among teams, but I don’t think it points to such arrangements being “rare”.

Re: Java Is Underhyped

#736

The sheer verbosity of Java is just unbearable when you're used to Python/Go/Swift/etc. No, Java is just about as hyped as it needs to be. Which is to say, it's more or less fine. Not great, not terrible. Middle of the road at best.

I honestly don't know how anyone could think Go is less verbose than Java.

Manual for loops? No generics?

Re: Java Is Underhyped

#737
post #664
post #594

Earlier quoted context omitted.

It's Google. They'll probably come up with a completely new programming language which they'll force on the community in some ham fisted way, then suddenly drop it in a few years when they can't figure out a way to massively monetize it.

I thought that was Dart. Which is honestly a shame because it’s a genuinely great language. But it does very much fit the bill otherwise

Dart always stuck me as a solution looking for a problem, particularly in lite of more recent progress in JS itself. Can I ask why you think its a genuinely great language worth looking at?

Re: Java Is Underhyped

#738

Earlier quoted context omitted.

As a simple example, `x.equals(y)` accepts an arbitrary Object y. This one example has ramifications all over the place, e.g. I had a bug recently where I was checking if an element was in a collection, using `x.contains(y)`. That .contains method seems to use .equals, since it allows y to be any Object. In my case x was a collection of MyType values whilst y was a MyWrapper which I forgot to unwrap. Rather than givi…

Those are ancient warts that can never be changed. Almost any static analysis suite will warn you about using equals and contains with incorrect types.

> Almost any static analysis suite

Yet not the most important static analysis suite, which is included in the compiler, and enforced on all code: the type checker ;)

Re: Java Is Underhyped

#739
post #580

Earlier quoted context omitted.

As a simple example, `x.equals(y)` accepts an arbitrary Object y. This one example has ramifications all over the place, e.g. I had a bug recently where I was checking if an element was in a collection, using `x.contains(y)`. That .contains method seems to use .equals, since it allows y to be any Object. In my case x was a collection of MyType values whilst y was a MyWrapper which I forgot to unwrap. Rather than givi…

Alt insert generate equals method, select fields, ready. Or use a record. It is such a minuscule part of the language, that it simply doesn’t matter compared to every other line of code, lib, ecosystem. You may imagine how much more productive you are that this language has sane equals, but it is not even a reasonable constant factor.

> Alt insert generate equals method, select fields, ready.

This sounds like you're not programming in the Java language, you're programming in some sort of graphical macro language which compiles down to Java (presumably built-in to an IDE of some sort?).

The fact that people resort to such things is evidence that this is a valid criticism of the Java language.

Re: Java Is Underhyped

#740

Language opinions are fun :) I'm actually old enough that Java was my main language during CS. No Python... Before that when I during my teenage years I got to lecture by some senior in IBM that showed how amazing is Java and it's the future. (That was 10! Years before I've attended) And that's that's the thing... Hype is all about "new" things. And after a while it dusts off. HN had a lot of posts about good develop…

>I'm actually old enough that Java was my main language during CS. No Python... Is java considered old or outdated for today in CS? I'm learning Java in my AP computer science class to this day.

I wouldn't say outdated. Like C++ which is even older, it has iterations adding more modern capabilities like Java 8.
Post reply on HN