News for hackers. Stuff that matters.
Re:Why We Switched from Python to Go (2021) by RcouF1uZ4gsC on Thursday May 26, 2022 @11:02AM (#31519196)
> 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.

Re:Why We Switched from Python to Go (2021) by wing-_-nuts on Thursday May 26, 2022 @11:15AM (#31519357)
No. 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.

Re:Why We Switched from Python to Go (2021) by Sohcahtoa82 on Thursday May 26, 2022 @01:22PM (#31521000)
Whenever 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.

Re:Why We Switched from Python to Go (2021) by philwelch on Thursday May 26, 2022 @02:12PM (#31521622)
> 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 ;)

Re:Why We Switched from Python to Go (2021) by Sohcahtoa82 on Friday May 27, 2022 @11:30AM (#31530755)
Selecting 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.

Re:Why We Switched from Python to Go (2021) by philwelch on Friday May 27, 2022 @01:49PM (#31532529)
I've literally never coded in Windows. Seems like a weird choice.
Re:Why We Switched from Python to Go (2021) by Sohcahtoa82 on Friday May 27, 2022 @02:42PM (#31533254)
I'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.

Re:Why We Switched from Python to Go (2021) by philwelch on Friday May 27, 2022 @04:11PM (#31534323)
I'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....
Re:Why We Switched from Python to Go (2021) by digisign on Thursday May 26, 2022 @12:38PM (#31520443)
Indentation 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.