←back to thread

312 points chmaynard | 2 comments | | HN request time: 0.41s | source
Show context
umvi ◴[] No.45058768[source]
I used to love Python, back when it was basically just an alternative to perl for scripting. Now it strikes fear into my heart when I encounter something largish written in Python because it usually means "super slow bloated researchy untyped ai/math code that's a nightmare to work with"
replies(13): >>45059009 #>>45059022 #>>45059024 #>>45059052 #>>45059135 #>>45059210 #>>45059388 #>>45059545 #>>45059897 #>>45060324 #>>45060738 #>>45060792 #>>45060836 #
cherrycherry98 ◴[] No.45059210[source]
Agreed, as an OO scripting language it's lovely, especially compared to Perl where the OO features never meshed quite right. Going back 10 years ago it had a number of things that were novel compared to other languages: literals for common data structures, context managers ("with" statement), first class functions, comprehensions, generators.

On the other hand duck typing is largely a joke. Letting functions take anything as an argument and then just assuming it's a duck with the methods you want is no way to write a robust system. Performance wise you're boxed into a corner. The slow runtime will have you writing native code in another language, complicating your project. The GIL will have you jumping through hoops to work around.

As an offline data exploration and research tool limited to an individual or a small team, or for writing small utilities, I totally get it. For anything mission critical I'd much rather be in something like Java or C# where the typing situation is stronger, the performance is going to be much better, I have better access to threads if I need them, the reasons for dropping into native code are fewer, and the cross platform support works more seamlessly without additional layers like Docker.

replies(2): >>45059998 #>>45060416 #
1. kamaal ◴[] No.45059998[source]
>>Agreed, as an OO scripting language it's lovely, especially compared to Perl where the OO features never meshed quite right.

Back then the whole OO crowd was with Java though.

Python's Moat was beginner friendliness to write simple scripts, which at the time- Perl was more like a thermonuclear scripting language. Most people who never wanted to graduate to that advanced stage of writing mega million lines of Perl code over a week(which was literally the use of Perl then), realised they needed some thing simpler, easier to learn, and maintain for smaller scripts- Kind of moved to Python.

But then of course simplicity only takes you that far, and its logically impossible to have a simple clean interface to problems that require several variables tweaked. Python had to evolve and is now having the same bloat and complications that plague any other language.

Having said that, I would still use Java if I had to start a backend project.

replies(1): >>45060813 #
2. pjmlp ◴[] No.45060813[source]
When Perl ruled the Earth, the OO crowd was with Smalltalk, Object Pascal, Delphi, Clipper 5, FoxPro, Actor, CA Objects, VB, C++.

In fact, many books that the OOP haters attribute to Java, predate its existence.