Live data from Hacker News

The decline and fall of Java on the desktop

jdeploy.substack.com

311–320 of 362 posts

Re: The decline and fall of Java on the desktop

#311
post #151

Earlier quoted context omitted.

> It's because HTML+CSS (without even any JavaScript) is still the fastest, most effective way to build a compelling and coherent UX/UI for any platform right now. I would agree if you mean cross-platform, but other than for the web specifically, basically every platform has a much better way to create an app for it. The web is seriously so lacking on several trivial fronts that it is laughable, layouting being one e…

> basically every platform has a much better way to create an app for it I accidentally spent 4 hours writing a reply to your point here and it ended up being too long for HN's comment length limit, but I posted it to pastebin: https://pastebin.com/n6AGB62L > The web is seriously so lacking on several trivial fronts that it is laughable That depends on your project's requirements. Speaking from personal experience, m…

Thanks for the long and very informative answer! I recommend actually posting your full comment, so that it becomes longer-lived.

And I have to agree on the CSS part, I mostly meant the older times without flexbox et alia. Perhaps it is generally true of web technologies but they seem to have fixed many of their numerous mistakes in recent years (JS being quite okay as well nowadays).

Re: The decline and fall of Java on the desktop

#312
post #303

Earlier quoted context omitted.

Do you have any good resources on how to use jlink/ jpackage with Clojure? Do you somehow embed it in a Uberjar or is the Uberjar part of the package besides the JRE?

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.

Re: The decline and fall of Java on the desktop

#313

Earlier quoted context omitted.

While Java was designed to be multi-platform, C# was designed specifically to create software that could run only on Microsoft platforms. Any advantage provided by C# is negated by tying your work to a platform that could be abandoned by MS as they did to Visual Basic.

From the start C# was designed to run on any platform, which is why it compiled to IL and didn't use Win32 as the basis for the library. It didn't take long for JIT compilers to exist for other platforms.

You're just believing in MS propaganda. Yes, people created compilers and virtual machines for other platforms, but MS never considered this important. Their goal is to have only Windows as first class citizen in the .net world. If you write C# code you're tying yourself to a closed product that is restricted to a single platform.

Re: The decline and fall of Java on the desktop

#314
post #302

Earlier quoted context omitted.

> 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 la…

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

Re: The decline and fall of Java on the desktop

#315

Earlier quoted context omitted.

> And if there's any fault in the language chosen for AP computer science, the blame should go to the designer of the curriculum. Java was recommended for AP CS 22 years ago. At this point I lay less fault at their feet and I'm more interested in why it's still there at long last. > If by blockly you mean the visual interface, what you said is going to be true for any language. My research isn't published yet but I'v…

For just a lesson of writing code to achieve a specific functionality, 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. To teach them to write robotics code, you can create a Robot class for them to play wi…

> 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 haven't cracked the code, so to speak. A lot of professional developers who have no interactions with children have "thoughts" about teaching programming to children, and when those thoughts meet reality, they often find out its not so easy as just writing a little class wrapper and that's all it's going to take. The abstractions of your template designed to hide all of the complexity are going to leak very quickly, I think you will find.

> Matlab is really not a good example imo because if you start wanting to do a bit more, even if it's just to organize the code in better logical blocks, it bad design and lack of OOP gets in the way and makes further progress slower especially for the more talented students.

I've gotta ask if you've actually taught any students using Matlab (or Java for that matter). By what metric do you say it's a bad design? Are you speaking from the perspective of a professional programmer who uses tools to write professional software? Or are you speaking from the perspective of someone who teaches children regularly and are critiquing its design from that perspective?

Because in my experience Matlab has a great design for teaching. It has a ubiquitous data structure, a table, which can store any kind of datatype without having to specify it. You don't have to know about ints, longs, floats, shorts and chars -- all you need to know are there are numbers, and sometimes strings, but mostly just numbers. And the tables/arrays start at index 1. That's a huge deal for teaching students but programmers hate it. They call starting at 1 bad design, but starting at index 0 is definitely an example of something that gets in the way and makes further progress slower for children. But I've gotta say your statements about "especially for the most talented students" rings especially untrue to me because the most talented students are really never slowed down IMO.

Moreover the REPL interface of Matlab allows them to play with their code as they develop it. JAVA doesn't have a REPL and the write-compile-run loops is too long that students lose interest in the coding and debugging phase. Kids love to pair program with a REPL. They are engaged as the interactivity gives them constant incremental feedback. The write-compile-test loop of Java is long enough that pair programming isn't fun for kids. I'll put it this way: for kids, pair programming in a REPL is like playing a game, pair programming in an IDE has all the fun and excitement of writing a book report. Exploratory programming is a sad story in Java, but it's Matlab's raison d'etre.

> Sure it requires some investment on your side, but your students benefit from being able to start picking up a more marketable skill.

Here's the thing, and this is the big problem with AP CS, and why I believe that Java is still taught in this class. People think that teaching kids Java is doing them a favor because they're "giving them a marketable skill" meaning that they will be able to apply to work at Java shops after high school. From my experience they still need a good 2+ semesters with programming before anything they learn is marketable. But developing marketable skills is not really what AP CS is about anyway. All AP classes are really about getting college credit and getting a 5.0 GPA for top colleges. So the skills kids learn there are not being marketed toward companies looking for OOP programmers, they're being marketed toward colleges looking for students. And from our perspective, the perspective of college admissions boards and professors, we don't care about what language they're learning or what "paradigm" they're using whether that's OOP or what have you.

> lack of OOP gets in the way

