Live data from Hacker News

The decline and fall of Java on the desktop

jdeploy.substack.com

331–340 of 362 posts

Re: The decline and fall of Java on the desktop

#331
post #326
post #314

Earlier quoted context omitted.

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. An…

> 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.

Re: The decline and fall of Java on the desktop

#332

Java's only claim to fame is that's the granddaddy of C#, a far superior language and IMHO one of the greatest computer languages ever created. In addition, Java was ahead of its time, with mid-1990's computing power not up to the job of letting it run smoothly on lower and mid-tier PC's. It also required, for that time, an egregious amount of RAM memory.

C# is Java done right. Nothing special really, it shines only when compared to other mediocre scripting language we use nowadays. Performance wise it's still on the heavy side. As a user I hate both Java e C# desktop app.

I only hate it because there's no support for AOT (ahead of time) compilation and it needs a runtime.

A native code compiled, statically linked Java or C# desktop app would be the ultimate C++ killer. It would also lessen the need for languages such as Rust.

Re: The decline and fall of Java on the desktop

#333
post #303

Earlier quoted context omitted.

You build your Clojure app as an uberjar, yes. Only gotcha here is to remember "-Dcljfx.skip-javafx-initialization=true" so the JFX thread doesn't get started during build, and I've had no problems using Clojure's direct linking either. You use jlink[1] to create a custom runtime JRE image (this isn't strictly necessary if you're deploying to machines with a JRE but it cuts down on moving parts and gives you more con…

"at the cost of some npm shenanigans" jDeploy developer here. No shenanigans, I swear. npm just simplified things. Some have expressed interest in adding self-hosting options, so I'll likely add support for that. It's open source too, so others could potentially add other hosting options also.

Yeah sorry I didn't mean anything underhanded, it's just a complication that made me reluctant to try it out initially. Honestly if you wanted to offer a whole turnkey commercial service with hosting and analytics and stuff I could imagine being drawn to that.

Re: The decline and fall of Java on the desktop

#334
post #180

Earlier quoted context omitted.

I love kotlin and have messed around with javafx + kotlin. It works well once you have set it up.

Do you mean TornadoFX, or some other kind of JavaFX-with-Kotlin?

I wouldn't use Tornado - it's effectively dead. Hasn't been a commit merged in for 5 months, and doesn't seem any forks have really picked up the mantle.

Re: The decline and fall of Java on the desktop

#335

Earlier quoted context omitted.

> you can streamline the process a lot by just starting with a template and let students fill in the gaps. So you don't necessarily make them spend time on "public static final void main", but setup a project in which students can type code, build and see results. By all means, if you think you can come up with a way to teach Java to children that's fun and efficient be my guest. We've been trying for decades and hav…

I helped training for programming competitions at junior high to high school levels. I also TAed for CS students at a university level. Admittedly both of these contexts correlate to more maturity and stronger motivation in the students, especially when CS wasn't so hot. It's still hard for me to believe there's no way one can make a novice productive with templated Java compared to blank-slate Matlab. It's easy to g…

> It's still hard for me to believe there's no way one can make a novice productive with templated Java compared to blank-slate Matlab.

I don't meant to imply you can't make any novices productive with Java, because obviously that's not true. People go from novice to writing Java all the time, and not just a few. But I want more.

My essential point is that while this will work for some people, it's turning off a great deal many more at a time when they are especially impressionable. For example, a student I taught wanted to go to school to be an accountant. But after learning a bit about robots he fell in love with them and now he's going to be building planetary robots next year with the hope of sending them to Mars. Now, I have nothing against accountants, but I'm not trying to make accountants. I want to make programmers, and to do that I need passionate young people willing to give it a try.

There's a huge contingent of students who have fun playing with Logo, Blockly, Scratch et al. and then just nope out when they get to Java. You wouldn't believe how many students tell me they were inspired to code by Logo. Or maybe you would believe it because that's exactly what it was designed to do! But AP CS with Java is a filter, whereas I believe it should be a springboard. These are the students I'm worried about. These are students who were told they are bad at math at a very young age by parents, teachers, media, etc. ("You're not a math person you are a sports person. Or an art person. Or a music person"), so they have very low self esteem when it comes to their potential in this area. Our society is very anti-math, to the point that we create a perception that math isn't even used in every-day life. And maybe that's the root cause of this issue, but I can't solve that one. But I can ameliorate its effects with better language design.

When these students experience Scratch et al., they believe there is a glimmer of hope for them. It doesn't feel like math. It's technical but it's also fun and kind of like a game. And they can get it. They can make programs and games.

