Hacker News new | ask | show | jobs
by bumblebird 6036 days ago
See I read those two code snippets exactly the same.

The 'verbose' one, I read as ...println("Hello, world!")...

Perhaps I'm not normal, but I 'see' those code snippets to be identical in terms of code.

Lets face it, we're never going to be bound by typing speed, and as I say, there's no chance of getting a bug into that 'verbosity' in java. So the only real issue is down to taste, which is up to the individual.

1 comments

It's more about the reading than the writing. All of the extra words interfere with what's actually going on. Even in this most minimal of cases, there's so many extra things to read that it obscures the meaning.

Also, have you seen those studies that show that everyone has a number n, and every n lines, you make an error? If you're writing 3n lines in Java for every n lines you write in $LANGUAGE, you're making 3 times the errors.

That study, is absolute BS. Complete and utter BS.

Try and make an 'error' in the phrase 'public static void'. See how well it compiles if you mistype 'public' as 'pubic'.

If you're not able to read the code well, then that's one thing (Learn to read code better). But don't spread the misinformation about errors. And no. You're not writing 3 times as much code unless you're an idiot. LOC in Java is pretty much the same as LOC in python for example when written properly.

I can't actually find a link to the study in the 5 minutes before work, so I guess we'll have to throw that out.

It's not that you'd make errors in typing, of course your compiler will check those. It's that code you don't write is bug-free, and every line you do write has a non-zero chance of containing a logic (not syntax) error...

But anyway, it's very easy to write 3x LOC in Java. If you don't write much smaller Python code, you don't know how to code in Python. I can't think of a single task (mind you, I'm a Rubyist, so I very well could be wrong) that would take less in Java, and even ones with identical LOC, you still have things like

    BufferedReader myFile = new BufferedReader(new FileReader(argFilename));
vs

    myFile = open(argFilename)
our example is an api not a language issue though. Theoretically you could create an equivalent api to your open(filename) example. There is no reason you can't and thus the API vs Language point my post was actually about.