
John Carmack:“freedom to have your own style” in languages is counterproductive - ksec
https://twitter.com/ID_AA_Carmack/status/1215626495370170368
======
hermanradtke
Personal projects: format however you want!

Otherwise, decide on a style and let the automatic formatter enforce it. The
tools and IDEs are so good you can literally format each time you hit enter.

------
ser0
As evidenced by praise for Gofmt and tools like Prettier.

------
draw_down
He’s right, of course. Though it has been a long time since I saw someone
bother complaining about indentation in Python. It turns out not to really
matter very much.

~~~
ssivark
Maybe it’s just because they’ve given up? I mean, what’s the point.

> _Python brings new meaning to 'off by one errors' by offering 'off by one'
> indentation errors._ (EDIT: quoting a tweet on that thread)

Imagine a long chunk of procedural code. Simple but tedious automated munging.
"If conditional" codepaths depending on whitespace/indentation makes diffs
very hard to read and codepaths harder to keep track of. Similarly no way to
mark off logical blocks other than with comments.

For any code longer than half a screenful, indentation based semantics is very
unpleasant.

I’ll even go a little farther and say that python has a bunch of warts for
anything beyond beginner programming (and of course many nice parts too).

But all of that is somewhat tangential to “freedom to have your own style”. I
like standardization, auto-formatting, etc. I just wish there was better
syntax for encoding structure.

~~~
jkcxn
> If conditional codepaths depending on whitespace/indentation makes diffs
> very hard to read

Wouldn’t this be the case in other languages too? Especially if you’re using
an auto formatter

~~~
ssivark
When you cut/paste/move around chunks of code, the existence of an unbalanced
bracket provides redundancy which is a HUGE blessing in case you mess
something up.

Eg: When removing a bunch of lines from an indented python block (with empty
lines above and below), you might accidentally un-indent later lines and never
realize, or at least forget what was the "correct" indentation! Particularly
cases where editors mess up indentation level when you delete part of a line.

