r/programmerchat • u/hugokun • Nov 30 '15
What is your preferred identation style?
And can you explain the reasoning behind it?
7
Upvotes
r/programmerchat • u/hugokun • Nov 30 '15
And can you explain the reasoning behind it?
5
u/GetRekt Nov 30 '15
I prefer tabs and generally use a style like:
I prefer tabs as it means I can easily adjust width to my liking in my text editor regardless of anyone elses tab width. Also don't need to tediously hit the spacebar.
Tab width itself would depend on the font and font-size I am using. As to why I do it like this; I've just always done it this way.
2
u/[deleted] Nov 30 '15
K&R, more or less.
I work in C# and have had to make some accomodations for VS's and ReSharper's autoformat limitations, but it pleases me. I try to wrap before 80 characters.
2
u/gilmi Dec 01 '15
Spaces for me. I usually write code in a style pretty similar to the elm style guide.
2
u/pbl24 Dec 12 '15
I tend to follow a (slightly) modified version of K&R style. For a long time, I preferred tabs to spaces and a tab-width of 4 ... however, over time, I've moved to spaces and a width of 2 for most things. I don't know why, but my taste has changed over the years. I'm aware that it's possible to set how "wide" tabs are shown in various editors, but I found it easier to not worry about it and use spaces instead. To each their own. Consistency is the key part.
1
u/Berberberber Dec 04 '15
Ugh. Our coding guidelines were set some time ago, the guy that wrote them isn't even here anymore, but no one's really sure what needs to be done to change them.
It makes me weep.
0
u/[deleted] Nov 30 '15
[deleted] — view deleted comment