RE: https://mamot.fr/@Khrys/116226030767910474

As predicted, humans are being turned into accountability sinks for #AI. AI code doesn’t work? You're fired!

"After outages, Amazon to make senior engineers sign off on AI-assisted changes"

@pluralistic

@elasticsoul @pluralistic Bets that the seniors start not signing off on code they aren't positive really works, with vague comments like "Overly complex, please simplify." or "Insufficient error checking. Please improve."?
@tknarr @elasticsoul @pluralistic
Start with where it puts the curly braces, and tab vs. space indents.
@RealGene @elasticsoul @pluralistic Yes on the first. Using tabs for indentation is an automatic "Fire this person." offense for me. Visual space should always match number of characters.
@tknarr I use tabs because I want $number_of_chars = $levels_of_indentation, with easy single-operation increase/decrease of level of indentation.
@developing_agent And when indentation isn't an even multiple of tabs, as when aligning a multi-line expression in an assignment?

@tknarr Because this *isn't* a structural construct (like if/for/etc) I indent up to the level of indentation of that block, then if I *really* need to make things align I fill in the remaining space with spaces. (tabs, if I don't)

This ensures that the block as a whole still indents/unindents correctly with tabs. I am never, ever going to adjust the level of indent of *part* of an expression in this way, so the use of spaces for intra-block expression alignment padding doesn't matter.

@tknarr if this expression by the unholy machinations of mathematics DOES become so gnarly that heavy use of brackets becomes mandatory...

...then I've just invented a new code block surrounded by a different kind of bracket, put the complete expression on a new line inside them, indent with tabs like it's a regular code block, and continue to apply the rules recursively as normal.

@tknarr with \t for tabs and s for spaces:
@developing_agent @tknarr, that works right up until you change the tab width.
@lp0_on_fire @tknarr use #3, or if you're in an IDE that supports changing tab width then you can always set it to 4.

@developing_agent @tknarr, the point here is that tab width should not matter; I find it reasonable to expect alignment to be maintained within multi-line statements.

Your example, formatted with only tabs for indentation and only spaces alignment. Tab widths are, respectively, 4 and 8.

I may choose to set the tab width to 2. Or 5. Or even 1. (I may do so to see if anything's broken by changing that.) But normally I'll leave it at 8.

(Your option no. 3 is definitely the least bad of the options which you present and is, perhaps, useful; I'd probably choose to replace the last tab with spaces as the purpose looks closer to alignment than to indentation. There is, however, consistency to consider regarding others' code.)

@lp0_on_fire Who says tab width shouldn't matter?

@developing_agent, me, for one. I'll normally use a tab width of 8 but sometimes choose to change it to 4 (or, rarely, 2) for reasons of line length and available screen space (which isn't always the full width of the display). I'll also change it if I need to for specific source code (the editor will detect whether to use spaces or tabs and how many, but it won't detect the tab width).

More generally…

Tab width is exactly why you'll find some people insisting on consistent use of either tabs or spaces for indentation and only spaces for alignment.

It's also exactly why others insist on spaces only, or tabs only and a fixed tab width (which becomes important when you have 80-column limits).

There have been many discussions / arguments / holy wars about tabs versus spaces, and I don't doubt that there will be many more.

@lp0_on_fire for me, the tab with is oh-so-loadbearing for alignment. so tab width stays at 4.

If I need wider spaces? I can use two tabs and it's still 4x fewer characters to wrangle. If line width becomes an issue then there's linebreaking or there's probably a design issue.