TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why I Like Java (2014)

93 pointsby lycopodiopsidaover 3 years ago

31 comments

smoyerover 3 years ago
You can write a pretty trivial Java program to copy stdin to stdout but Java is <i>still</i> one of the enterprise languages and people writing enterprise applications don&#x27;t tend to write this type of software (but they do tend to have log4j vulnerabilities). The strengths of Java are its mature dependency management system(s), its comprehensive standard library and the vast ecosystem of third-party libraries. A better test of the language is whether you can write a complicated application in relatively fewer lines of code.<p>I spent much of my career writing Java code but have moved to Go - it&#x27;s almost a return to my roots as an embedded systems engineer (without the memory management hassles of C) and it&#x27;s vastly more economical to run Go applications in containers. I do find myself writing code that I used to pull in from a library though.
评论 #30416120 未加载
评论 #30415907 未加载
评论 #30415799 未加载
评论 #30417404 未加载
评论 #30416308 未加载
评论 #30419816 未加载
评论 #30415750 未加载
CraneWormover 3 years ago
&gt; Different languages have different failure modes. With Perl, the project might fail because you designed and implemented a pile of shit, but there is a clever workaround for any problem, so you might be able to keep it going long enough to hand it off to someone else, and then when it fails it will be their fault, not yours. With Haskell someone probably should have been fired in the first month for choosing to do it in Haskell.<p>So much unnecessary hate and stereotyping. And I bet they were thinking they&#x27;re tongue-in-cheek-but-still-sounding-clever.<p>Also, interesting choice of programming languages, neither Python, PHP nor C got any flack, Javascript was spared but Java, Perl and Haskell are evil and using them makes you a &quot;mediocre drone that cares only about cranking the lever and spouting code&quot; (I&#x27;m paraphrasing the article here).<p>Choose your technology, learn your tools...<p>&gt; I enjoyed programming in Java, and being relieved of the responsibility for producing a quality product.<p>Although, with that mindset, maybe forego programming altogether.
评论 #30415943 未加载
评论 #30416117 未加载
评论 #30416383 未加载
评论 #30416169 未加载
评论 #30415975 未加载
评论 #30437608 未加载
marktangotangoover 3 years ago
Java: plentiful well paying jobs, good&#x2F;great tools, good&#x2F;great runtime. Personally, I like boring, predictable, &quot;easy&quot; (referring to low cognitive overhead of statically typed languages in general) for work, and save the fun stuff (lisp&#x2F;scheme in my case) for personal projects.
评论 #30417145 未加载
评论 #30417478 未加载
评论 #30417393 未加载
评论 #30422540 未加载
ysleepyover 3 years ago
Yeah, keep writing perl and spout cynicism about everything.<p>I feel like they are chasing a aesthetic of conciseness, their perfect little haskell program, not recognizing that regularity and good api design are much more important.<p>What is beautiful for a 100loc program becomes ugly and wrong for a 100kloc program. Other aspects become much more important.<p>I&#x27;m not a huge fan of go, but it proved there is a necessity for boringness in cooperation.<p>Boring syntax does not mean the upper limit is mediocrity, saying that is revealing shallowness.
评论 #30415684 未加载
评论 #30415895 未加载
jnmandalover 3 years ago
Five years ago I might have said this was a &quot;dis&quot; or &quot;flame&quot; article. Now I too see the benefits of java while simultaneously feeling it&#x27;s a bloated and verbose language.<p>We have a tendency to believe that everything we produce needs to be &quot;high quality&quot; but that is a subjective measure. Sometimes we just need to write a program that can be handed off and maintained by the next set of devlopers. For that, java is a useful tool.<p>Programming languages are just tools. You will have your favorite to use but that doesn&#x27;t mean it&#x27;s the one you should be using on most jobs.
评论 #30420415 未加载
stickfigureover 3 years ago
Obviously the right solution here is:<p><pre><code> #!&#x2F;bin&#x2F;bash cat - </code></pre> Java has come a long ways since 2014. You can now code in functional style pretty naturally, checked exceptions are fading from use, and tools like lombok have stripped away the worst boilerplate excesses (getters, equals&#x2F;hashcode impl).<p>This always riles people up, but I&#x27;ll assert it again: An <i>equivalent</i> modern app that does something useful is shorter in Java than in Ruby or Python, largely because the type system enforces many of the things you would otherwise have to write explicit tests for.
Semaphorover 3 years ago
426 comments when it was originally posted in 2014: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7463671" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7463671</a>
zcw100over 3 years ago
I feel like people get what makes for the best programming language wrong in the same way they get the &quot;fittest&quot; wrong with darwinian selection of &quot;survival of the fittest&quot;. It&#x27;s not necessarily the prettiest (although that can help) or the fastest, or some subjective assessment of the best. It&#x27;s what survives. Sometimes that&#x27;s a stallion, other times it&#x27;s a dung beetle but both are the best at what they do and if you put it in the wrong environment they die. Java&#x27;s just doing what it does and it has survived where others have died.
jordanpgover 3 years ago
&gt; write a program that copies standard input to standard output<p>This is pretty trivial in Java, just as in other languages. But most people don&#x27;t ever need to learn the low level `System` methods needed to do it.<p>To me, this highlights the difference between a comprehensive approach to learning a language and a more piecemeal one. I learned Java by reading the canonical books from cover to cover, like Effective Java. But I think this is pretty rare. For example, I recall interviewing many experienced Java programmers who didn&#x27;t know what things like `protected` or `volatile` mean.
评论 #30415950 未加载
评论 #30415600 未加载
评论 #30416415 未加载
评论 #30416560 未加载
评论 #30415904 未加载
评论 #30417636 未加载
da39a3eeover 3 years ago
I’ve recently joined a company using Java. I’m open minded, and know that there are lots of good things about the JVM and the modern Java language. However one thing I hate is the complete disregard for command line UX. People writing Java command line tools seem to think it’s absolutely fine to spew 1000 lines of unformatted informational messages and non actionable warnings with bizarre indentation and not to provide any flag to turn this shit off. It’s like they just view the terminal as some sort of obscure log file that no-one’s likely to look at.
评论 #30416297 未加载
评论 #30416007 未加载
评论 #30416568 未加载
评论 #30416564 未加载
exabrialover 3 years ago
These sort of posts crack me up as it&#x27;s another person jumping on a bandwagon they don&#x27;t understand, but are also really sad, as it&#x27;s taking a lot of otherwise talented people and ruining them.<p>&gt; being relieved of the responsibility for producing a quality product<p>I&#x27;ve seen this sort of elitism in candidates and I&#x27;ve made the mistake of hiring them. It turns out they&#x27;re just not very good at all, and they blame their failures on anything but themselves, stunting their self-growth professionally and interpersonally.
评论 #30416717 未加载
coldteaover 3 years ago
If the infamous HN Dropbox comment didn&#x27;t exist, this post would serve well as the canonical &quot;facile dismissal&quot;.<p>Reminded me of PG&#x27;s essay about the &quot;blub&quot; programming language.<p>But, in this case, I&#x27;d like to reverse the use of the concept: it&#x27;s not that Java is a blub programming language, but that the OP has only reached a blub-state of understanding it and its potential, and produced a blub (generic and derivative) argument against it.
评论 #30415862 未加载
评论 #30416488 未加载
oweilerover 3 years ago
This hasn&#x27;t aged well<p><a href="https:&#x2F;&#x2F;docs.oracle.com&#x2F;javase&#x2F;9&#x2F;docs&#x2F;api&#x2F;java&#x2F;io&#x2F;InputStream.html#transferTo-java.io.OutputStream-" rel="nofollow">https:&#x2F;&#x2F;docs.oracle.com&#x2F;javase&#x2F;9&#x2F;docs&#x2F;api&#x2F;java&#x2F;io&#x2F;InputStrea...</a>
评论 #30417600 未加载
ModernMechover 3 years ago
&gt; If it takes ten times as much code as it would to program in Haskell, that is all right, because the IDE will generate half of it for you, and <i>you are still being paid to write the other half.</i><p>Well that explains it. For me, I’m not going to touch Java unless I’m being paid to do it. IMO it’s a travesty that Java is the language of the AP test, because it really leaves the impression in young people that all of programming is Java. If that were the case, I’d be as far away from programming and computers as I could get.
jcadamover 3 years ago
I&#x27;ve found Kotlin to be a fantastic Java substitute. Fully compatible with Spring and seamless interop with Java.<p>Though I prefer Clojure where that&#x27;s possible.
评论 #30418635 未加载
评论 #30425706 未加载
FpUserover 3 years ago
I&#x27;ve had a bit of fun with Java some years ago when I was asked to write a converter from some proprietary music format to midi. Using Java was non negotiable requirement. While I succeeded and the project brought me gobbles of cash in very short time I was grinding my teeth on byte &#x2F; bit level manipulations. Java was definitely not created with this kind of programming in mind.
vikingcaffieneover 3 years ago
Modern Java is actually pretty good. It&#x27;s taken great features from other JVM languages like Kotlin and Scala and is much better for it. The JVM is a wicked fast run time and its nice to have a mature ecosystem of libraries to work from and large pool of developers available who know it inside and out. You could do far worse when picking a language for your team to use.
joshlemerover 3 years ago
I actually really don&#x27;t mind Java-the-language all that much, in fact I&#x27;d say I think it&#x27;s pretty great. My problem with Java is that the ecosystem and culture of Java tend to leaning heavily on annotations for everything. It&#x27;s not just Spring (though this is probably the worst offender) but everything from Configurations and Command-Line Parsing to DB access and connections, testing, serialization, it seems like overwhelmingly the community leans towards annotations for everything which to me makes working with the tools really difficult to discover and even more difficult to control or modify. There are some exceptions like Vertx.io for instance which are plain-code baed but I find working in a &quot;Java shop&quot; you are usually pushing against the grain if you&#x27;re trying to avoid Spring&#x2F;Hibernate&#x2F;Jackson&#x2F;etc.
评论 #30422978 未加载
lasereyes136about 3 years ago
I have written a good deal of Java as a professional Java developer for over 10 years. The core truth the article gets right is that Java is meant to be a language Enterprise developers can use and be reasonably sure other people can pick it up and work with it. Java is a defensible choice in that you can hire people that know Java, easily buy Java training, and have a lot of tools for Enterprise Java development that you can get (OSS or commercial) that will help your Java developers get Enterprise apps created.<p>Java, in many respects, is the COBOL replacement created in the 90s that will live on in the Enterprise for decades to come. Just as COBOL lives on.
oftenwrongover 3 years ago
Java has a high bar for the amount of prerequisite experience it takes to write good code. In other words, it has too many pitfalls for beginners. It is a phenomenally poor choice of language for teaching beginners to code.<p>On the other hand, a lack of beginner-friendliness could also be seen as a lack of effective static analysis. Of course, this is a very Java programmer point-of-view.<p>Others: &quot;you shouldn&#x27;t need to have that&quot;<p>Java programmers: &quot;but I do have that&quot;<p>If you are in a position to pick tools for your organisation, think about how your choices would accommodate beginners. Not all of your tools can be or should be easy for beginners to use, but it is an important quality to consider.
评论 #30420798 未加载
评论 #30418451 未加载
评论 #30416767 未加载
zmmmmmover 3 years ago
A little tongue in cheek, but the strength of Java is that you don&#x27;t have to actually use it to work in the Java ecosystem. Here is the entire program to copy stdin to stdout in Groovy:<p><pre><code> System.out &lt;&lt; System.in</code></pre>
mi_lkover 3 years ago
tangent: what are some modern java OSS codebases that you would recommend to read?
评论 #30416402 未加载
评论 #30416179 未加载
评论 #30415935 未加载
评论 #30415923 未加载
nanrehover 3 years ago
This guy is like the character in Superbad that can only ever draw dicks but in his case every time he tries to write he writes “I’m a dick”
penlightmentabout 3 years ago
The verbosity and high level of abstraction due to being fully OO, makes me feel like Trypophobia.
bigpeopleareoldover 3 years ago
I&#x27;m not a professional Java developer, but I work at a company that uses Java, so it just came with the territory to understand things about it, even though I&#x27;ve already had at least a basic grasp of it. I feel blessed that most of the code is mostly straightforward Core Java code (as opposed to any framework-level fun). It is treated a bit like a systems programming language. However, I can agree with this article. It&#x27;s safely boring to me (despite the fact that having an IDE to write your boilerplate is still necessary for the sake of your fingers.)<p>Since not being a pro at it and not planning to be, I&#x27;d rather toy with other things. The job market is diverse in its technical needs. :)
pendar747over 3 years ago
One of my favorites articles ever, finally found something that expresses why java is such a boring and inadequate tool for tackling most problems
yoyarover 3 years ago
Anytime I learn a new language (I regularly write code in several) I start asking how is testing done, where are the libraries, where is this, and how do I do that? I already have all of that and more at my fingertips. Also, Groovy is vastly underrated. It’s the most economical and easiest to understand language I know meaning I can do more with less code and faster in general.
评论 #30420672 未加载
pannyover 3 years ago
IOUtils.copy(System.in, System.out)<p>What do I win?
评论 #30423705 未加载
DeathArrowabout 3 years ago
My 2 cents:<p>Too much OOP forced upon you. Too much boilerplate. Too much verbosity.
unnouinceputover 3 years ago
Yeah, reading it all I still think the author is just dissing Java, despite his, in big bold font &quot;I really like Java&quot;. Nevertheless I had a really good laugh.
whoomp12342over 3 years ago
Java was great, until oracle.... yeah.