Live data from Hacker News

Why I Like Java (2014)

blog.plover.com

41–50 of 152 posts

Re: Why I Like Java (2014)

#41
post #11

You can write a pretty trivial Java program to copy stdin to stdout but Java is still one of the enterprise languages and people writing enterprise applications don'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…

A better test of the language is whether you can write a complicated application in relatively fewer lines of code.

To a point. In many situations, a better test is whether a coder unfamiliar with said complicated application can maintain it relatively easily.

Re: Why I Like Java (2014)

#42

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

Accusing Mark Dominus of throwing shade on Perl seems misguided.

Re: Why I Like Java (2014)

#43
post #7

tangent: what are some modern java OSS codebases that you would recommend to read?

I like the Apache Pulsar codebase. Well designed with a mix of code at different layers of abstractions depending on the module. Particularly good if you want to learn about writing network servers and distributed systems.

Re: Why I Like Java (2014)

#44

Earlier quoted context omitted.

volatile has nothing to do with thread safety or the memory model in modern C. It's strictly for access to memory-mapped resources, where common assumptions relied-on by optimizers may fail. It should never be used for multithreading, use proper atomics and other provided facilities instead.

Correct, but it’s worth noting that ‘volatile’ in Java does provide atomicity.

True, the guarantee of atomicity does come up in Java wrt. fields of type long or double, for which atomicity is not provided by the Java memory model in the absence of volatile. More to the point, volatile in Java provides linearizability which is a bit stronger than simple atomicity.

Re: Why I Like Java (2014)

#45
post #5

Yeah, keep writing perl and spout cynicism about everything. 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. What is beautiful for a 100loc program becomes ugly and wrong for a 100kloc program. Other aspects become much more important. I'm not a huge fan of go, but it proved there is a necessity…

The notion that languages focused on writing large-scale programs must be "boring" seems a bit silly. What these languages need is lots of ways to define sensible modularity boundaries, and the "boring" aesthetic (or lack thereof, rather) can really get in the way of that.

Boring Is Best! When you have junior programmers joining/leaving teams, consistent, boring code written in one Boring PL according to Boring Code Conventions is like driving on a freeway in one straight direction with auto-pilot on.

Clever code written in half-a-dozen Cool PL's is like driving for your life in sharply turning mountain roads with no guard-rails - something guaranteed to become cataclysmic as your number of issues/escalations rise and rise, your tech debt becomes an un-surmountable mountain and you watch your hair turn grey before you are middle-aged.

Re: Why I Like Java (2014)

#46

Earlier quoted context omitted.

The notion that languages focused on writing large-scale programs must be "boring" seems a bit silly. What these languages need is lots of ways to define sensible modularity boundaries, and the "boring" aesthetic (or lack thereof, rather) can really get in the way of that.

I would submit that any language that reaches the level of adoption that Java does will be considered boring. The human mind has a tendency to prefer new/fresh things, particularly for people high in trait openness (big 5 personality traits).

> I would submit that any language that reaches the level of adoption that Java does will be considered boring.

I know of nobody who would call Javascript or C++ boring ;). Or compare COBOL (boring) with Fortran if you prefer something from the past.

Re: Why I Like Java (2014)

#47
Five years ago I might have said this was a "dis" or "flame" article. Now I too see the benefits of java while simultaneously feeling it's a bloated and verbose language.

We have a tendency to believe that everything we produce needs to be "high quality" 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.

Programming languages are just tools. You will have your favorite to use but that doesn't mean it's the one you should be using on most jobs.

Re: Why I Like Java (2014)

#48

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

Java programs are usually daemons and internally use a logging library, per default stdout is set up as one output for logging. One can usually configure the logging with the log4j or logback config files and even suppress stdout.

Re: Why I Like Java (2014)

#49
These sort of posts crack me up as it's another person jumping on a bandwagon they don't understand, but are also really sad, as it's taking a lot of otherwise talented people and ruining them.

> being relieved of the responsibility for producing a quality product

I've seen this sort of elitism in candidates and I've made the mistake of hiring them. It turns out they're just not very good at all, and they blame their failures on anything but themselves, stunting their self-growth professionally and interpersonally.

Re: Why I Like Java (2014)

#50
post #11

You can write a pretty trivial Java program to copy stdin to stdout but Java is still one of the enterprise languages and people writing enterprise applications don'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…

The domain and the developers that inhabit that domain should be separated from the language. Below is the repo of the companion Java code to Sedgewick's "Algorithms" - make of it what you will.

https://github.com/kevin-wayne/algs4/tree/master/src/main/ja...

Post reply on HN