| ▲ | adgjlsfhk1 a day ago |
| It's amazing that ~30 years on, Java is finally becoming a not horrible programming language. |
|
| ▲ | willvarfar a day ago | parent | next [-] |
| I'm someone who wrote a lot of 'raw' Java and C++ without frameworks, which meant there was a lot less boilerplate and indirection etc. And for me, the big usability boon came about 10 years ago, around the same time for both Java and C++, when they started supporting lambda functions. I started passing code into algorithms and, although it sounds quite complicated, it simplified my programs substantially. Before that syntactic sugar gave the affordance I hadn't been organising my programs that way. For the longest time Java had been very keen to be explicit, to the point of needing a log of cruft where it just felt like the compiler was checking you spelt every letter of the incantation correctly because both the compiler and you knew unambiguously what simple thing you were trying to achieve. But this tone changed in Java around the time the new entrants like Kotlin started taking over as what you develop in in a way that scala and clojure never managed. And suddenly all the get-out-of-your-way of lambdas saving you typing out classes and anonymous classes arrived and Java became a much nicer experience imo. |
| |
| ▲ | Yoric a day ago | parent | next [-] | | Yeah, as someone with a background in FP, I found anonymous Runnable classes quite awkward. | |
| ▲ | Nursie a day ago | parent | prev [-] | | Now if we could just wean some more of the ecosystem away from the framework fetishism... there's no reason java programs have to be so huge, unwieldy and slow to start. No reason apart from the framework epidemic that's supposed to make things easier for developers, but in the end hamstrings them and weighs everything down. (to the downvoters - I am a java developer and this is very real to me at the moment!) |
|
|
| ▲ | bigstrat2003 a day ago | parent | prev | next [-] |
| Java was never a horrible programming language. The hate is wildly overblown. |
| |
| ▲ | userbinator a day ago | parent | next [-] | | The culture of insane overengineering around it is the problem, not the language itself. | |
| ▲ | pjmlp a day ago | parent | prev | next [-] | | In fact, it was welcomed in open arms even being originally interpreted, because writing portable C or C++ code in 1996 was still a mess, even across UNIX flavours. On my university no one got Sun's marketing money in 1998, yet the distributed systems, compilers design, and graphics programming, all adopted Java as the language for new teaching materials, as it sorted out several problem with the assignments. | | |
| ▲ | Yoric a day ago | parent [-] | | Yeah, migrating from C++ was such a breath of fresh air! Both awt and then Swing were pretty bad for anything beyond toy programs, though. | | |
| ▲ | pjmlp a day ago | parent | next [-] | | Comparing to writing X11/Athena or Win32 in raw C? Which is what the respective department was doing before. Swing is great, it does suffer from bad defaults though. Anyone serious about it, would be getting books like Filthy Rich Client, and additional libraries like JGoodies. Granted, they only came to be around Java 1.4 timeframe. | | |
| ▲ | Yoric 20 hours ago | parent [-] | | I was using OWL at the time, which I recall as pretty good. Swing was nice to program, but had sluggish reaction time and more than a few bugs (speaking of Swing 0.9/1.0, never went much further). | | |
| ▲ | pjmlp 20 hours ago | parent [-] | | OWL was quite good and one of my favourite C++ frameworks, but not something that was being used at my university on assignments that were mostly done on UNIX, which was my point. | | |
| ▲ | Yoric 17 hours ago | parent [-] | | Yeah, under UNIX, the UX landscape was really bad. I think that Qt was available already, but not quite open source. |
|
|
| |
| ▲ | speed_spread 3 hours ago | parent | prev [-] | | Swing is so bad they built an entire product line of IDE out of it. |
|
| |
| ▲ | 13 hours ago | parent | prev | next [-] | | [deleted] | |
| ▲ | echohack5 a day ago | parent | prev | next [-] | | In 2012 managing the JVM was a nightmare. Java is fine now. | |
| ▲ | a day ago | parent | prev | next [-] | | [deleted] | |
| ▲ | TZubiri a day ago | parent | prev | next [-] | | Only bad experience I remember from Java was the int/Integer primitive/object issue and boxing. Also of course the misuse and overuse of classes when designing systems, but the complexity at design time is also the counterpart of the ease of use of well designed APIs. I remember using an IDE to write some code and it skipped the whole documentation and run/compile error phase, I could just cast mismatching types as needed. Probably C# and Swift/Objective C would only be above Java as top languages, being actually funded by paying customers instead of used by companies that depend on volunteer developed open source software and end-users that equate paying for software with evilness. | | |
| ▲ | voidfunc a day ago | parent | next [-] | | Being forced to use anonymous classes to simulate lambdas prior to 8 was the biggest source of annoying boiler plate IMO and was genuinely a bad experience in sufficiently complex or large code bases. Everything beyond 8 has been nice to have but 8 was the big one. | | |
| ▲ | kelnos a day ago | parent [-] | | Agree, for the most part, but I think records and pattern matching are essential. I started using Scala (2.x) in 2014 or so, and case classes and pattern matching completely blew my mind. if/else trees and switch statements felt so archaic, limited, and verbose after that. I used to joke that Java would eventually adopt enough of Scala to be a pleasant language to work in, and I don't think I was that far off. (I'll ignore Kotlin... I don't get why people like it.) | | |
| ▲ | DmitryOlshansky a day ago | parent [-] | | I too adopted Scala in 2014 and was really satisfied with FP side and how it all was tied with JVM. Honestly I always felt that JVM is a nice platform with a horribly verbose “assembly” language that is Java. Fast forward to around 2020 and I had to organize a team to build search engine in JVM. Given how hard it is to find decent Scala developer I surrendered and did this project in Kotlin. Java devs easily pick up and write sensibly FP-style even code, and builtin coroutines are cool. Even though I had to open up the internals of coroutines to get tracing to work they felt a very welcome change compared to say monadic explicit async. So for me Kotlin is kind of watered down Scala for typical Java folks and I could tolerate it compared to perspective of writing plain Java. |
|
| |
| ▲ | tetha a day ago | parent | prev | next [-] | | > Only bad experience I remember from Java was the int/Integer primitive/object issue and boxing. Heh, I once had to work in a code base that used an `Integer premiumDefenseLevel`. It contained the level of premium defense a player had purchased, or null if the player didn't have any levels of premium defense purchased in the recent times. This was in fact annoying to remove, because a 0 after a 1 was treated differently than a null some time for advertisement reasons: Someone who had bought premium defense in the past is more likely to re-buy than someone who didn't, so they are pestered with ads. But it eventually turned into a neat little domain object. | |
| ▲ | nananana9 a day ago | parent | prev [-] | | > the int/Integer primitive/object issue and boxing. That's a deal-breaker. If you can't tie together a few values in a record/struct without being forced to box them/heap allocate them, the language will never be used anywhere where you even remotely care about performance. This is not a difficult problem to solve - C# did it in a very elegant way with structs, and as a direct result, probably for half of all videogames written today, the gameplay portion is written in C#. | | |
| ▲ | adgjlsfhk1 a day ago | parent | next [-] | | imo it's worse than that. of they'd just hid the boxing in the runtime, Java would be a kind of slow language that didn't feel awful. by exposing the unboxed primitives to the user, they created a horrible duality of incompatible types. | | |
| ▲ | brabel a day ago | parent [-] | | You Guys haven’t used Java since the 90’s right? Boxed types convert to primitive values automatically, you never need an explicit cast! What horrible duality are you talking about? |
| |
| ▲ | brabel a day ago | parent | prev | next [-] | | What are you criticizing exactly? You can have primitive integers in Java records or classes just fine. If you have many you can use an int[] like in C, no one forces you to use generic containers. | |
| ▲ | huhlig a day ago | parent | prev [-] | | Uhh. Most big data platforms are jdk based. Java handles scalable long running applications incredibly well for a fraction of the cognitive load. |
|
| |
| ▲ | troupo a day ago | parent | prev [-] | | It's not a terrible language, but it's not too good either. For a very long time it completely stagnated and all the features we see added now should've been there 10 years ago, at least, and a bunch of other improvements on top. All because "our goal isn't to adopt the strategy of less successful products, but to forge our own" which now turned into busily adopting all the features that the "less successful products" have had for years: https://news.ycombinator.com/item?id=28985688 |
|
|
| ▲ | voidfunc a day ago | parent | prev | next [-] |
| Meanwhile some languages like Python still suck 30 years later. |
|
| ▲ | vincnetas a day ago | parent | prev | next [-] |
| Most likely you have not seen horrible languages or your bar for being not horrible is quite high. |
| |
| ▲ | mrkeen a day ago | parent [-] | | Or they've seen enough good languages to push Java down. | | |
| ▲ | adgjlsfhk1 a day ago | parent [-] | | this one. Java is far from the worst out there. I've used MuMPS and know of the horrors of TCL, but Java is once of those languages where everything takes 5x more more code than it should, and the result always feels ugly. part of my dislike is probably that I'm a math person, and the lack of operator overloading really makes any math not using the built-in types dreadful to read. |
|
|
|
| ▲ | guidedlight a day ago | parent | prev [-] |
| Even so. It has amazing backwards compatibility and package management. |
| |
| ▲ | adgjlsfhk1 a day ago | parent [-] | | I really hope you mean this as it has (amazing backwards compatibility) and (package management), because describing the package management in Java as anything more than "I guess it's better than C" feels overly generous |
|