@enkiv2 I've always been a spaces partisan, but this is convincing to me.
I've always preferred tabs, especially after learning how they can be used in such a way as to /not/ lead to ragged source listings while still letting others pick their preferred tabstop. (Hint: it's codified in how gofmt formats code.)
AFAICT, there's no reason not to use this approach except pure laziness, ableism, or naked chauvenism (c.f. "special snowflake tabstop" comment in the thread).
@vertigo @enkiv2 Unfortunately, Python, which I work in a lot, makes this very difficult. The official style guide (PEP 8) requires spaces-only for indentation, and the standard code formatting tools (such as black) enforce this. Mixing spaces and tabs can also be illegal in Python; it is okay as long as you have only tabs at the beginning of the line and spaces at the end and never go back and forth, but this introduces another place where things can go wrong.
@vertigo @enkiv2 I would try this with other languages I use, but with C# at work, indentation is basically controlled by the IDE, and is probably not configurable. And the other main language I use is Lisp, where the convention is also strongly to use spaces, so I would be going against the usage of most people who would be looking at my code.
@er1n @lm @enkiv2 @gcupc The Go-style of indentation resolves this, so obviates the need for local reformatting post check-out; the viewer selects their own tab width without modifying the source code. Basically, everything to the left of the first column of source code is tab-indented. Everything after that is space-indented for alignment. The only requirement is a fixed-width font (it won't work with proportional width fonts, regrettably).
@clacke @gcupc @enkiv2 I think I fall into this category as well. I consider myself in my "pure laziness" category because I've grown tired of competing with corporate coding standards. And now that entire **language communitiess** have recommended coding conventions, almost all of which I find direly suboptimal in important ways, I've all but given up the good fight. *sighs* :(
GeoWrite format (for Commodore 64/128 platforms) comes the closest I've seen to this ideal. But, because it's not Unix, it'll never fly.
@clacke @gcupc @enkiv2 I can see the argument, but I'm not convinced that this matters much in practice; if you're nesting more than 4 deep, that's a code smell worthy of an intervention. Most code is indented 1 to 2 levels. Anything more than that is almost a dead giveaway that it's time to simplify/refactor the code. (Yes, I'm guilty of this as well; but regular code reviews can help here.)
@grainloom @clacke @gcupc @enkiv2 I have exactly this problem with writing a scheduler intended to reconfigure a customer's solar inverter at various points throughout the year. 6-deep trees of configurations aren't uncommon.
The way I resolve this in practice is to assign one or two levels of nesting to variables, and then reference those variables in higher-level constructs.
I find it is substantially easier to work with in source code this way.
Over the years and through routine exposure to Ruby and Python code bases, I've grown to be "pure lazy" in my categories above, so I'm no moral authority here. But, there was a time when I wrote code like that pretty religiously, and it wasn't onerous at all.
> 'consistency across environments' is exactly the problem for these guys, they have different needs
I really wish more devs and web designers understood this and stopped trying to force people to view their GUIs / websites the same way
@grainloom @enkiv2 I frequently encounter websites which simultaneously strive to be mobile-only (as a means of cheaply achieving goals of mobile-first design compliance) and a replacement for glossy print media. Even without needing to navigate these sites to a deep level, I find these are routinely the most infuriating websites to use. :(
Glitz-Driven Development. #NotEvenOnce.
Une instance se voulant accueillante pour les personnes queers, féministes et anarchistes ainsi que pour leurs sympathisant·e·s. Nous sommes principalement francophones, mais vous êtes les bienvenu·e·s quelle que soit votre langue.
A welcoming instance for queer, feminist and anarchist people as well as their sympathizers. We are mainly French-speaking people, but you are welcome whatever your language might be.