6 ms·
Yet this has been settled in Makefiles for a long time: use tabs. OP only seeks to sit on a high horse about how tabs are bad and to divide an ecosystem which
by aslilac 4y ago
Yet this has been settled in Makefiles for a long time: use tabs.
OP only seeks to sit on a high horse about how tabs are bad and to divide an ecosystem which is already pretty consistent. I’m so tired of people insisting tabs are evil and that using them somehow makes you “wrong.”
- bee_rider 4y agoTabs are obviously superior. If the tabs vs spaces argument must be had, and the correct option somehow loses, then we will have a much more annoying followup argument about how many spaces (I vote for three spaces and I will filibuster).
- benreesman 4y agoSince we’re doing this… ;) I’m actually coming around on really narrow conventions since tiny laptops started getting really good. I used to think 80-wide columns and 1-2 space indent was silly retro stuff in an era of modern displays. But on an M2 Air you can just barely get 80 + 80 side by side if you full screen SFMono at like 12-14pt. I’ll never sell my colleagues on it, but I’ve been playing around with setting the formatters to 1-space indent. It’s not as heinous as it sounds. Bring it on! :P
- bee_rider 4y agoThe cool thing about tabs is that you can do that 1-space indent without spreading your madness (but yeah, I think I got a preference for 3 spaces -- actually tabs with tabwidth set to 3 -- while using a little, now old, netbook). One nice advantage of 3 space tabs is that if somebody mixes tabs and spaces in Python, leading to mysterious IDE-dependent bugs, it immediately sticks out (my example is from helping student in an intro to python class, hopefully this doesn't occur much in the real world).
- Izkata 4y agoHoly crap I'm not the only one that likes 3...
- benreesman 4y agoWe've just gone the deterministic code formatter route on everything. Right off the top of my head: - C/C++: `clang-format` is great - Rust: `rustfmt` is very good - Python: `yapf` is very good - Java: `google-java-formatter` is pretty good - Haskell: `fourmolu` is OK, and if you apply it first and then `stylish-haskell` it's good enough - Starlark - `buildifier` is great - Shell: `shfmt` is pretty good - Nix: `nixfmt` is pretty good I haven't done any JS or TypeScript or golang in awhile, but I'm sure there are great options there too. By having all the auto-formatters, we can have one golden config that's fully deterministic for upstream, but everyone can have their own if they want and it just gets blasted into the "golden" format before code review. Finally, a world without brace wars! Everyone tabs and spaces and whatever to their hear's content. Everyone's happy! * you do eat the blame getting fucked up the one time. it's worth it.
- Oreb 4y agoI prefer around 80 characters per line maximum even on very large displays. More columns of text are always better, and I also find shorter lines easier to read.
- int_19h 4y agoYou can't meaningfully filibuster rustfmt / go fmt / Black / ... - that's the best thing about them.
- bee_rider 4y agoI mean, this is mostly joking, of course if I was on a team I'd put forward my argument once and then comply with the conclusion the group makes, it is not really a big deal anyway. Hopefully somebody wouldn't just apply an auto-formatter, that'd be quite rude!