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

there is a lot more structure in this java snippet though. At equivalent structure, the python code isn't that much shorter.

It's just convenient for a scripting language to be able to print stuff without any code structure. Something that Java enforces.

I've concluded it's because Java isn't designed for scripting that it doesn't allow scripting practices in its code bases. I just started learning Java and I guess if I use a class that could throw an exception I have to catch it (or transfer it to my class' user it seems). In this particular test I knew it wasn't gonna throw but it wouldn't compile: I was opening a file I knew existed for some quick test - instead of 1 python line I got 7 java ones. But with exception / catch structure.

It's an enterprise language, I'm all for the code structure enforcement. Help a dev catch an exception, so many things could already go wrong on larger codebases ;)



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

Search: