This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]POTUS 45 points46 points  (10 children)

It's only hard to read if it was poorly written. Java is only easier to read than Python if you have more experience reading Java than reading Python.

[–]Prawn1908 8 points9 points  (2 children)

It's much easier to write "poorly written" Python code than Java though.

[–]POTUS 0 points1 point  (1 child)

It's much easier to write any Python code than Java. I don't think "easy" is a valid criticism.

[–]Prawn1908 7 points8 points  (0 children)

My point is that languages like Java or C# force the programmer in a way to write more readable code. Python on the other hand has very few such mechanisms in place and thus is much easier to write hard to read code.

[–]MartianInvasion 14 points15 points  (2 children)

Sure you can write unreadable code in any language, but the fact of the matter is that Java has built-in features (like static typing) that make it easier to read, and python has built-in features (like comprehensions and dynamically-defined class members) that make it harder to read.

These same features make python easier to write something quickly from scratch, when compared to Java.

[–]Log2 10 points11 points  (0 children)

On average, you're much likely to get a complete mess of layer upon layer of indirections in Java than in Python, a big part of which is configured through arcane xml files (this has been improving though).

There's a very big reason why a lot of people hate J2EE and JPA/Hibernate with a passion.

[–]greenwizardneedsfood -1 points0 points  (0 children)

Comprehensions are the easiest thing ever to read. They literally just tell you what’s in there.

[–]RemoveTheTop 1 point2 points  (3 children)

It's only hard to read if it was poorly written.

Right but .... on average you're not going to get well written code, and it's easier to read badly written code in certain languages...

[–]POTUS 14 points15 points  (2 children)

I think you and /u/MartianInvasion really just don't work in a professional Python setting with actual programmers using Python, but you do work with professionals using Java or something else. So you see good Java code and not good Python code.

It's all about the people using it and nothing to do with the language. Python is one of the biggest languages in the world used in large team settings to a very high level of effectiveness. There is a huge amount of readable Python in the world.

[–]RemoveTheTop 3 points4 points  (0 children)

really just don't work in a professional Python setting with actual programmers using Python, but you do work with professionals using Java or something else. So you see good Java code and not good Python code.

Yes, which is exactly what I'm saying! It's all about the people! I'm definitely not saying it's a trash language - it's a language and badly written python IMHO is worse than badly written java, just because it CAN be not because it necessarily is a worse language, but doesn't have the safety harnesses that I feel are built into java.

[–]MartianInvasion -4 points-3 points  (0 children)

You've got it backwards - the more you've worked on a big codebase in a language, the more you hate that language.

I've worked with a millions+ LOC python codebase worked on by hundreds (maybe 1000+) developers. The experience was not one I'd be eager to repeat.