2 ms·
Oh gods please don't align like this, it's just so unreadable. Example of what that does in practice: Lines that end up wrapping almost at the end of the soft-
by scrollaway 7y ago
Oh gods please don't align like this, it's just so unreadable.
Example of what that does in practice: Lines that end up wrapping almost at the end of the soft-character-limit and look like this:
https://github.com/pennersr/django-allauth/blob/c9b31ddee81d2cde06c1f686c4eb7703f916681f/allauth/account/views.py#L629-L632 https://github.com/pennersr/django-allauth/blob/c9b31ddee81d...
- skohan 7y agoIMO it depends on the language. With named parameters it is very readable, and is my preference when you have functions with lots of parameters.
- dTal 7y agoIt breaks a fundamental assumption, which is that indent depth strictly reflects code nesting depth. If you're going to do that, the "correct" way would be to indent each parameter with tabs to the same depth as the function declaration, and then use spaces to take up the rest of the space (i.e. the width of the function declaration). Which is admittedly ugly - but it's ugly because it reflects the ugliness of misusing indentation for alignment. It's slightly less ugly if you use an editor that displays tabs and spaces differently - Kate/Kdevelop use a nice discreet » character for each level of indentation: def hello_spam(): » while True: » » print ("Hello", » » "World") The last line is visually aligned, but the semantic depth is the same.
- 11235813213455 7y agoI'd go with def hello_spam(): » while True: » » print( » » » "Hello", » » » "World" » » )
- pjc50 7y agoEh? This is fairly normal in most languages. Although in the example given I might have moved the .dispatch to the next line instead.