4 ms·
I'll accept 2, 4, 8 spaces or tabs, but it should be consistent.
by carlmr 4y ago
I'll accept 2, 4, 8 spaces or tabs, but it should be consistent.
- xcambar 4y agoHere's my rule of thumb: * for new projects, use a well-established, reputable standard * for existing projects, use what is already in place if it is consistent * in case of inconsistency, fix to the closest industry standard
- bschwindHN 4y agoMy favorite: * Use an auto-formatter and enforce it in CI
- IshKebab 4y agoYeah this is what I was trying to enact. They had sort of done that but the autoformatter had been broken for years and they wouldn't let me fix it and reformat everything.
- WorldMaker 4y agoGit supports revision ignore files for tools like git praise/blame, so that excuse that they don't want to reformat everything to avoid git praise blowout can be easily worked around by checking in an ignore revisions file and pointing them how to use it. Github even has public beta support for it, though they require a specific name for the ignore revs file: https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view https://docs.github.com/en/repositories/working-with-files/u...
- abdouls 4y agoDefinitely, as long as it's consistent - I personally like to go for 4 spaces everywhere, I would say it makes the code look easy and readable.
- carlmr 4y agoMe, too, it's the default for almost every editor and code formatter. That makes it the most likely choice for projects. But if this project made a weird decision I'm ok with it, as long as it's enforced consistently.