It floors me that you say a lack of OOP gets in the way, because from my experience it just doesn't. That's completely not what I have found. OOP concepts get in the way far more than anything else. Children just do not organize the world in their brains using class hierarchies (even though that's how their social world is arranged). The original conception of OOP as message passing is far more understandable to children. Like I said my research is still ongoing, but I've gotten middle school children writing more sophisticated asynchronous and parallel code than professional developers with years of experience just through smart language design. When the language gets out of the way and kids are just allowed to think, then they can do pretty amazing stuff. Seymour Papert had kids doing advanced physics with LOGO just by framing the program from the perspective of the turtle.

> what you said isn't worth bashing the language for in general terms.

I don't think I bashed it in general terms (although you won't catch me using it, I'll bash it for other reasons in general terms that are far beyond the scope of teaching children), I am bashing it in the context of teaching children. Sorry if I offended!

Re: The decline and fall of Java on the desktop

#316
post #251

Earlier quoted context omitted.

Write LOGO first, or scratch then. Java is a good intermediate step as a first serious programming language - it has good compile time messages, and even more importantly, it has pretty much full runtime safety, which is absent from python, c, javascript et alia. With these languages students will struggle with code that seem to work, yet are faulty - it is better to fail with an “ugly” but readable exceptions during…

> Also, java is a tiny language, I really don’t get your point. Sure, hello world requires 3 lines of boilerplate, but other than that you have pretty much listed every single java feature there is. How many languages’ feature list can you enumerate in a rant? I wasn't enumerating all of the features of the language, but by saying so you basically proved my point. I was enumerating all of the features of the language…

Java ain’t having many more features. Besides primitives, everything is a class with fields and methods. The static keyword decides whether the field/method is per-class or per-instance, and you can create instances with the new keyword. Sure, there is some play here with OOP-features, but java is a really concise language. Feel free to compare it to C#, Python for example. Good luck explaining why an empty list as a default argument is problematic in the latter’s case. Let alone OOP features in Python.

Java, the language is on the order of complexity of C.

Re: The decline and fall of Java on the desktop

#317
post #93

Earlier quoted context omitted.

I hate the old school way of writing Java more than any other language. I love writing in "modern" Java more than any other language. Lombok, RxJava/Reactor where possible, and monads everywhere. It is beautiful and succinct, though I totally appreciate it may not always be easy to introduce on older frameworks or legacy projects.

Haven't used Lombox, RxJava is great, but it just feel like bandaids on a language that wasn't really designed for it. There's no accounting for taste, but I'll take either Scala or Clojure on the JVM any day of the week. Scala's monads don't feel like a library feature, they feel baked into the language...because they are.

Scala is far ahead of its time. And has been since 2014.

Re: The decline and fall of Java on the desktop

#318

Earlier quoted context omitted.

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

How does your statement contradict anything? What you use is entirely anecdotical, and the Deck is a niche gaming platform. Except for niche usages like utilities and the creative industry, classical desktop apps are dead for both consumer and enterprise users.

> Except for niche usages like utilities and the creative industry, classical desktop apps are dead for both consumer and enterprise users.

I don't even understand what you mean by "niche usages like utilities". Utilities aren't "niche".

And I literally don't know anyone who uses a computer and does not use some form of "creative" / authoring apps. Some drawing apps, some music production or maybe just the occasional recording with Audacity, trying to make games, editing ebooks with Calibre, etc. That's what human beings use computers for (and we're here to do things for human beings before anything).

Re: The decline and fall of Java on the desktop

#319
post #316

Earlier quoted context omitted.

> Also, java is a tiny language, I really don’t get your point. Sure, hello world requires 3 lines of boilerplate, but other than that you have pretty much listed every single java feature there is. How many languages’ feature list can you enumerate in a rant? I wasn't enumerating all of the features of the language, but by saying so you basically proved my point. I was enumerating all of the features of the language…

Java ain’t having many more features. Besides primitives, everything is a class with fields and methods. The static keyword decides whether the field/method is per-class or per-instance, and you can create instances with the new keyword. Sure, there is some play here with OOP-features, but java is a really concise language. Feel free to compare it to C#, Python for example. Good luck explaining why an empty list as a…

> Besides primitives, everything is a class with fields and methods. The static keyword decides whether the field/method is per-class or per-instance, and you can create instances with the new keyword.

Are you a professional programmer or a teacher?

The perspective you are sharing with me tells me you're a professional programmer who already understands all of this and finds it obvious and easy. The quoted sentence would be absolute gibberish to students.

> Everything is a fleeb with blips and blops. The slorp rump decides whether the blip/blop is per-fleeb or per-glorm, and you can create glorms with the klob rump.

Simple right? How obvious! You say it as if it's all so easy, but it takes a long time to explain all of these concepts. Students are usually very confused about the difference between a field/variable and object and a class, a function versus a method versus a static method... these concepts are quite nuanced and the differences are subtle to students, yet you are breezing past them like they are nothing or obvious.

> Java is a really concise language.

Concise: giving a lot of information clearly and in a few words. Maybe not clearly, but a lot of information in a few words is accurate. And that's the problem. Kids need a little information followed by a lot of examples and explanation. Giving kids subtle nuanced concepts and expecting them to recognize the depth of those concepts without articulating it is a recipe for disaster.

Re: The decline and fall of Java on the desktop

#320

Earlier quoted context omitted.

For just a lesson of writing code to achieve a specific functionality, 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. To teach them to write robotics code, you can create a Robot class for them to play wi…

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

Java has a shell by default since forever now. You can start it by issuing jshell of any semi-modern JDK.

Also, are you sure matlab is a good language for learning? I only have experience with learning this language not teaching but to me it was a giant oddball compared to many many languages I have learnt.

Post reply on HN