"Tab indents, space aligns" method is the best I have ever seen. It's surely the most free one. I hope that Geany will support it again soon. If I will be able to, I will try to help to reimplement it.
Some people may say, that indention and alignment could be solved with elastic tabstops (which Geany also use), but I don't think so.
Elastic tabstops doesn't allow user to change indention depth. When you change tab width from 4 to 8, your alignment done with tabstops will be broken.
Best regards
Daniel
Daniel Milde schrieb:
"Tab indents, space aligns" method is the best I have ever seen. It's surely the most free one. I hope that Geany will support it again soon. If I will be able to, I will try to help to reimplement it.
I, for myself, can't see how *any* TAB is useful for indentation at all. The look of the code highly depends on the settings of the user (particularly when mixed with spaces), and is independent of the sane indentation the author gave it.
Any tab+space will be broken if the user choses another tab width that the author did.
Please don't complicate indentation even more.
Best regards.
On Wed, May 13, 2009 at 8:00 PM, Thomas Martitz thomas.martitz@student.htw-berlin.de wrote:
Any tab+space will be broken if the user choses another tab width that the author did.
That is false. The point of "space for alignment" in the "tab for indentation, space for alignment" style is that the spaces will be there to maintain alignment. For some styles of alignment, the alignment will remain intact regardless of the tab width.
I especially see this in SQL, where some people like to *right*-justify the keywords, and of course the keywords are different lengths.
Personally, I don't use this style, but some people find it MUCH easier to read. Of course, you can also achieve this using spaces only, but that is not your statement. The fact is, adjusting the tab width will NOT ruin the alignment in this scheme.
If you are thinking of "use as many tabs as possible, then switch to spaces", that is something else. In the tab-for-indent scheme being discussed, if your code is at "indent level 1", you will have one tab, and then anything that needs to be aligned after that is spaces, even if it is 50 spaces.
John
Le Thu, 14 May 2009 02:00:40 +0200, Thomas Martitz thomas.martitz@student.HTW-Berlin.de s'exprima ainsi:
Any tab+space will be broken if the user choses another tab width that the author did.
You're wrong here. TAB indents will be correct whatever the *reader's* indent-width setting. Then spaces align for visual clarity. E.g. below:
class Dummy(SuperDummy): ''' SuperDummy specialized for cases of blah blih bluh. ''' def __init__(self, foo, # required at creation time bar=None): <do init>
Written in Geany with tab=4sp, pasted into email client where tab=8sp, then whatever happens on your side. I don't use this tab+space scheme everyday myself; but have to admit it makes sense, works fine and is consistent.
[I recognize too that the proponents of tab for indent who say that "1 tab = 1 indent" is a nice & simple mapping are true, while I rather use spaces to comply with coding guidelines.]
Denis ------ la vita e estrany
Thomas Martitz píše v Čt 14. 05. 2009 v 02:00 +0200:
Daniel Milde schrieb:
"Tab indents, space aligns" method is the best I have ever seen. It's surely the most free one. I hope that Geany will support it again soon. If I will be able to, I will try to help to reimplement it.
I, for myself, can't see how *any* TAB is useful for indentation at all. The look of the code highly depends on the settings of the user (particularly when mixed with spaces), and is independent of the sane indentation the author gave it.
Any tab+space will be broken if the user choses another tab width that the author did.
Please don't complicate indentation even more.
Best regards. _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
And that's just wrong.
1) If I use only TABs, then my alignment can be destroyed when user changes tab width.
2) If I use only spaces, than it can't be destroyed, but it can't be changed by user! And when some people use 2 spaces width and other 8 spaces width it's a real difference. Then is such code unreadable for them.
3) Finally when I use TABs for indention and SPACEs for alignment it can't be destroyed whatever user sets tab width to.
Example:
class Foo { ->function Boo(param1, ->.............param2, ->.............param3) ->{ ->->query = "SELECT name, ->->................password ->->.........FROM users ->->.........WHERE blabla"; ->->sql->query(query); ->} }
Such code is readable with every tab width setting and stays nicely aligned.
Best regards
Daniel