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.
91–100 of 124 posts
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.
My reason for being against tabs is that unless you have something like gofmt, somebody will inevitably screw up and put in indentation that mixes tabs and spaces.
The second thing to check would be tabs that aren't in the initial indentation whitespace of the line. The other inevitable screw-up is using tabs to do some kind of vertical layout that shows up right with exactly one tab stop size.
Obligatory clip from Silicon Valley (Season 3): Tabs vs Spaces (Some potential storyline spoilers if you haven't seen Silicon Valley) https://youtu.be/SsoOG6ZeyUI
A vim user who prefers spaces to tabs but doesn't know about 'set expandtab'?
// vim:set ts=8 sw=4 sts=4 tw=80 expandtab :I couldn't care less about this, and I generally feel out of place when other programmers ask me about my preferences on this topic. I have written code in different programming languages, and just naming Go and PHP where Tabs and Spaces are the standard respectively — PHP mostly because of PSR — I simply don't pay attention to the character(s) used for the indentation, the tooling already does that for me, being gof…
Completely unrelated. Noticed you use Vala. Just curious, how do you find it? Do you just use it for GNOME related things (GUI building) or for other cases as well? Remember being interested in it a few years back. It seemed to be popular, but haven't followed it since.
It has worked well for me, and was able to create corporate applications in the past. I don't use it with the same frequency now because of my current job, but it is still in my list of programming languages that I want to use for personal projects along with C++ and (recently) Go.
For people interested in the language I suggest them to take a look at Elementary OS documentation, they are one of the most popular projects using Vala in production and I am sure they will appreciate any contribution from beginners and experience developers: https://elementary.io/developer — https://github.com/trending/vala
Earlier quoted context omitted.
Right, not now you're dictating coding style to work around the warts associated with using tabs. If you use spaces there are no such issues because spaces don't change widths between editors.
To be honest, no, because my formatting will not be broken after refactoring changing function name length.
After 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…
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.Earlier quoted context omitted.
Right, not now you're dictating coding style to work around the warts associated with using tabs. If you use spaces there are no such issues because spaces don't change widths between editors.
The kind of formatting you suggest - aligning with spaces to get beautiful indenting - is a royal pain in the ass to edit. You change the function name to something a few characters shorter and now you have to change all the lines. It's prettier than the alternative, though (I still don't use it). I wish the pioneers of programming languages would have had the foresight to provide an automatic formatting tool and sta…
Neither! 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.
Earlier quoted context omitted.
The kind of formatting you suggest - aligning with spaces to get beautiful indenting - is a royal pain in the ass to edit. You change the function name to something a few characters shorter and now you have to change all the lines. It's prettier than the alternative, though (I still don't use it). I wish the pioneers of programming languages would have had the foresight to provide an automatic formatting tool and sta…
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.
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 ass. I do use Python occasionally but for very different reasons than aesthetics.