I find it interesting that C++ using the .cc extension has about 7% tabs, whereas C++ using the .cpp extension has about 36% tabs. I wonder what else is different about these two groups.
Tabs or spaces – Parsing a 1B files among 14 programming languages
111–120 of 124 posts
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#112Earlier quoted context omitted.
That's also hazardous when you later add an_even_longer_variable and then have to modify three extra lines to make them align.
Exactly. To be fair, I believe most popular editors have plugins/shortcuts to do this. Or at least I hope people aren't doing this manually.
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#113Neither! http://nickgravgaard.com/elastic-tabstops/ “ A better way to indent and align code ” When I saw this, it was obvious to me that this was the true solution to the problem which both space and tab proponents try to solve.
It's sad that this hasn't seen any traction in the past 10(!) years. It seems so much better than the current mess.
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#114Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#115After 20+ years of listening to the tabs-vs-spaces debate and considering all the legitimate points that both sides have, many have made the following observation and it's what resonates with me the most: In an ideal perfect world, _all_ of programmers and _all_ text editor tools would use tabs specifically for indentation and spaces specifically for alignment. But, we don't live in that perfectly coordinated world s…
Personally, I don't find the value in alignment - indentation is all I do. I especially dislike alignment of this sort: var a_variable = 1; var another_variable = 2; var yet_another_variable = 3; which is just too fiddlesome and in fact makes it _harder_ for me to read.
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#116Earlier quoted context omitted.
Exactly. To be fair, I believe most popular editors have plugins/shortcuts to do this. Or at least I hope people aren't doing this manually.
But if anyone looks at a diff, it looks like all the lines have changed, instead of just one, taking just a tiny bit more cognitive overhead.
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#117Earlier quoted context omitted.
That particular form of formatting is part of Python's PEP-8, which has tooling around it. Maybe not all editors have something built it, though.
Editor is one thing and most fully featured editors probably have an indent mode like this. Then there's all the other tools, like diff/merge tools, automatic refactoring scripts, etc which don't work as well. I'm not a fan of Python's significant whitespace or PEP-8 in the first place. It puts too much emphasis on aesthetics at the cost of practicality. Writing a parser or any tooling for that is just a pain in the…
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#118After 20+ years of listening to the tabs-vs-spaces debate and considering all the legitimate points that both sides have, many have made the following observation and it's what resonates with me the most: In an ideal perfect world, _all_ of programmers and _all_ text editor tools would use tabs specifically for indentation and spaces specifically for alignment. But, we don't live in that perfectly coordinated world s…
Personally, I don't find the value in alignment - indentation is all I do. I especially dislike alignment of this sort: var a_variable = 1; var another_variable = 2; var yet_another_variable = 3; which is just too fiddlesome and in fact makes it _harder_ for me to read.
// some code
// ...
var some_call_result = some_object.a_method(with, quite_long, list_of,
parameters)
In the second line you get indent (up to `var' keyword level), and then
alignment. The former would be fine with tabs, but the latter must be spaces.Unfortunately there's no editor that deals with tabs in this situation correctly, which means spaces is the only way to go.
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#119I would like to know If they are people who have 'switched'(coded with spaces and then use tabs or revers)?
Re: Tabs or spaces – Parsing a 1B files among 14 programming languages
#120Neither! http://nickgravgaard.com/elastic-tabstops/ “ A better way to indent and align code ” When I saw this, it was obvious to me that this was the true solution to the problem which both space and tab proponents try to solve.
Admittedly, I am pretty picky on what's unusable. Also, this page lists it as an "incorrect implementation".