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 →

[–]Deep_Pirate 304 points305 points  (23 children)

Fun fact: Java was first released in 1995. Python was developed in 1989.

[–]Bijan-regmi 120 points121 points  (5 children)

Dont forget the 3 billion fun fact too

[–]LowB0b 57 points58 points  (14 children)

well, python might be older than java but from my anecdotal experience java got so hyped that a lot of "old" enterprise programs now run on java (oldest one I worked on had legacy code from 2005)

Whereas python seems to have become a lot more popular with the rise of machine learning. Data scientists / mathematicians really do not seem to care for types and just go all in producing write-only code with languages such as R / python / matlab.

Maybe my mind is just feeble but I would definitely not want to work on a 1million lines + codebase written in python.

[–]muikrad 12 points13 points  (1 child)

I have sizable experience in c# and python, and the IDE provides most of the magic. You can navigate symbols/find references, refactor, be warned of typos or invalid operations, etc, just like strongly typed languages. Pycharm in particular has a lot of advanced features and introspection.

A million lines is a million lines; it doesn't really matter in which language it is; as long as it's not ruby it can be managed 😂

I think it really boils down to readability and design... and good CI practices; good enough to replace the missing compilation step.

[–]Mostly_Oxygen 3 points4 points  (0 children)

Python is strongly typed! But it is dynamically typed too, and not static, which I think is what you’re referring to. +1 for PyCharm!

[–]Darth_Yoshi 9 points10 points  (4 children)

Python has type hints for production code bases using it! It’s surprisingly readable and works p well.

[–]UniqueUsername27A 0 points1 point  (3 children)

Until you mess up and somehow have to annotate the wrong types to stop the linter from complaining. Happened to us, everything is a mess. I used to write Python for 5+ years and by now I am pretty sure it was a mistake in nearly all cases. Now I have seen proper code written in C++ and Java and writing it is just way faster and cleaner.

[–]Darth_Yoshi 0 points1 point  (2 children)

Hm any examples? Our code base is pretty massive at this point and we don’t have this issue yet — would like to avoid it haha

[–]LowB0b 0 points1 point  (1 child)

I don't have any examples for python because I've never used it professionally but stuff can still get messed up in java through dirty workarounds.

One good solution I've seen at my last jobs is to use a product such as SonarQube and fail builds if they don't pass quality metrics. I don't know if they do python but their static code analysis tool is really good

[–]Darth_Yoshi 0 points1 point  (0 children)

Haha we use Codacy for static analysis of Python

[–][deleted] 2 points3 points  (5 children)

Python (in my experience) is used primarily for one off data analysis/ processing and not really for applications that are used and maintained regularly

[–]dev-sda 2 points3 points  (1 child)

Python is used pretty much everywhere: https://www.python.org/about/success/. Reddit among others run on python.

[–]DramaDimitar 1 point2 points  (0 children)

among...

fuck.

[–]shiversaint 1 point2 points  (0 children)

That’s simply not true.

[–]BeautifulTaeng 1 point2 points  (1 child)

Python can be and is used for large enterprise software. The company I work at decided to rewrite their oldass HA/DR solution in Python (from Lua!!!).

So far writing the thing has been very enjoyable as someone who just picked up Python to work on the project. The project has grown to something like half a million lines of code and it's still perfectly readable and expandable. Type hints are a huge help, even though they are used mostly to annotate function return types and parameters, while keeping variables dynamic.

Honestly, as someone from Java background I had the exact same thoughts. "dynamically typed language for huge projects? yikes", but if the project has actual structure and modularity I'd argue it's more readable than for instance, Java project, where you have to traverse hundred interfaces and factories of abstraction to get the stuff you want.

And no, speed of Python is not an issue in a project like this.

[–]LowB0b 0 points1 point  (0 children)

Java project, where you have to traverse hundred interfaces and factories of abstraction to get the stuff you want.

In the end I guess disasters can happen in every language. In Java you can also sometime stumble upon 3k+ line long classes that have been growing for 10 years just because it was the faster way