IMO the biggest downside is that it gets awkward to do closures and inline expressions and things like that. For example Python's `lambda` and if-else expression which are super weird and special snowflakey compared to the equivalents in e.g. Rust or OCaml or even Tcl.
Maybe there's a way to do it nicely; I haven't thought about it too much.
Well yes. Say you check out a project that's all tabs but your editor is using spaces for indentation. You change a line and now the program is broken. Calling the auto-formatter won't help you.
This is literally not a problem. All Python projects use 4-space indentation. You would not have your editor configured for tabs when editing a Python program.
It's really not an issue at all in practice. The issue of making moving code more awkward is true but really barely an inconvenience. It's not difficult to select it and press tab a couple of times.
As I said the biggest issue is with closures and expressions that you might want on one line.
Comments
That's why you use an autoformatter.
IMO the biggest downside is that it gets awkward to do closures and inline expressions and things like that. For example Python's `lambda` and if-else expression which are super weird and special snowflakey compared to the equivalents in e.g. Rust or OCaml or even Tcl.
Maybe there's a way to do it nicely; I haven't thought about it too much.
You can't autoformat broken indentation with significant whitespace since it would make the program not parse (or parse incorrectly)
I was responding to
Well yes. Say you check out a project that's all tabs but your editor is using spaces for indentation. You change a line and now the program is broken. Calling the auto-formatter won't help you.
This is literally not a problem. All Python projects use 4-space indentation. You would not have your editor configured for tabs when editing a Python program.
It's really not an issue at all in practice. The issue of making moving code more awkward is true but really barely an inconvenience. It's not difficult to select it and press tab a couple of times.
As I said the biggest issue is with closures and expressions that you might want on one line.
Tell that to the one team at my old workplace that used spaces for all their scripts.
Like I said it’s a stupid source of errors that can be mitigated through style guides and tooling but it’s still a source of errors.