2 ms·
The reason it's not well suited for larger/etc projects has nothing to do with OOP - it's about things like dynamic typing and indent-based structure that make
by HarHarVeryFunny 3y ago
The reason it's not well suited for larger/etc projects has nothing to do with OOP - it's about things like dynamic typing and indent-based structure that make it good for interactive REPL use, scripting and rapid prototyping, but less suited for more complex cases where you'd prefer more compile-time vs run-time checking, and where ease of lifetime maintenance trumps up-front coding time.
I disagree that the availability of good libraries for Python is because of the language - especially if we're talking about scientific and ML libraries. In many of these cases the Python libraries are just pass-thrus to the underlying libraries written in C, which was chosen because of it's performance and suitability to the task.
- manuel_w 3y ago> indent-based structure [...] less suited for more complex cases How so?
- HarHarVeryFunny 3y agoBecause in the real world there are crappy programmers writing 1000 line functions and code nested 10 levels deep. Having explicitly delimited code blocks makes code, especially bad code, easier to read. I'd rather see 3 or 4 "}", maybe with comments, rather than just seeing a large reduction in indent and having to scroll up 3 pages to figure out the code structure. I guess if you're doing team-based Python development then everyone is going to be forced to be sensitive to indent, and maybe use a Python-aware editor, but often in a large non-Python project there are many different editors and indent configurations being used and the code structure is unreadable - but at least you can use a language aware formatter or indent tool to recover it. In Python any sort of loss of proper indenting would obviously change the functionality of the code. Maybe this never happens ?