Albrecht Schlosser schrieb:
> One reason why we're discussing this is that we _have_ different
> coding styles in some files. Thus, only reformatting indentation
> would probably be suboptimal.
imho formatting could be done manual and with spaces.
Maybe once with support of some tool.
>> So anything between
>> start of line and the first character could be aligned with tabs.
<snip/>
>
> ... with tabs and (+) spaces !
That is the point. If talking about unix the default width of
a tab is 8 characters. But thats no reason to use this width in
text editors. I guess all of them allow to redefine tab display
width.
Tabs in program code should follow logical structure and should
not be abused as space compression. Intermixing spaces and tabs
does the latter.
So, if only tabs are used for code identing it doesnt matter what width
is used to display a tab. In all cases the layout is correct.
> I'm pro indenting with mixed tabs and spaces, because this is widely
> used, and the file sizes would increase otherwise (random measurement:
> 10-20 %). This would probably not be too much, if compressed in the
> tar balls, but svn updates and local working copies would be increased).
Take f.e. editors that can use proportional fonts (e.g. scite).
(try it, its unimaginable but very readable)
Here the fixes assignment 1tab = 8spaces does not work.
> if someone indents 4 levels with 4 tabs (width 2), then this is
> for me an indentation by 16 levels (4 tabs * 8 = 32 columns = 16
> indent levels).
??
4 tabs= 4 times indent, if used with tabwidth=8 this is column 32 - yes.
If there is an agreement not to limit linelength this should be no
problem. Even with a linelength of 132 chars there are still 100 chars
left. Control structures that needs a lot of indentation could/should
be separated anyway.
The deepest identation i can see (quick view) in fltk code is in switch
statements like:
while (d < dend)
switch (*d)
{
case END :
if (prim)
switch (*prim)
{
case LINE :
fl_end_line();
break;
reformatted with tabs, display width 8 does not give a factor 4:
while (d < dend)
switch (*d)
{
case END :
if (prim)
switch (*prim)
{
case LINE :
fl_end_line();
break;
i guess this is not really a problem.
Really long lines are most times a result of long argument lists of
function calls and conditions, that could be formatted manual, notably
when dealing with logical operators, to maintain readability. eg.:
if ( (something && that_var_with_long_name)
|| (theother && this_var_with_long_name) )
or:
ClassConstructorWithLongName(foo f, bar b, baz z)
: myfoo(f)
, mybar(b)
{
init(z);
...
Again:
The point was to use tabs for identation (and only tabs)
Use tabs for logical structuring and not for space compression.
Many lingos does this too, so its not that unusual.
Any editor that does not handle tabs is not even usable to edit
Makefiles.
Gombok
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev