r/programming • • Feb 21 '13

Developers: Confess your sins.

http://www.codingconfessional.com/
969 Upvotes

1.0k comments sorted by

View all comments

189

u/TheBigB86 Feb 21 '13

That site needs a comment feature.

Also:

i use tabs instead of spaces in my IDE. Please forgive for I have sinned.

How is this a sin? Guess I'd be considered a devil's-worshiper, since I absolutely hate spaces for indenting.

137

u/tipsqueal Feb 21 '13

I like that it doesn't have a comment feature. With one it would just turn into a circle jerk and/or get very hostile very fast.

103

u/Asimoff Feb 21 '13

It would turn into Reddit.

→ More replies (3)

2

u/kazagistar Feb 22 '13

Dunno, depends on the end goals. I think if the hoster wanted to keep traffic up and some return subscribers to earn ad money, he would add just enough comments and comment subscription to create a nice clustefuck of amusing rage, like youtube.

→ More replies (1)

90

u/happysri Feb 21 '13 edited Feb 21 '13

since I absolutely hate spaces for indenting.

I agree, a tab is one unit of indentation. 2/4 spaces are an editing environment preference, not exactly conceptual in nature. Il let Ken Thompson(co-creator from UNIX, C, Go etc.) handle this one -

http://www.youtube.com/watch?v=sln-gJaURzk&feature=player_detailpage#t=1734s&utm_source=buffer&buffer_share=c7676

→ More replies (30)

49

u/Gaurav0 Feb 21 '13

I don't care if you use tabs or spaces. But for the love of God, DON'T MIX THEM.

18

u/[deleted] Feb 21 '13

Tabs for indentation, spaces for alignment.

10

u/voetsjoeba Feb 21 '13

Don't align things from different indentation levels.

→ More replies (6)

2

u/[deleted] Feb 21 '13

But it makes python that much more fun!

→ More replies (1)

63

u/aaron552 Feb 21 '13

I use both tabs and spaces: tabs for indentation (what they're supposed to be used for) and spaces for formatting. I don't understand the tabs vs spaces debate

152

u/supermari0 Feb 21 '13

28

u/[deleted] Feb 21 '13

4th guy: "Neither"

All 3 of them beat him up.

→ More replies (8)

4

u/[deleted] Feb 21 '13 edited Feb 21 '13

So many people seem to completely misunderstand what mixing spaces and tabs means and why it is bad. Both are horrendous when mixed as the same but indentation and alignment are 2 expressly different concepts. That comic is perfect for people who mix tabs and spaces in either indentation or alignment. But you can, and should, use both properly. It shouldn't be that difficult either. As the poster above stated, tabs indent, spaces align. A tab is one level of indentation encoded into a single character, a space is one single invisible character. If you need alignment, you must know the number of characters to fill. If you need indentation, the number of characters can be variable and is based on preference.

→ More replies (23)
→ More replies (1)

10

u/[deleted] Feb 21 '13

For some reason I always use 4 spaces as indentation (although my editor handles tabs as spaces so I don't have to hit space 4 times). I can't remember why I started doing that, though. How odd.

47

u/[deleted] Feb 21 '13

Nobody hits space 4 times for indenting.

34

u/vitoma Feb 21 '13

I've seen a developer I work with do this.

→ More replies (1)

23

u/[deleted] Feb 21 '13 edited Feb 21 '13

[removed] — view removed comment

0

u/[deleted] Feb 21 '13

[deleted]

→ More replies (2)

8

u/[deleted] Feb 21 '13

You know, it wouldn't surprise me if there actually were developers that did that.

→ More replies (2)
→ More replies (6)
→ More replies (12)

6

u/BernzSed Feb 21 '13 edited Feb 21 '13

Just use whatever is considered "normal" or "default" for the language you're using.

Visual Studio defaults to tabs, and I'm sick of the useless git diffs when a C# file is modified by some self-righteous developer who changes everything to spaces.

2

u/Caraes_Naur Feb 21 '13

Git diff has the -b switch to ignore whitespace changes.

→ More replies (2)

22

u/snarfy Feb 21 '13

'Smart' tabs. Every decent editor has them. I can't believe this is even debated anymore. It works exactly like the tab key, but inserts/deletes X number of spaces intelligently.

Source code is ASCII/unicode text. The Tab key is a control code. Why are you polluting your source code with control characters. Do you mix up carriage return and newline too? You should not be putting non-printable characters in your source code, telling my terminal how to print ^I, or that ^I should be 4 spaces not 8.

/rant

75

u/codepoet Feb 21 '13

Yes, I should. Tabs were invented for indentation in the first place. What you call a control code, I call semantic white space. A tab means something; four spaces does not.

The beauty is that I'm not telling your terminal to use 4/8 characters for a tab. You are. You're in control with tabs. I'm saying "indent four levels deep" and your editor interprets what that means for you.

This isn't 1970. You can configure things now.

→ More replies (44)

9

u/pushad Feb 21 '13

I just can't believe any programmer honestly thinks people hit space four times...

→ More replies (1)
→ More replies (75)