News for hackers. Stuff that matters.
Re:I Was Interviewed by an AI Bot for a Job by suzzer99 on Wednesday March 11, 2026 @09:15PM (#47345002)
2 spaces ftmfw. I want to see as much on the screen as possible. Horizontal scrolling is bad.

Who still uses 8? Isn't that like a COBOL thing?

Re:I Was Interviewed by an AI Bot for a Job by fwipsy on Wednesday March 11, 2026 @09:54PM (#47345305)
Linux kernel still uses 8 I believe. IIRC wide indentation+narrow pages were chosen partly to encourage using functions and avoiding deep nested logic.

https://www.kernel.org/doc/html/v4.10/process/coding-style.h...

Re:I Was Interviewed by an AI Bot for a Job by fragmede on Wednesday March 11, 2026 @09:57PM (#47345345)
Let's compromise. What do you think of 3?
Re:I Was Interviewed by an AI Bot for a Job by suzzer99 on Thursday March 12, 2026 @12:11AM (#47346351)
Authorities have been notified.
Re:I Was Interviewed by an AI Bot for a Job by dotancohen on Wednesday March 11, 2026 @10:57PM (#47345829)
I just recently read about something that requires - hard requirement - 3 spaces for indentation. Most likely read it here on HN. Makes me sick to even think about.
Re:I Was Interviewed by an AI Bot for a Job by fc417fc802 on Thursday March 12, 2026 @08:31AM (#47349682)
If I ever NIH a YAML-alike I fully intend to require the mixing of tabs and spaces when indenting.
Re:I Was Interviewed by an AI Bot for a Job by mystraline on Wednesday March 11, 2026 @11:03PM (#47345878)
Just add a few zero width spaces. It'll be FINEEEEE :D

https://en.wikipedia.org/wiki/Zero-width_space

Btw, at an old job, some joker developer added or copied 1, and broke the whole testbed. It was quite funny. I came over to the sourcecode hosted in Gitlab, ran my regexes that look for naughty characters. Found it after it ate the devs for half a day.

Re:I Was Interviewed by an AI Bot for a Job by Izkata on Thursday March 12, 2026 @02:46PM (#47355339)
More than a decade ago I suggested this as a compromise as a joke, but then decided to try it out - ended up liking it more than any other options and have used it for all my personal stuff ever since.
Re:I Was Interviewed by an AI Bot for a Job by tharkun__ on Thursday March 12, 2026 @10:30PM (#47360024)
See that would definitely get you not hired ;)

Not because you use 2 spaces. You can argue 2 spaces and the pros and cons and how horizontal scrolling is an issue. One question back would be for example if that means you have huge run-on files where a single function does everything and that's why you need like 17 levels of indentation and that's why only using 2 spaces for each becomes important to you. And then you'd need to argue how that's better for visibility and what might actually be worse about it. If you can do all that, you're hired (if the rest of the interview goes well :P )

    Who still uses 8? Isn't that like a COBOL thing?
That works as a flippant comment when we're joking about code indentation after working together for a while and we get along great. As the one and only answer in an interview, you're out. That's quite disrespectful and no it's not a COBOL thing, I've seen (and used) 8 spaces and argued for tabs or 4 much later than COBOL days. In fact I've never written a single line of COBOL.