7 ms·
Don't feel stupid, I like Java too! Java is a memory safe language with a great standard library and amazing language stability that runs on all platforms and b
by matt2000 8y ago
Don't feel stupid, I like Java too! Java is a memory safe language with a great standard library and amazing language stability that runs on all platforms and beats almost all other languages on performance. Seems pretty good to me!
HN is a very skewed place that's into some very niche stuff. That can be fine, it's good to be interested in new things, but no one should draw too many conclusions from trends we see on here.
Just to poke a few HN bears by way of example:
* Rust will never see widespread adoption. It's just hard and complicated, so seems cool and exclusive.
* Lisp isn't gonna happen either, and that's because it's not even a good choice for most problems. It just feels really really cool when you write something in a purely functional way and so you imagine that _must_ mean this is some higher plane of existence. Not really, we've had 30-40 years for this thing to take off, not happening.
* Even Erlang, while really cool, is just a super niche thing. If you're making a huge messaging service then definitely go for it, but you're making a website? Choose pretty much anything else.
There's a lot of reasons for all of the above (low average amount of experience leading to long term memory loss for the industry being the big one), but this comment is too long already and everyone's just going to be mad about the Rust stuff anyway.
- ulkesh 8y agoI adore Java! It has been a skill I’ve used at a few jobs now and I wouldn’t want to do anything else. If people get upset about your opinions, then that’s their problem.
- GorgeRonde 8y agoMost people who have durably coded in java and say, Haskell or a Lisp (as I have) or any other trending language on HN will prefer the latter. Knowing that (as I did) why not expand your horizon (as I did) ?
- throwawaymath 8y agoI don't see how you could possibly state that conclusively. What leads you to believe most Java programmers would prefer Haskell or some flavor of Lisp? You're saying that people who spend time in both will prefer the latter, but it seems equally plausible that people wouldn't spend time in both because they don't like the latter.
- GorgeRonde 8y agoYour point can be generalized to support any local optimum. Come on. "It seems equally plausible that people wouldn't spend time hearing your argument because they don't like it". Still, this is a bit harsh to return your argument like this, because you're striking a good point: getting to know a language and its "philosophy of use" takes time. However, i do not see why not having taken the energy to climb out of your comfort zone to reach what is considered a better optimum by those who have would give any more weight, by comparison to the alternatives, to your opinion. Edit: I have never used Haskell, but if I had to chose a next language to learn this would probably be it. Simply because people who use it speak of it as a kind revelation by comparison to the the way they used to program in their previous language. Also since I have worked for quite some time with the dynamic alternative in FP (Clojure) I might well try its static variant with Haskell. However as you pointed out, I'm not learning it because of lack of time/focus. Still that does not prevent me from listening closely to what Haskellers have to say, or say people from Common Lisp or even people attached to the JVM and its language ecosystem. Why ? because their experience is valuable. It's not just theirs, and it could way have been mine.
- throwawaymath 8y agoMy point can be generalized, sure. But you haven't substantiated the idea that most people who try both Java and Haskell/Lisp will prefer Haskell/Lisp. That's precisely why my very general point is applicable - your claim is sufficiently unsupported that I can simply reverse the hypothesis and we have no more or less information than we started with. If you'd like, I can trade anecdotes instead - I used to work at a company with a large codebase consisting of nontrivial Java, Clojure, Scala and Haskell. Nearly every engineer I spoke to preferred Java (and I had to interact with nearly all the 300 engineers who worked on it). Now at this point it may seem like I'm being a curmudgeon. But the reason I'm harping on this is because your implicit claim is that Haskell/Lisp are better languages for either productive or aesthetic reasons. But I don't think that's a fair statement - they're different languages, suited to different tasks. You shouldn't draw the conclusion that people who have e.g. moved on to Haskell from Java are representative of most Java developers. It's equally plausible that most Java programmers don't want to move on from Java, and so wouldn't like Haskell if they've tried it. Or perhaps they have tried it and simply didn't jive with it.
- preordained 8y agoFor me, I can't let go of my JVM. Clojure is good though.
- mruts 8y agoWhat about Scala? It's probably my favorite language: incredibly expressive, FP+OO, higher kinded-types, great tooling, flexible performance (you can adjust between elegance and java/C++-like performance very easily), and runs on the bullet-proof JVM.
- GorgeRonde 8y agoFor me it's the opposite. I wouldn't let go Clojure ('s standard lib and datastructures) and I don't really care about the JVM !
- madhadron 8y agoI've done significant work in Java and Haskell and some but not huge amounts of production work in Lisp. Writing Java isn't particularly onerous and the tooling is great. That being said, I am told my Java is very unusual: lots of anonymous implementations of interfaces, almost no inheritance, code that feels procedural in its local organization.
- bnolsen 8y agoThat's pretty much modern c++ coding. But more templatization (since there are no interfaces) at this point...
- fsloth 8y agoThat's context sensitive. I love the functional language zoo but the ecosystem is such that for particular problems I prefer still to write C++. Languages have their runtime and their constraints, and there are some areas where maturity, tooling and explicit industry support trumps language quality.
- freeone3000 8y agoHaskell and lisp are cool! But they don't let me stand up a webserver quickly and easily, find some nicely licensed libraries, autocomplete the rest of the code, and be done with the data ingestion website by lunch. express, in node, and ktor, in Kotlin, are simply much faster ways to set up whatever you need than Elixir or Rust or what-have-you. I do my throwaway coding in Java, because it doesn't matter, and my durable coding in Python, because it must be in Python for wide adoption.
- ulkesh 8y agoI have learned many languages. Just because I adore Java doesn't mean I despise everything else. I just happen to prefer it and have no reason, at this time, to use anything else for server-side work.
- hedora 8y agoIn addition to the new trendy languages, I suggest learning modern C++. Java is a good set if training wheels if you want to learn OO patterns. C++’s template system is turing complete, which means its type language is too. That lets you move the vast majority of java runtime type errors to compile time. Moving from Java to modern C++ is analogous to moving from spaghetti Python code to well-structured Java in my book. Also, C++ is extremely well established.
- raverbashing 8y agoSo, I'm curious, what is it about modern C++ that you think is better than Java? Because I know (old) C++, some of the modern stuff and a bit of Java, I don't know the full history.
- badfrog 8y agoOP already said: > That lets you move the vast majority of java runtime type errors to compile time That's a huge win.
- pvg 8y agoIs it? It suggests that typical Java code is for some reason full of run time type errors which it isn't. Whatever the differences between and respective advantages and disadvantages of Java and C++, runtime type errors are just not a some typical Java problem, let alone one that C++ solves.
- koala_man 8y ago>which it isn't NullPointerException is a run time type error and quite common. I'm not convinced it's a problem C++ adequately solves, though.
- pvg 8y agoYou can take a view of types that is broader than the one Java actually uses such that an NPE is a 'runtime type error' but you can do that with lots of runtime errors. It's not what the poster is talking about.
- mruts 8y agoThe people I've met who like Java are the kind of people who don't know any other programming language. In fact, I'm not sure I can think of a worse language than Java. Moreover, when people say the like Java, what they really mean is that they like the JVM.
- noisem4ker 8y agoI've had to study and use my share of programming languages, from C to Haskell. Java is just one of them, and it's the one I like the most. Want to know a language undoubtedly worse than Java? Easy. Append "Script" to it.
- yjftsjthsd-h 8y ago> In fact, I'm not sure I can think of a worse language than Java. COBOL. BASIC, including VBA. Older versions of FORTRAN. All real languages used widely and in production, all far worse than Java.
- a-saleh 8y agoI for one, LOVE both BASIC and VBA :-) But maybe that is just nostalgia speaking, BASIC was my first language :)
- i_am_proteus 8y agoNot sure the Fortran dig is fair. FORTRAN77 was good for the applications it was designed for in 1978. Modern Fortran is still useful for scientific computing.
- yjftsjthsd-h 8y agoI would argue that even for the time early versions were not particularly ergonomic or nice to work with. And yes, I will actually be the first to defend modern Fortran; calling out older versions specifically was a very intentional choice on my part. Granted, I'm unclear on how much the newer variants are used; legacy code bases form a pretty big backlog.
- 8y ago
- willtim 8y agoPeople get upset when the industry fails to make progress and adopt good ideas from academia. Java adopted GC in 1995 and Lambdas in 2014. The rate of progress is frustratingly slow for many. I gave up Java for Haskell 8 years ago and couldn't be happier. In fact, I'd rather switch careers than go back to Java, the productivity and the ad-hoc frameworks would be too painful.
- ulkesh 8y agoThat's great for you. Java works quite well for me and I've had no need to go elsewhere for a server-side language in the last five years. And what do you consider are ad-hoc frameworks? Spring is hardly ad-hoc.
- willtim 8y agoSpring and "aspect-orientated programming" are completely ad-hoc! They use reflection and byte-code generation to implement various forms of runtime magic. This makes reasoning about ones code much much harder. IMHO there are much better ways to solve the dependency and cross-cutting concerns problems, unfortunately Java is not expressive enough to encode them. To be clear, I'm not saying Spring isn't useful, I'm saying the fact that Java needs Spring is unsatisfactory. I wouldn't say my situation is great, most jobs are Java jobs :)
- reikonomusha 8y agoCommon Lisp currently isn’t so great for purely functional programming. The language has the equivalent of GOTO, imperative loops, mutable objects, etc. But work is being done to make it a better functional language.
- dreamcompiler 8y agoYou can write purely functional programs in CL by simply choosing not to use those constructs. Most modern Common Lisps have proper tail call elimination, so you don't need loops. I can think of a couple of issues with Common Lisp that make it less ideal for FP than Haskell, but they don't involve the things you mentioned.
- coldtea 8y agoLisp was never meant not to have those. The idea that "functional programming == immutability" is a modern one, not the traditional understanding of functional programming. In fact, 10-something years ago, nobody really cared much on immutability on HN, while everybody still talked about Lisp and functional programming (it was all about first class functions, closures, map/reduce, recursion, DSLs, and macros). Immutability come into the fore (well, for HN) along with Haskel and Clojure -- plus the idea that immutability gives you multicore for free. Even in Paul Graham's essays, the "foundational documents" of this community, when he talks about Lisp he hardly talks about immutability as any kind of key point.
- macintux 8y agoThere are all sorts of ways that immutability helps at scale, so it's not surprising that as time goes by it seems more and more useful.
- fulafel 8y agoThe meaning of functional programming has shifted over time. First class functions, currying, anonymous functions etc have come to mainstream languages and modern fp has developed immutable data, lenses, etc.
- sedachv 8y ago
- pjc50 8y agoLisp is definitely not going to happen, but given the ongoing expansion of C++ to (to me) unlearnably huge levels I think Rust will find a substantial niche in embedded and HPC systems, not to mention Firefox. For "just write a thing that works" I've come to really prefer C# for desktop apps and Python for small things.
- 4thaccount 8y agoI have reservations about Rust in HPC. There are simply a lot of libraries missing for scientific computing that you find in Julia, Fortran, Python, Matlab...etc. You can of course write all your stuff from scratch like several vendors I know have done with C & C++, but I think that is the exception and not the rule.
- ams6110 8y agoCan you as a Java developer tell me why it is then that every time I have a problem on a Linux machine with OOM killer randomly terminating things and general performance problems it always traces back to someone's Java program. Why does Java have a reputation as a memory and resource pig?
- ken 8y agoOne possible cause: because (apart from leaking some memory) they’re stable. The long-running programs I’ve used in other languages are architected so they respawn new processes regularly. Or they crash often enough on their own that they don’t get the opportunity to leak a ton of memory. Of the 4 long-running C-family programs I use the most, 3 have crashed in the past 2 days.
- ufmace 8y agoI'd agree that Java gets maybe too much hate in hacker communities. Java is fine IMO, if maybe a little boring. Not terribly useful for exploring cool new language design theories, but just the thing for writing a Line Of Business app that can get useful stuff done and not require updates and security patches every month. I've never written cross-platform GUI apps in Java myself, but it seems like it's probably the least-bad way I know of to write cross-platform desktop applications that share most of their code. Mostly agree on the other points. I do like Rust, but it's still young, and many potential areas of use just don't have mature library support with lots of features yet. And some of the community enthusiasm does get over the top - I'm sure not holding my breath for rewrite everything in Rust crowd's wishes to come true, no matter how bad memory misuse bugs have been - including the Linux kernel and the universe of GNU utils.
- muxator 8y agoDid you ever considered C++/QT? Writing cross-platform GUI (and non-GUI) applications is one of its many good use cases.