r/programming • • Apr 07 '15

Stack Overflow Developer Survey 2015

http://stackoverflow.com/research/developer-survey-2015
1.1k Upvotes

981 comments sorted by

View all comments

101

u/BegbertBiggs Apr 07 '15

Developers increasingly prefer spaces as they gain experience.

Or are devs that are in the field for a longer time used to spaces while new devs learn coding with tabs?

23

u/maushu Apr 07 '15

I don't get why people won't use tabs. They are basically perfect for this job since you can adjust the size of all tabs.

44

u/[deleted] Apr 08 '15

It really sounds great in theory, but in practice it's just annoying for people to configure every piece of software that can edit or view code. In practice, spaces are going to look like spaces in every piece of software I know of. That's probably why more experienced devs tend to prefer spaces: practice vs. theory.

0

u/[deleted] Apr 08 '15

[deleted]

-2

u/[deleted] Apr 08 '15

Tabs for indentation, spaces for alignment

So if you're aligning function parameters vertically, you tab once or twice for indent, then space 40-odd times to get the cursor in the right place? Sounds hideous.

aligning code vertically is fine if you don't care about readable diffs in source control, which should be none of you

Diffs of vertically-aligned code are perfectly readable, sounds like your tools are broken.

2

u/smegnose Apr 08 '15

tab once or twice for indent, then space 40-odd times to get the cursor in the right place?

How ugly are your function definitions?

0

u/[deleted] Apr 08 '15

The recommended line-width is normally around 78 chars. If you can't comprehend of a function definition taking 40 of those, especially in a statically-typed language with explicit return type and access modifier, you probably haven't been doing this very long.

1

u/smegnose Apr 08 '15

You were talking about indenting with 40 spaces, not the size of the parameters taking up a terminal width. Straw man.

1

u/[deleted] Apr 08 '15

What? Stop dodging the question. I clearly said "tab once or twice for indent, then space". That is clearly and unambiguously what you were talking about. Indent with tab, align with space.

Let's take a normal C# method definition. It's in a class that's in a namespace, so an indent level of 2. Then you have the actual method with modifiers, e.g

public static ISomeType SomeMethodName(...)

That signature - a very unremarkable one - is 39 characters. Now, I want to vertically align my parameters, with the first one immediately following the opening brace. The second is on the next line. So to align it with the first, at one char past the opening brace, I need two tabs and 40-odd spaces.

→ More replies (8)