11 ms·
> How is Java not one of the biggest success story ever for a programming language? It absolutely is. Java isn't sexy, for the most part. It lets a lot of inn
by thomascgalvin 5y ago
> How is Java not one of the biggest success story ever for a programming language?
It absolutely is.
Java isn't sexy, for the most part. It lets a lot of innovation happen in other languages, then takes the successful parts for itself. This is how we (eventually) got generics, lambdas, streams, and local type inference, for example.
Java slowly becomes more ergonomic, and that slowness - the slowness to change, not execution speed - is why it gets a lot of hate. Why use Java, when $LANGUAGE_OF_THE_DAY has $FEATURE_OF_THE_DAY?
What people fail to realize, what people fail to see the value of, is that this slowness means Java doesn't get worse. Java has avoided most unforced errors. It's not like C++, where the template language is both Turing complete and the fastest way to summon Beelzebub from the depths of his infernal pit, and where you need a team of PhDs to decide which version of `auto_pointer` actually works the way you think it does. It's not Javascript, where the framework your front-end lead sold you on last week has already been superseded by the hot new thing.
And you don't generally have to worry about compatibility. Until v9, you could take code written against the 1.0 spec of the language and expect it to run pretty much out of the box. And the changes post v9 honestly aren't that difficult to work through, as opposed to Python's 2 -> 3 split.
Java isn't the sexiest language out there, but it hits a very sweet spot, right in the middle of the "familiar", "stable", and "productive" Venn diagram. It's probably the second-most important computer language developed in my lifetime, after Javascript, and is without a doubt a smashing success story.
- mashpoe 5y ago> It lets a lot of innovation happen in other languages, then takes the successful parts for itself The only time I've ever had to use Java was for a computer science class, and I thought it was a solid language (pun intended), but I hated its half-assed attempt at operator overloading. I think it's a major feature that's long overdue to be fully implemented in Java, because it's already used for some of Java's built-in classes and it's proven useful in many other programming languages. Most of Java seems very well-thought-out to me, but for some reason they decided to add only some operator overloading, instead of planning ahead more. I remember hearing somewhere that they were planning on adding operator overloading, but last I checked it didn't look like it was going anywhere.
- DerArzt 5y agoIf you are serious about using the JVM, I would suggest Kotlin or Scala as a better alternative to Java as they have all the libraries and greatness of the JVM but they have less of the historical baggage that Java brings with it. Both can be written in a Java like fashion to start, and have 100% interop with Java (you can mix the languages in projects) so the learning curve is pretty alright.
- PaulHoule 5y agoThat is the frying pan to the fire. JDK 17 has most of the good features of Scala and Kotlin. Scala seems to be designed so that you can write a short book with very fluent and natural looking demos. Make a small deviation from that and there is nothing fluent or natural about it. Kotlin is OK but isn't sufficiently better than Java to be worth using when any Kotlin dev is going to have to know Java and Java-Kotlin mapping pretty well to use libraries. (It's a similar problem to Typescript.) Both Scala and Kotlin are sufficiently similiar to Java to provide no real benefit. I'd point to Clojure as a language that is radically different from Java AND that takes advantage of the strengths of the JVM to be worth the cognitive load of having to know both a new and old language to be productive.
- thomascgalvin 5y ago> Kotlin is OK but isn't sufficiently better than Java to be worth using when any Kotlin dev is going to have to know Java and Java-Kotlin mapping pretty well to use libraries. One of the big benefits of Kotlin is that if you know Java, you pretty much already know Kotlin, too. A good Java dev can get spun up on the basics in a day or two. > Both Scala and Kotlin are sufficiently similiar to Java to provide no real benefit. Kotlin provides a ton of ergonomic features that I absolutely adore. Named parameters and default parameter values alone save me tens or hundreds of lines of code. I think of Kotlin as what would happen if a Java developer looked at Javascript and asked "okay, but what if this didn't suck?"
- PaulHoule 5y ago
- __float 5y agoWriting Java in my day job currently, I really miss C#. It feels slightly more like a "Java done right" -- the same strategy of bringing "fancier" features from F# or other languages, but it has just a _few_ more features that make day to day development just a little more pleasant.
- kaba0 5y agoNah, C# has a shitton of more features, some of them indeed making the day to day development more pleasant, while the other ones are known only by a handful of people, has strange interoperability with everything else or is superseded already by another one. It is really on the way to become as complex as C++ is.
- tkot 5y agoCould you list these features? I was under the impression that apart from some things that can be easily done in C# but are pretty much impossible to do in Java (like value types* and pointers) the languages were pretty similar. Some C# things seemed rather strange (like delegates), some purely cosmetic (like indexers) and there were also things that Java had but C# did not like covariant return types (available from C# 9.0) *Project Valhalla is supposed to bring it to Java but I wouldn't hold my breath waiting for it.
- lou1306 5y agoAccessors come to mind: class Foo { int Bar { get; set } } Allow you to get/set the value of someFoo.Bar as if it were a public member. If you want read- or write-only members, you just remove the "set" or "get" portion. If at some point you need to add logic to the setter, you just do int Bar { get; set { /* setter logic goes here */ } } You still use assignment syntax ("someFoo.Bar = newValue"), but this syntax is desugared into a call to the setter method. Ditto for the getter. IMHO they make class APIs much cleaner and forward-compatible (on the other hand, if you started with a public member and then need to add a proper setter with some logic, you would break the API). Also, non-nullable types are a pretty nice way to avoid checking for null every other line of code. And these are literally just the first couple examples that came to mind.
- VHRanger 5y agoI would say Java the language is fine, but the culture around it is what's grown the distaste many have for it. The overuse of design patterns, etc. I also find it fun how Guy Steele had in retrospect the perfect plan for Java back in the 1990s, and it took them 15 years to come around to it: https://www.youtube.com/watch?v=_ahvzDzKdB0 https://www.youtube.com/watch?v=_ahvzDzKdB0
- PaulHoule 5y agoIf Common LISP had become popular I think there would be a popular distaste for everything about it and people would be wishing they could write code in PHP, Visual Basic, COBOL, Cold Fusion, etc. (There was a popular distaste for Common LISP at the time, it was hard to find a LISPer in the 1980s who liked it. Half of that was it was hard to fit it into a 16-bit machine and wouldn't become really implementable on microcomputers until a 32-bit OS was available... Thus BASIC got another decade of life extension.) Until Java came around every book on Object Oriented programming (say "C++") had examples such as "Stack", "Queue", etc. In the case of Java you saw people starting to write objects mirroring the business and application domains. People who were trying to use objects in Smalltalk or C++ in 1990 just weren't accomplishing enough that somebody could step back and say "object orientation sucks", rather they were getting stuck and blaming themselves or blaming the tools, rather than the concept.
- thomascgalvin 5y ago> The overuse of design patterns, etc. Java has been trending away from this for some time now. A modern Spring app looks nothing like an old J2EE app.
- ajross 5y ago> Java isn't sexy, for the most part. In 1996, Java was pretty darn sexy. Managed runtimes in a high performance[1] language were an absolute revelation at the time. It's absolutely true that as it evolved, Java grew to embrace the affects and aesthetics of its biggest customers (Enterprise backend coders). And that's not sexy at all. But at the time? We all thought this was going to be the systems language for the next century. [1] Almost. At the time this email was written, the first JIT JVM was still a few months out from its early beta releases. But Gates could absolutely see where the wind was blowing.
- noblethrasher 5y agoJava's (Oracle's) strategy is to spend most the innovation on the runtime, and in that regard, it's probably the most advanced platform. The net effect is that you can write some pretty naïve and boring OO-style code that will almost always perform superbly. This is a good thing, and something that I envy as a C# programmer.
- gtm1260 5y agoOne of the biggest turn off to me of java has always been the poor quality of many java apps. Especially on mac, you know when its a java app vs native.
- pkulak 5y agoCan you give me an example? Java is used for so few user applications, the only project I can think of is IntelliJ, which is an amazing project.
- garbagecoder 5y agoI use jetbrains apps on mac. I like them a lot, but they aren’t mac-like even now. In the past they were even chunkier. SPSS comes to mind too.
- pjmlp 5y agoSPSS doesn't come to mind as having developers that would bother to read Filthy Rich Clients kind of books, or Apple extensions, http://filthyrichclients.org/ http://filthyrichclients.org/ https://developer.apple.com/library/archive/navigation/index.html?filter=java https://developer.apple.com/library/archive/navigation/index...
- gtm1260 5y agoMy mind goes to the original Arduino IDE, or Weka Studio. I know these are pretty indie projects in the scheme of things, but still.
- pkulak 5y agoAnd lets not forget that the JVM runs all kinds of things that aren't Java. So Java devs who get bored can write a few packages in whatever new hotness they like until either they're sated, Java catches up, or all new development moves over.
- exabrial 5y agoWhats the productivity coefficient for Java? Or Javascript? Or Python? or Ruby? Or Assembly? or C? I only ask because I've never gotten a straight answer with an actual number.
- kaba0 5y agoBecause there is no way to define such a number. We only “know” as per Brook’s famous paper, No silver bullets that this number has not passed a cumulative value of 10 in like 3 decades now, since the first programming languages. The only way to increase productivity is through code reuse - and given the flourishing JVM ecosystem, Java has that as a big plus.
- Zababa 5y ago> It's not like C++, where the template language is both Turing complete and the fastest way to summon Beelzebub from the depths of his infernal pit, and where you need a team of PhDs to decide which version of `auto_pointer` actually works the way you think it does. Value types on the JVM have been described as "6 PhDs, knitted together". In C and C++, this is just struct. > It's not Javascript, where the framework your front-end lead sold you on last week has already been superseded by the hot new thing. You should stop spreading stuff like that, it's false. React has been the most popular frontend framework for 6 years at this point, and Express the most popular backend framework in JS for at least 8 years. The backwards compatibility of JS is at least as good as Java, ES5 and ES6 were great upgrades (a bit like Java 5 and 8 in a way). I like Java and I think it's very important. I can say that without feeling the need to dismiss other languages that are as important as Java to the modern world.
- kaba0 5y ago> 6 PhDs, knitted together But that is regarding the implementation/specification. For the users it will be two new keywords and .ref. It will even ease the language by healing the rift between primitives/objectsz
- deleted 5y ago[deleted]
- Zababa 5y agoC++ has been used by lots of people without PhDs to great success. The language is not perfect, but for most people it's far from the hell that's described in the comment I replied to. Some people will complain about the AbstractFactoryBeanInterface in Java and say that it's hell, they are the minority. Same with C++.
- kaba0 5y agoI’m not saying that C++ needs PhDs to write, but it is one of the most complex languages out there. Even just basic usage is considerably hard (RAII, r/l-values, etc). Of course it is in part inherent in the system programming domain. But Java is a trivial language comparatively, your mentioned complexity is user-generated.
- duped 5y ago> It lets a lot of innovation happen in other languages Only if you're defining innovation as syntax and semantics to the language. Java has been the pinnacle and cutting edge of language implementation innovation decades - Sun/Oracle is/was the Bell Labs of VM and JIT research.
- 62951413 5y agoIt was about 10 years ago that the community agreed that it was the JVM that was successful. It's a platform with multiple viable languages. Scala obviously comes to mind. Kotlin is a somewhat mixed case because its popularity comes from the mobile world where you don't really have the JVM. Java is not the most pleasant language for sure. It started as a dumbed-down as golang was (still is?) for years. It's still catching up with C++ (e.g. see all the Valhalla project discussions on HN). It certainly shows its age. It's not clear to me why so many people are still fixated on Java when solid alternatives have existed for years within the same ecosystem. Also, if you don't like JPA try JOOQ.
- kaba0 5y agoHow could it catch up to C++? They are not even in the same category of languages, other than some surface level syntax, they are as different as they get.
- native_samples 5y agoKotlin is pretty popular on the server side too, and Kotlin (the same compiler) generates JVM bytecode for both mobile and server in the same way because Android very much has a JVM.