5 ms·
Not to brag but https://github.com/dhewm/dhewm3/blob/master/neo/idlib/Heap.cpp#L154 https://github.com/dhewm/dhewm3/blob/master/neo/idlib/Heap.c... (from line 1
by dvh 12y ago
Not to brag but https://github.com/dhewm/dhewm3/blob/master/neo/idlib/Heap.cpp#L154 https://github.com/dhewm/dhewm3/blob/master/neo/idlib/Heap.c... (from line 154 down) that seems like another point against using tabs.
- nezza-_- 12y agoI always heard "Tabs for indenting, spaces for aligning."
- emsy 12y agoMix tabs and spaces in code and you're in for a fun time :D
- jpgvm 12y agoThese days just use expand tab, in an age of online code review tools etc it's just better not to have to configure every system to interpret tabs to your given number of spaces - just write the damn spaces into the file.
- deleted 12y ago[deleted]
- Crito 12y ago> "it's just better not to have to configure every system to interpret tabs to your given number of spaces" The entire point of "tabs to indent; spaces to align" is that you don't need to make sure everyone displays tabs the same way. If we are using that scheme and I have mine set to 4 spaces but you have yours set to 8, everything is fine. There is no problem there.
- jordigh 12y agoYeah, but since every time someone new comes along who doesn't understand what this means (witness the replies you're getting)... no tabs. It's just easier this way.
- TorKlingberg 12y agoThat works but takes a lot of discipline. More than any team I ever worked with had.
- Crito 12y agoIn my experience, the difficult part is getting people to understand it.
- benihana 12y agoI think it's actually a point against lining up variable assignations like that more than a point for spaces (I prefer spaces over tabs btw).
- rileyteige 12y agoYou think that's bad: https://github.com/dhewm/dhewm3/blob/master/neo/game/ai/AI.h#L182 https://github.com/dhewm/dhewm3/blob/master/neo/game/ai/AI.h... Scroll down and watch the readability disappear.
- benhoyt 12y agoDoes this fix it? https://github.com/dhewm/dhewm3/blob/master/neo/game/ai/AI.h?ts=4#L182 https://github.com/dhewm/dhewm3/blob/master/neo/game/ai/AI.h...
- laumars 12y agoappend ?ts=4 to the URL to change GitHubs default 8 character tab to 4 characters wide.
- Bahamut 12y agoIs that really a GitHub thing? When I view diffs in the command line with Git, it always shows tabs as 8 spaces too.
- laumars 12y ago8 spaces tends to be the de facto standard tab width. But because tab is it's own ASCII character (0x09), much like how space (0x20) and the lower case letter 'a' (0x61) are, it means it's up to whatever text processors used (eg diff, vim, GitHub web application, etc) to interpret a tab character by whatever width they choose. Which is why tab spaces are a per-application setting, eg: diff --tabsize=4 ... vim "+set tabstop=4" ... http://github.com/.../file?ts=4
- aninteger 12y agoYour comment has nothing to do with the article.. or even keeping things simple.
- toxicFork 12y agoAdding ts=4 fixes it: https://github.com/dhewm/dhewm3/blob/master/neo/idlib/Heap.cpp?ts=4#L154 https://github.com/dhewm/dhewm3/blob/master/neo/idlib/Heap.c... (Inspired by https://news.ycombinator.com/item?id=9303351 https://news.ycombinator.com/item?id=9303351 )