|
Now you know, we as nerds just love a good debate. And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins. And no other topic, save a few, has this proven to more evident than in the tabs versus spaces great debate of our generation. Now, rather than fan the flame of that saga, I'm curious to know what people still prefer for tab width (regardless of an actual tab char or if it's spaces).
For years, I've always been a four column guy with tab widths. I mean years. Anything else was stupid and bunches together what would otherwise be beautiful code. But then I started doing a lot of JavaScript development where the popular thing is to use two column widths. Ruby seems to embrace that too. It's ugly I thought. I shan't cave in. It's immoral and just wrong. But in being a team player you go along with what must be done for the sake of the project.
Now, a couple years later. I look at four column tab width code and think "well gee that's just too damn wide." I still don't like two column width. Looks like the code is still in kiddy land when I see that. I started doing some plug-in development for a Forex trading platform a few years back. It's a proprietary language and by default it uses 3 column widths in the code editor for it. At first I was like "ok wtf." But after years of using that proprietary language... turns out 3 column width is perfect!
You can use it everywhere. C#, C/C++, JavaScript. Whatever, it's a nice compromise for everyone. In this day and age where we are expected to learn 20 million things, both client and server, rather than just one language, I tend to find myself using this more and more so I don't have to readjust my eyes to differently spaced code all day long. Only problem is... nobody else uses 3 column widths that I know of.
So, I'm curious to know, what do y'all use still and why?
Jeremy Falcon
modified 7-Aug-17 16:46pm.
|
|
|
|
|
3 is still a bit too wide so I prefer 2.718 spaces per tab.
|
|
|
|
|
|
harold aptroot wrote: 2.718
I prefer 2.6589754 spaces, but hey, now we are splitting hairs.
|
|
|
|
|
1.618 spaces is golden.
If you think 'goto' is evil, try writing an Assembly program without JMP.
|
|
|
|
|
Spaces rule and tabs drool.
2 spaces to be exact.
Whenever you find yourself on the side of the majority, it is time to pause and reflect. ~ Mark Twain
|
|
|
|
|
2 spaces in all environments, like even C#?
Jeremy Falcon
|
|
|
|
|
I don't develop with C# so... YES! Even C#.
Whenever you find yourself on the side of the majority, it is time to pause and reflect. ~ Mark Twain
|
|
|
|
|
|
I like a half inch per indent level, so it depends on font (I prefer 8-point Andale Mono), screen size/resolution etc.
|
|
|
|
|
I gotcha... similar principle then... as far as wanting visual consistency.
Jeremy Falcon
|
|
|
|
|
The perfect width for a tab or spaces is... 42
I use 4, always have, always will. If any of my devs use more or less or convert to spaces they are publicly humiliated and forced to wear mittens to code for the next week until they learn that 4 is THE magic number when it comes to tabs and tabs are as close to perfection as code spacing and indents can possibly get.
|
|
|
|
|
Come on man... give spaces a try. Peddling this like a drug dealer. Only the first space is free.
Not to open up that can of worms, but I was a hardcore tabs guy for years. But spaces are universal. Once I got used to spaces, I could see my code formatted well in any IDE. I could upload it to the web server, output or inspect it in the terminal on Unix/Linux or command line or Notepad in Winders and it still was formatted well. Basically, it made life more portable. I never went back.
Jeremy Falcon
|
|
|
|
|
Chuck Norris uses Tabs. So should you.
|
|
|
|
|
Oooooooh snap.
Jeremy Falcon
|
|
|
|
|
Chuck Norris is NOT celebrated for his programming abilities.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
Meh! Chick Norris thinks in binary and writes in assembler. Everything he does is code.
|
|
|
|
|
Quote: Chick Norris Is that Chuck Norris's sister?
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
|
I go along with whatever the IDE inserts for me when I hit TAB. What I hate is when VS separates the start (<) and end (>) of generic parameters onto separate lines. I don't have a problem with method call chains or method parameters spanning multiple lines, but those generic parameters belong onto the same darn line!
I only have a signature in order to let @DalekDave follow my posts.
|
|
|
|
|
Marco Bertschi (SFC) wrote: I go along with whatever the IDE inserts for me when I hit TAB.
I do the same thing, mostly to be consistent with my team. But...
if(i.haveUltimateSaySo) {
i.useTwoSpacesInsteadOfTabs();
i.putCurlyBraceAtEndOfIfLine();
i.useCurlyBracesOnEveryLoopOrConditional();
i.useCamelCase();
}
On the other hand, you have different fingers. - Steven Wright
|
|
|
|
|
Been through the same journey as you. I like best 3 columns, but my current work requires 4 columns. Ah well.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
You're a smart man!
Jeremy Falcon
|
|
|
|
|
Jeremy Falcon wrote: And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins.
And unworthy of my answer, so go away! Oh, wait, I've been ahead of you[^] for quite some time in this respect.
It Is The Absolute Verifiable Truth & Proven Fact
That Your Belly-Button Signature Ties
To Viviparous Mama.
|
|
|
|
|
2 columns and use tabs all applications, including TSQL.
ctrl e d will reformat the current file in c#.
Red-Gate has an excellent formatter for stored procs.
As the lead developer I set the standards and if I find someone has reformatted my code I get quite grumpy.
Never underestimate the power of human stupidity
RAH
|
|
|
|