7 ms·
I think there's probably some truth to considering existing norms and thinking ahead, but find it unlikely to be the main confounder. How do tabs fail to work i
by sambe 9y ago
I think there's probably some truth to considering existing norms and thinking ahead, but find it unlikely to be the main confounder. How do tabs fail to work in other editors/IDEs?
- peterbonney 9y agoTabs fail when my IDE is set to convert tabs to spaces and yours isn't.
- seren 9y agoAdditionnaly diff/merge tool tend to be inconsistent. So it looks good on your editor, but when I am doing your code review, alignement is totally broken. In theory, it should be easy enough to ask people to have consistent settings across all tools, but it is a bit like herding cats. Sadly most people do not even realize it could look differently without their settings. (I could ignore whitespaces when doing reviews but this is an open invitation to break everything)
- creepydata 9y agoSeriously? When you start on a project you configure your IDE to match the project's conventions. If you are in a mentoring role you instruct your jr developers to do the same, first thing, before writing any code. This has never been an issue at any place I ever worked. If a PM can't get their developers to do something as simple as that then you have larger organization problems than code formatted weirdly. As well as totally incompetent developers.
- drblast 9y agoOn a very large codebase, developed over decades, not months or years, by thousands of individual teams, using multiple versions of multiple IDE's, some of which didn't exist when the project started, across different languages, also some of which didn't exist when the project started, this is not so simple. Unless the project's settings are to use spaces.
- creepydata 9y agoI've worked on projects that have been developed over decades and there has never been an issue. We have conventions, developers are expected to follow conventions, and if they don't they are instructed go back and fix their code.
- LanceH 9y agoSpaces when tabs are used. Your point?
- Shorel 9y agoIn that case your IDE fails. Respect .editorconfig files
- nottorp 9y agoThey might be configured differently, and you usually can't align stuff properly using just tabs, you have to use a space or three somewhere. Also, you never know if it's spaces, tabs or a combination of them in existing code - which you may have not written yourself. So in the long run, the indentation WILL get fucked up and you WILL miss something when fixing a bug in code that you or someone else wrote 6 months ago. And your 10 minute bug fix will take 3 hours. Multiply both values by a constant factor as necessary. It's simply not worth the trouble.
- SippinLean 9y ago>you usually can't align stuff properly using just tabs Huh? Things indented to 1 tab will align with everything else on 1 tab. Things aligned to 2 will align with everything else at 2 tabs. >you have to use a space or three somewhere Why? Tabs will indent with other tabs. >you never know if it's spaces, tabs or a combination of them in existing code Well they should never be combined for indentation. Unless you mean using tabs for indentation and spaces for alignment, but this wouldn't create any issues. Using tabs for spacing is objectively poor form. I open space- and tab-indented files in my IDE, they are all converted to tabs. It is always consistent.
- pvinis 9y agoOh god. I also prefer tabs, but if a file has a choice of tabs or spaces, never change the whole thing to what you prefer. Always keep it as is.
- SippinLean 9y agoGood point, in my case that's just how I work on it, git magic converts it to whatever matches the repo style before it's committed.
- creepydata 9y ago>you never know if it's spaces, tabs or a combination of them in existing code - which you may have not written yourself. Um... I always know because I always set my IDEs to show those characters. You don't?