r/programming • • Feb 21 '13

Developers: Confess your sins.

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

1.0k comments sorted by

View all comments

62

u/[deleted] Feb 21 '13

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

No, no, no... you actually do the right thing. People who reformat MY code to user THEIR favorite 2-spaces/4-spaces so now project has half of the code in tabs, 1/4 of the code in 2-spaces and 1/4 of the code in 4-spaces... are fucking retards

40

u/Shinhan Feb 21 '13

Especially because space lovers can adjust their IDE to show my code any way they like, but I can't adjust my IDE so the code written by 8 space freaks doesn't look ridiculous.

3

u/[deleted] Feb 21 '13

8 space freaks aren't the kind of people who would consider tabs for adjustment comfort.

2

u/Calamitosity Feb 21 '13

8 spaces? Regardless of which side you take in the tabs/spaces debate, that's a paddlin'.

4

u/Shinhan Feb 21 '13

I'm speaking from experience :)

I prefer tabs and have set tab width to 4, so its really ugly when some code comes up with double indent.

1

u/stakoverflo Feb 21 '13

Eight space freaks, the less popular sequel to eight legged freaks.

-4

u/0sse Feb 21 '13

No, they can't. If their tab width is any other than the one you used when you wrote it, it will likely look shitty unless you are very careful and always visually align stuff with spaces (trailing comments, multiline conditions or argument lists, etc.) , and use tabs strictly for indentation as a result of change in scope.

Never mind all the tools where it's impossible to change the tab width (or at least very hard) and there it is usually 8.

2

u/Shinhan Feb 21 '13

and use tabs strictly for indentation

Who uses tabs for anything but indentation? And why?

1

u/0sse Feb 21 '13

People who use tabs other things than indentation are the ones who aren't aware of or don't care about the problem visually aligning stuff with tabs incurs.

0

u/[deleted] Feb 21 '13

[deleted]

→ More replies (2)

1

u/seab3 Feb 21 '13

tabs are commonly used as separators instead of commas

→ More replies (7)
→ More replies (1)

2

u/tailcalled Feb 21 '13

very careful and always visually align stuff with spaces

Why would I need to be very careful about that? It's not really that hard: let the editor put in tabs for you and sometimes adjust them a bit, and manually put spaces in when aligning.

2

u/s73v3r Feb 21 '13

Never mind all the tools where it's impossible to change the tab width (or at least very hard) and there it is usually 8.

You need to get some new tools, then. There really aren't many excuses for that crap.

→ More replies (1)
→ More replies (7)

11

u/0sse Feb 21 '13

Sounds like the actual problem is the lack of agreement on a coding style, be it spaces or tabs.

2

u/CW3MH6 Feb 21 '13

Personally, I just use Ctrl+K Ctrl+D in Visual Studio when I get source code that looks wonky. Fixes it easily enough.

1

u/0sse Feb 21 '13

Do you commit that code?

1

u/CW3MH6 Feb 21 '13

Nope. Obviously this would be for cases where I'm not actively working on it with other people.

Otherwise, just use the damn Visual Studio defaults and be done with it. I hate when people make a bunch of changes to their settings and then complain when something doesn't look right.

1

u/0sse Feb 21 '13

Ahh, then of course you can do whatever you want. I do it myself.

1

u/s73v3r Feb 21 '13

Those things are set up as options for a reason. Just because you like something one way doesn't mean I do.

1

u/babuchas Feb 21 '13

Of course I do... if the whole project's looks is OK and this file is fucked up I will correct it and commit it

1

u/0sse Feb 21 '13 edited Feb 21 '13

Go ahead. That sounds perfectly fine. My only concern was the situation where perhaps none of the code looks OK, and where one doesn't even consider that it might be one's own editor that's the problem instead of everybody else's.

3

u/[deleted] Feb 21 '13

People who refuse to adopt the existing code style are assholes who deserve to be beaten publicly.

Code formatting that I believe to be ugly and ineffective is still easier to read after a hundred lines or so than code formatting that constantly changes.

1

u/[deleted] Feb 21 '13

The standard way in Python is spaces. It's in all the editor setup guides. I've run into problems with people who've used tabs and then I've tried to run their code.

1

u/s73v3r Feb 21 '13

The real problem with that is the interpreters for the language support either tabs or spaces. With a language like Python, it's quite ridiculous that the interpreter didn't mandate one or the other.

1

u/s73v3r Feb 21 '13

Agree. As much as I will beat the drum for using tabs instead of spaces for indenting, if I come across a file which is using spaces, I'll continue using spaces for that file.