Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The concept of choosing to be relieved of the responsibility from doing "the right thing" is not really new:

http://www.jwz.org/doc/worse-is-better.html



I don't feel that users of Java are "relieved of the responsibility from doing 'the right thing'" for the following reasons:

1) Java has the paradox of choice problem. Unlike say Python, there are so many ways of structuring code based on the extreme flexibility of available frameworks and so many different libraries that it gets complicated fast due to sheer number of choices, unless you're really experienced and you already know what you want ahead of time.

2) Java's verbosity necessitates heavy abstraction through many patterns. Which patterns will you choose for your given problems? It's still somewhat easy to write spaghetti unless you have both the experience and discipline to prevent it.

Python isn't perfect, but its one way to do something philosophy leads to "relieved of the responsibility from doing 'the right thing'" unlike Java. People who use Ruby kind of experience this as well if they use Rails.


When writing Python you're constantly making a lot of choices that you simply don't get in Java. e.g. "do I use a tuple/dictionary for this thing or make a class" - in Java there are no tuples and no dictionary literals, so you always make a class. "Do I group this bunch of functions into a class or leave them freestanding?" - in Java you don't have freestanding functions, so you always put them in a class. "Loop, map, or list comprehension?" - Java only has one option (at least until recently). "Several functions or one function with a lot of keyword arguments?" Even the tools seem a lot more wide open - with Java these days maven is pretty much standard, your only real choice is eclipse vs intellij. In Python I still couldn't tell you what's the right tool to package with (though pip/virtualenv is more-or-less becoming the standard for dependencies), and there seem to be dozens of IDE/editor options.


"When writing Python you're constantly making a lot of choices that you simply don't get in Java. e.g. "do I use a tuple/dictionary for this thing or make a class""

In Java you're going make similar choices. which collection implementation am I going to use? Which hash implementation am I going to use? and so on, but that's not really the big problem.

Java's strong type system also comes into play. Yes it's easier to read, debug, and performance get's a boost, but you have a think more about designing it (abstract classes, interfaces) and refactoring is harder. Yes things like generics have made this a little easier.

The best comparison you can make about the languages comes down to IDEs. You don't really need an IDE for Python, while an IDE is pretty much a must for Java.

The hardest part about java isn't the language itself; it's the philosophy. In my 10 years of experience with java outside of academia in places like telecoms, banks or eccomerce sites, you're likely going to be using some dependency injection framework for Java. Do you use Spring or Guice? ( Most likely) If you use spring, do you use annotations or XML schema? If you use annotations how do you structure it? What's the scope of the bean classes? The list goes on and on.

Java's (meaning the ecosystem as a whole) biggest strength and weakness is its extreme flexibility and choice that it gives its users.

Conversely Python (meaning its ecosystem as a whole) doesn't give you much of a choice so there's less decisions that have to be made.


> In Java you're going make similar choices. which collection implementation am I going to use? Which hash implementation am I going to use? and so on

I've never seen a case where that choice was important; you can just use ArrayList and LinkedHashSet everywhere. Whereas the python examples are actual tradeoffs, and your code will be worse if you pick them wrong.

> you have a think more about designing it (abstract classes, interfaces) and refactoring is harder.

Disagree. Refactoring is easier in Java because your IDE can tell you what's broken (and even make a lot of changes for you); in Python you have to hope your test coverage is good enough.

> you're likely going to be using some dependency injection framework for Java. Do you use Spring or Guice? ( Most likely)

Choice of libraries is important in any language, and IME it's much more possible to get it wrong in Python. I have a perfectly good website backend from a few years ago, only it's built on TurboGears which is now defunct. PIL was about as big and popular a Python library as they come, but I understand it's now unmaintained. There are about 5 different XML parsers, in Python as it is in Java.

> If you use spring, do you use annotations or XML schema? If you use annotations how do you structure it? What's the scope of the bean classes? The list goes on and on.

Those are choices you make, but you make them once at the start of the project, and again it doesn't matter so much if you get them wrong because you can trust that all the options will be maintained for a while. In Python with no explicit IoC container you still have to solve the same problems, so you end up making the same kind of decision again and again.


> I've never seen a case where that choice was important; you can just use ArrayList and LinkedHashSet everywhere

You shouldn't. Sometimes you should be using CopyOnArrayList. that's one example.

> Refactoring is easier in Java because your IDE can tell you what's broken

It's harder because there's more code to sift through and it's easier to have bad design.

> Choice of libraries is important in any languag

It's not really the choices of libraries that's the big killer in Java. It's the freedom of usage of those libraries. Spring is a good example of this.

> Those are choices you make, but you make them once at the start of the project

This is easy to say for veterans. Not so much for newbies.


Read that article, as it's not talking about the same thing. A lot of thought and design went into both C and Unix. "The right thing" is relative to the tradeoffs you find acceptable or not.

TFA is talking about simply not caring. Which I find an awful opinion. There's a really big difference between a well designed, well built Java product/library and a badly designed, poorly built one. The Java ecosystem being so massive, you can notice examples of both everywhere and the difference is night and day.

Java does in no way relive you from the responsability of producing quality. At times it makes it harder, as you need a lot of knowledge and extremely good taste to do the right thing, instead of sucumbing to "best practices" that are perpetuated as myths or instead of adopting poor libraries, just because they are popular.

Example: java.util.Date / java.util.Calendar versus Joda Time.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: