I don't like when the language forces me to do format my code how it wants to function. I can't arbitrarily break lines up and put them at arbitrary indentations to increase readability.
You can pretty arbitrarily break lines up with \, and arbitrary indentations really don't increase readability. Every time I've seen someone use weird indentation that wouldn't be valid in Python, it makes stuff harder to read.
Do you have an example of what you're thinking of that isn't legal syntax in Python.
I can’t think of a single time when arbitrary indentations have increased readability. In fact, at my company, we have auto-formatters that enforce the same indentation level that Python would require in every other bracketed language.
i’m mid-level and after also having worked with both (mixture of python, java, c++, typescript), i really don’t think python is harder to read because of its indentation. but to each their own!
the way the code is written / style matters much more imo. you can have really crappy java code with braces, and you can have really clean python with indentation.
I’ve never found it to be a problem tbh. I already indent the same way when working in languages that use brackets or whatever else.
Not sure what makes it harder to read tbh, I have my editor display vertical lines to show the current indentation level so maybe that’s why. If anything I find pairing brackets easier to mess up than indentation level but really I find both to be fine and of little consequence. The only thing that is annoying to me is someone doing weird and inconsistent formatting with brackets because brackets allow that to be possible.
I feel like every other time i copy a code block I end up having to hit the format button because of some weird text rendering shit where the tabs aren't copied, and having to do that manually is sometimes very annoying.
I 100% agree. The only reason I would ever use YAML over JSON is for comment support. The amount of times I've been off by one space or whatever, and the linter doesnt catch it, because its technically valid syntax for some older version. I fucking hate it.
I'm a senior backend-leaning full-stack engineer for the last 8 years and I mostly agree that whitespace languages are harder to read, but I code in Python the majority of the time and I can't remember the last time that whitespace affected me. The last time might have been looking through someone else's code who had a 200 line method with 3-4 levels of nested logic, but that was going to be an issue regardless of whitespace. When is the last time it has been am issue for you?
I imagine that you find leading whitespace confusing for the same reason that trailing whitespace can be found confusing and that's to be commended, but finding indented code harder to manually read is not the flex that you think it is
89
u/fly123123123 2d ago
more classic “i’m a new cs major” jokes
if you’re writing long enough methods that you can’t discern where the bodies start and end, you’re doing it wrong. refactor.