4 ms·
> Python has problems scaling to medium-size code bases because programs above a certain size tend to become difficult to reason about. The other issue with Py
by RcouF1uZ4gsC 4y ago
> Python has problems scaling to medium-size code bases because programs above a certain size tend to become difficult to reason about.
The other issue with Python is that it uses indentation for scoping. Combine that with the fact that it is super easy to mess up indentation when you are moving code around via copy/paste and it is super easy to change the meaning (ie accidentally move a statement out of an if block).
Using indentation for scoping is great for small projects and for beginners. However, once you get to medium or large projects, having the extra redundancy of curly braces is reassuring.
- wing-_-nuts 4y agoNo. The lack of curly braces doesn't have a big impact on python being hard to reason about as the code base grows, it's the lack of tooling that comes with a strong statically typed language. It makes refactoring hard across a large code base. Python is a great scripting language, and it's a great language for hackers that work on their own personal projects. It's not a great language for enterprise microservices on teams of like 20 people. The growing pains are real.
- digisign 4y agoIndentation has never been a problem with any of the code bases I've ever used. Ok, maybe there was that one script with tabs in it from ~2003? Not using a programming editor? I select the text and hit Tab or Shift+Tab, not exactly rocket surgery. The lack of redundant noise characters pays off every single day, where as odd indentation problems are a once-a-decade issue.
- Sohcahtoa82 4y agoWhenever someone complains about Python's indentation-as-syntax, my mind translates it as "this programmer writes terribly formatted code". If your code is properly formatted, then indentation will never be a problem. Copy/pasting large blocks, yeah, you can mess it up. But any editor worth using will let you select several lines of text and hit Tab or Shift-Tab to add/remove an indentation level, so fixing it only takes a couple seconds.
- philwelch 4y ago> But any editor worth using will let you select several lines of text and hit Tab or Shift-Tab to add/remove an indentation level ...or has equivalent functionality that doesn't require the mouse ;)
- Sohcahtoa82 4y agoSelecting multiple lines of text in an IDE does not require a mouse. Just hold Shift and use the up/down arrows. The ability to select text in this way has existed in Windows for at least 20 years.
- philwelch 4y agoI've literally never coded in Windows. Seems like a weird choice.
- Sohcahtoa82 4y agoI'm a gamer, so Windows is my daily driver. I'm not going to install a Linux VM just to run PyCharm and VSCode. Professionally, I'm at the whim of whatever environment my employer uses. I've used Linux (CentOS), Windows, and Macs. If I'm doing Python development, then it's pretty OS agnostic unless I'm using a Python module that compiles to a native binary, in which case Windows is certainly a nightmare.
- philwelch 4y agoI'm just saying there are editors worth using beyond PyCharm and VSCode, some of which don't use the tab key to indent selected text. Kids these days don't respect the old ways grumble grumble....