Then they get to Java and all they see is math, which they are sure that they're bad at. And it's a huge step backwards for them too, because it takes forever to get them as proficient with Java as they were with Scratch. Going from Scratch to Java is like being blasted back to the stone age for these students.

Programmers looooove the programming as mathematics metaphor. I think a lot of programmers have mathematician envy, and so the programming languages we create for one another drip with the trappings of mathematics.

So I want to reach the students who fell in love with programming early on, have a perception of themselves that they are bad at math, and then are scared away in AP CS. These students are disproportionately girls, not because girls are bad at math but because they are told they are bad at math more than boys. If anyone is here who wants to hire more women but says "I wish we could but they just aren't applying! It's up to the teachers to train more that we can hire!" well this is part of your problem right here.

Re: The decline and fall of Java on the desktop

#336

Successfully using JavaFX (or OpenJFX as it is now called) in a mission-critical cross-platform app with 50k+ installs. It’s not that bad really. Package size and RAM usage is a bit of an issue, as we bundle it with a jlink’ed (stripped down to what is needed, thanks to Java 9 modules) JDK. Other options like Electron or native Windows/macOS wrappers around a shared core written in C++ were discussed but ultimately d…

Java apps can't be notarized for MacOS according to the developer agreement.

Can you expand on this? I know for a fact they can be _technically_ notarized, which developer agreement bans it?

Re: The decline and fall of Java on the desktop

#337

As a member of the Swing/JavaFX/Netbeans teams during the 2005-2010 period (I left the day before Oracle took over), I can tell you that this story is broadly correct, but with many missing subtleties. At the time we thought of Silverlight and Flash and Adobe Air as our mortal enemies. We were all wrong. After AJAX and HTML Canvas the web essentially killed desktop app development. All of those internal corporate app…

Yet it's 2022 and I literally don't use web-based desktop apps for my day-to-day work ? Likewise, the SteamDeck just released with a desktop UI built entirely in Qt? I feel we are living in alternate realities

Its likely that you and HN are different from the majority. Web is the de-facto targets for the vast majority of development. The vast majority of users use apps on the web with a few exception. I'm pretty sure most people I know use mail in the browser. Even a lot of the Office Suite is being used in the web.

I'm sure there are a small group of people who use native apps for everything but the rest of the population is using the browser most of the time.

Re: The decline and fall of Java on the desktop

#338

Earlier quoted context omitted.

Why should it change? Java is one of the most popular languages used today

As discussed in the article, it's slow and has compatability/portability issues. And I don't really want to play the log4j card, but...

if we assume the purpose of an entry level class is to introduce students to what they are likely to encounter in the "real world", Java seems like an excellent choice.

Re: The decline and fall of Java on the desktop

#339
post #326
post #314

Earlier quoted context omitted.

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. An…

> 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.

Re: The decline and fall of Java on the desktop

#340
post #327

Earlier quoted context omitted.

> Java has a shell by default since forever now. You can start it by issuing jshell of any semi-modern JDK. Yes, I'm aware of Jshell. Jshell is what you get when you take a static strongly typed compiled language and you give it an interactive shell. It's not exactly coherent, and still doesn't solve the most salient issues. Using JShell is better than an IDE IMO, but if we're going that direction then why are we sti…

Good luck with your research, but how are you going to discern the difference between high and low level languages? I really do believe that you would have found very similar results for C++/Rust/C vs Python/matlab/java/javascript, etc. given similar quality of third party libraries that the project depends on.

> I really do believe that you would have found very similar results for C++/Rust/C vs Python/matlab/java/javascript

Yes I believe you are on to something here.

> Good luck with your research, but how are you going to discern the difference between high and low level languages?

Thanks! I'll share my findings on HN when I get them, maybe they'll make it to the front page who knows. My research is focused on what features or design elements exactly made Matlab so much more understandable than C++. I think it comes down to

- single data structure that you can put anything in. The table is a very good general structure. Excel echoes this, as people find excel very approachable.

- single numerical type. Everything is basically a float, so you don't have to think about all the numerical nuance involved in choosing between ints, floats, doubles, longs etc.

- 1 indexing, because that's always such a sticking point to brand new programmers

- interactive IDE that allows you to see all of the variables and click into them to see their values. The Matlab REPL isn't great but it's a huge step up from the write-compile-run loop in C++.

Honestly I'd like to try Lua. It has a lot of these properties, so I think it could maybe have good success. But you're right, I'd like to rerun the experiment with all of the languages you listed.

Post reply on HN