[Lazarus] Elastic Tabstops: benefits or not

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Nov 6 17:45:09 CET 2009


2009/11/6 Martin <lazarus at mfriebe.de>:
>
> The same portability is archived if the company decides to use tabs of a
> specific width (e.g 4)

With one extra benefit, that each developer can still decide what
tabwidth (ET property, not standard tabs) they would like indentation
to be. So developers still get there desired indentation with neatly
aligned text, and the company is still happy that everybody is
conforming to the code formatting standards or using tabs. :)

>
> what about my example?
>  if a then begin <TAB> // some comment
>  <TAB> writeln()
>
> versus
>  procedure( <TAB> param1
>  <TAB> param2


lines 16 & 17 vs 18 & 19 in my ex3.png shows exactly that.  The thing
is that in your first case the Tab char should not be used before the
comment, because you are not aligning it with anything - no other code
or any other comments. So simply use a space to separate "begin" and
"// some comment".



> ok, so in this case the indented statement is aligned in a none ideal way?

Correct, but in that first example of yours, the code is also not
written in a ideal way. ;-)

Either way, if I even get the time to implement ET in Lazarus IDE, it
will obviously be a optional settings and include support to convert
from Tabs to Spaces and vice-versa.

-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/




More information about the Lazarus mailing list