Tabs versus spaces: Spaces won
-
I hate all the defaults of tabs space of 4 and 8... I mean 8!? Come on, you're half way across the screen. 2 is the magic number :-D
The only place I worked that had an actual standard, the standard was four SPACEs, so I got used to that. Where I am now, all the existing code uses two SPACEs, so I adapted. Now my four SPACE indents look huge. :sigh:
-
I hate all the defaults of tabs space of 4 and 8... I mean 8!? Come on, you're half way across the screen. 2 is the magic number :-D
I also vote for 2 spaces. Fortunately do not have to deal with people who insist on 4 or 8. I am surprised how many of the good developers I know agree with 2.
-
OK, now look at your code in Notepad. Not everyone uses an IDE.
PIEBALDconsult wrote:
OK, now look at your code in Notepad.
Not everyone uses an IDE.Are you suggesting that programmers that don't use IDEs use Notepad? Certainly isn't the case for me. Certainly isn't the case for other developers that I know that don't use IDEs.
-
I also vote for 2 spaces. Fortunately do not have to deal with people who insist on 4 or 8. I am surprised how many of the good developers I know agree with 2.
Clifford Nelson wrote:
I am surprised how many of the good developers I know agree with 2.
However presumably those "good" developers spend the vast majority of time discussing a vast array of subjects of all which have nothing to do with indent preferences.
-
Clifford Nelson wrote:
I am surprised how many of the good developers I know agree with 2.
However presumably those "good" developers spend the vast majority of time discussing a vast array of subjects of all which have nothing to do with indent preferences.
Actually they have no reason to worry about that since that is a personal preference. Probably the best developer on my team was adamant about using tabs instead of spaces. Then he can use whatever he wants, and does not care what other developers are using.
-
The only place I worked that had an actual standard, the standard was four SPACEs, so I got used to that. Where I am now, all the existing code uses two SPACEs, so I adapted. Now my four SPACE indents look huge. :sigh:
Agreed
-
OK, now look at your code in Notepad. Not everyone uses an IDE.
PIEBALDconsult wrote:
Not everyone uses an IDE.
Amateurs. Seriously? Creating complex, feature rich applications/web sites with notepad? Not practical. Perhaps with something like Notepad++ but Windows Notepad? No, definitely not.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
-
I hate all the defaults of tabs space of 4 and 8... I mean 8!? Come on, you're half way across the screen. 2 is the magic number :-D
-
PIEBALDconsult wrote:
OK, now look at your code in Notepad.
Not everyone uses an IDE.Are you suggesting that programmers that don't use IDEs use Notepad? Certainly isn't the case for me. Certainly isn't the case for other developers that I know that don't use IDEs.
That is two separate statements.
-
Actually they have no reason to worry about that since that is a personal preference. Probably the best developer on my team was adamant about using tabs instead of spaces. Then he can use whatever he wants, and does not care what other developers are using.
So what happens whenshe edits your code, or you edit his?
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
-
PIEBALDconsult wrote:
Not everyone uses an IDE.
Amateurs. Seriously? Creating complex, feature rich applications/web sites with notepad? Not practical. Perhaps with something like Notepad++ but Windows Notepad? No, definitely not.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
mark merrens wrote:
Amateurs.
Contrarywise; newbies use IDEs and don't realize that there are other ways. Experienced developers know that there are several ways to skin most cats.
mark merrens wrote:
Creating complex, feature rich applications/web sites with notepad?
I didn't say that.
-
Tabs versus spaces: Spaces won[^] (source: Los Techies)
Why? Because since at least Visual Studio 2005, the default has been spaces."Do you like tabs in Visual Studio? I do too! But I gave up the tabs versus spaces argument, and so should you."
Gawd! All these 'should it be 2 spaces or 4' arguments can be done away with by using tabs-then you decide how wide you want a tab to be when you are editing, while your colleague can use a different value - everyone is happy!
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
-
PIEBALDconsult wrote:
Not everyone uses an IDE.
Amateurs. Seriously? Creating complex, feature rich applications/web sites with notepad? Not practical. Perhaps with something like Notepad++ but Windows Notepad? No, definitely not.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
We at my company often use the web editor in Umbraco to edit pages. It works best with spaces. Because of editors like this, much of the rest of our code follows that same convention so we don't have to switch things up.
-
So what happens whenshe edits your code, or you edit his?
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
That is the reason for going with tabs. If spaces are used, then the number of spaces specified will appear for everyone no matter what the user sets his tab spacing. When the person does editing with tabs as an option, then there will be a mixture of tabs and spaces, and it will look different on applications with different settings. When a person does editing with a different tab setting with spaces, then still have the problem. With tabs set for everyone, then each person can have what they like, and it will appear correct on thier screen. Thats why there is an issue that this forum was discussing. Set Option for Text Editor for C# to "Keep Tabs" and then each developer can have whatever indent size they like, and everybody is happy.
-
That is the reason for going with tabs. If spaces are used, then the number of spaces specified will appear for everyone no matter what the user sets his tab spacing. When the person does editing with tabs as an option, then there will be a mixture of tabs and spaces, and it will look different on applications with different settings. When a person does editing with a different tab setting with spaces, then still have the problem. With tabs set for everyone, then each person can have what they like, and it will appear correct on thier screen. Thats why there is an issue that this forum was discussing. Set Option for Text Editor for C# to "Keep Tabs" and then each developer can have whatever indent size they like, and everybody is happy.
Clifford Nelson wrote:
each developer can have whatever indent size they like
That depends on the tool. SPACEs are always consistent.
-
That is the reason for going with tabs. If spaces are used, then the number of spaces specified will appear for everyone no matter what the user sets his tab spacing. When the person does editing with tabs as an option, then there will be a mixture of tabs and spaces, and it will look different on applications with different settings. When a person does editing with a different tab setting with spaces, then still have the problem. With tabs set for everyone, then each person can have what they like, and it will appear correct on thier screen. Thats why there is an issue that this forum was discussing. Set Option for Text Editor for C# to "Keep Tabs" and then each developer can have whatever indent size they like, and everybody is happy.
Egg-sactly
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
-
Gawd! All these 'should it be 2 spaces or 4' arguments can be done away with by using tabs-then you decide how wide you want a tab to be when you are editing, while your colleague can use a different value - everyone is happy!
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
_Maxxx_ wrote:
you decide how wide you want a tab to be when you are editing
That depends on the tool. Have you tried setting the tabs on a VT100 or emulator? There are historical reasons for using SPACEs. If you insist on TABs you'd better hope to never encounter code from last century.
-
_Maxxx_ wrote:
you decide how wide you want a tab to be when you are editing
That depends on the tool. Have you tried setting the tabs on a VT100 or emulator? There are historical reasons for using SPACEs. If you insist on TABs you'd better hope to never encounter code from last century.
PIEBALDconsult wrote:
That depends on the tool.
Yes, it does. And if you are using stone age tools, then sure, your particular standards will vary (6 character variable names, all upper case etc.) but we're talking standards here, not archaeology.
PIEBALDconsult wrote:
Have you tried setting the tabs on a VT100
yes, I have. not for a long time, but yes, I have.
PIEBALDconsult wrote:
here are historical reasons for using SPACEs.
Again, yes there are, and if your shop needs to edit code using tools that can't display tabs, then obviously your standards should be not to use tabs. if you're shop uses black and white (or black and green, or even black and amber) text monitors, then you better not be using any sort of colorisation either.
PIEBALDconsult wrote:
If you insist on TABs you'd better hope to never encounter code from last century.
why? If I need to edit code that does not allow the use of tabs, then standards are a rather moot point! If it is code that didn't use tabs when it was written well, I have a choice - live with it or convert to tabs (there's a rather neat VS tool that will do it for you) in short, there are advantages to using tabs (personal preference of layout is easy to achieve with minimal effort, less keytrokes) that, I think, make it an obvious standard, unless in an individual's circumstance it is not possible (e.g. you need to edit the code using vi) in which case it is not possible to use the superior method.
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
-
Clifford Nelson wrote:
each developer can have whatever indent size they like
That depends on the tool. SPACEs are always consistent.
not with a proportional font...
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
-
Egg-sactly
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
Tabs win where people pay attention. Very easy to convince people to go with tabs. Should be the default.