Home » Language IDEs » Java Development Tools (JDT) » editor-tabs don't exceed 4 spaces - 3.0.0M6-linux-gtk
editor-tabs don't exceed 4 spaces - 3.0.0M6-linux-gtk [message #156065] |
Tue, 27 April 2004 07:26 |
Eclipse User |
|
|
|
Originally posted by: wagner.stefan.berlin.de
Running 3.0.0M6 -linux-gtk,
I set the value in
Preferences/ Java/ Code Formator/ Style:
Number of spaces representing a tab to 8.
But the view shows a maximum of 4 spaces per tab.
[cite Linus Thorvald:
Tabs are 8 characters, and thus indentations are also 8 characters.
There are heretic movements that try to make indentations 4 (or even 2!)
characters deep, and that is akin to trying to define the value of PI to
be 3.
whole article: http://lxr.linux.no/source/Documentation/CodingStyle
]
Is eclipse part of this heretic movement?
Note that eclipse should then automatically generate the corresponding
ugliness like this:
}//end if
}//end for
which is senseless when using the RIGHT value which is '8'.
|
|
| | |
Re: editor-tabs don't exceed 4 spaces - 3.0.0M6-linux-gtk [message #156219 is a reply to message #156065] |
Wed, 28 April 2004 02:04 |
Eclipse User |
|
|
|
Originally posted by: bytor2001.yahoo.com
Stefan Wagner wrote:
> Running 3.0.0M6 -linux-gtk,
>
> I set the value in
> Preferences/ Java/ Code Formator/ Style:
> Number of spaces representing a tab to 8.
>
> But the view shows a maximum of 4 spaces per tab.
----snip----
>
> Is eclipse part of this heretic movement?
>
I indent 3 for C/C++ and 4 for all other languages. But I always
have the Dev Environment (XEmacs, Eclipse, ...) use spaces
instead of actual tab characters so my code looks the same
everywhere. Unless, of course, you use a non-fixed-width font
like Arial or something Gothic. That would be true heresy...
-xbytor
|
|
| |
Re: editor-tabs don't exceed 4 spaces - 3.0.0M6-linux-gtk [message #156240 is a reply to message #156219] |
Wed, 28 April 2004 07:23 |
Eclipse User |
|
|
|
Originally posted by: wagner.stefan.berlin.de
Hi xbytor
>
> I indent 3 for C/C++ and 4 for all other languages. But I always
> have the Dev Environment (XEmacs, Eclipse, ...) use spaces
> instead of actual tab characters so my code looks the same
> everywhere.
That's okay if you're the only one, who uses the code, and use sometimes
an editor, which has no settings to display a tab as something else than
8 spaces.
But if you share your code, it will be bad, because other coders may not
set their editor to their prefered behaviour, since you used spaces and
not tabs.
And you need more keyhits to navigate and more bytes to save.
I guess you use the ugly-end-of-block-commenting-pattern
}//end for
}//end if
to make your code readable :) (har har har) :)
Using a (default) non-monospaced font was the reason for my problems -
they are solved now.
In 3.0.0 M8 the indentation-settings can be saved to a file, so you can
easily move them to work etc.
On linux there is the old program 'indent' with a cryptic but very
wide-range configurability but with a lack of knowledge of c++ - only
meant to deal with c.
So it's nice to have automatic code-formatters, so you can change the
code-style, edit, give it back to the author, who recreates his own
style before reading in anger.
But of course it is a very complex issue, and for every rule there is an
exception and exceptions from exceptions and so on.
But they made a great work for 3.0.0M8 !!! gratulation!
|
|
|
Re: editor-tabs don't exceed 4 spaces - 3.0.0M6-linux-gtk [message #156498 is a reply to message #156240] |
Thu, 29 April 2004 03:15 |
Eclipse User |
|
|
|
Originally posted by: bytor2001.yahoo.com
Stefan Wagner wrote:
> Hi xbytor
>
>>
>> I indent 3 for C/C++ and 4 for all other languages. But I always
>> have the Dev Environment (XEmacs, Eclipse, ...) use spaces
>> instead of actual tab characters so my code looks the same
>> everywhere.
>
>
> That's okay if you're the only one, who uses the code, and use sometimes
> an editor, which has no settings to display a tab as something else than
> 8 spaces.
>
> But if you share your code, it will be bad, because other coders may not
> set their editor to their prefered behaviour, since you used spaces and
> not tabs.
This is usually not a problem for me since I have normally been in the
position of modifying other peoples code than having them modify mine.
When I have to modify their code, I try to use the environment they
use, like VAJ or, god forbid, vi. If I mess with their code I follow
their formatting rules, regardless of how much it may want to make me
yakk (?yacc).
>
> And you need more keyhits to navigate and more bytes to save.
If I'm in an environment that doesn't allow CTRL-LeftArrow and
CTRL-RightArrow to hop around, that would be a problem. And disk space
hasn't been a problem for several years...
>
> I guess you use the ugly-end-of-block-commenting-pattern
> }//end for
> }//end if
> to make your code readable :) (har har har) :)
>
> Using a (default) non-monospaced font was the reason for my problems -
> they are solved now.
>
> In 3.0.0 M8 the indentation-settings can be saved to a file, so you can
> easily move them to work etc.
I haven't looked at 3.0.0 M8 yet. Sounds like fun!
> On linux there is the old program 'indent' with a cryptic but very
> wide-range configurability but with a lack of knowledge of c++ - only
> meant to deal with c.
I grew up with 'indent', 'lint', and 'emacs' as part of my basic C
development environment. OldSkool still Rox. I still have 'tr' aliases
for CRLF<->NL conversions.
> So it's nice to have automatic code-formatters, so you can change the
> code-style, edit, give it back to the author, who recreates his own
> style before reading in anger.
Emacs has a nice command 'indent-region' which will let a developer
reformat code according to their own locally defined rules. Kinda like
an easy-to-use 'indent'.
> But of course it is a very complex issue, and for every rule there is an
> exception and exceptions from exceptions and so on.
Yeah. That's why I never get religous about the matter. But that doesn't
stop me from having an opinion, of course.
>
> But they made a great work for 3.0.0M8 !!! gratulation!
>
|
|
|
Re: editor-tabs don't exceed 4 spaces - 3.0.0M6-linux-gtk [message #156593 is a reply to message #156240] |
Thu, 29 April 2004 10:53 |
Eclipse User |
|
|
|
Originally posted by: catcher.linuxmail.org
Stefan Wagner wrote:
> Hi xbytor
>
>>
>> I indent 3 for C/C++ and 4 for all other languages. But I always
>> have the Dev Environment (XEmacs, Eclipse, ...) use spaces
>> instead of actual tab characters so my code looks the same
>> everywhere.
>
>
> That's okay if you're the only one, who uses the code, and use sometimes
> an editor, which has no settings to display a tab as something else than
> 8 spaces.
>
> But if you share your code, it will be bad, because other coders may not
> set their editor to their prefered behaviour, since you used spaces and
> not tabs.
>
> And you need more keyhits to navigate and more bytes to save.
>
> I guess you use the ugly-end-of-block-commenting-pattern
> }//end for
> }//end if
> to make your code readable :) (har har har) :)
>
> Using a (default) non-monospaced font was the reason for my problems -
> they are solved now.
>
> In 3.0.0 M8 the indentation-settings can be saved to a file, so you can
> easily move them to work etc.
> On linux there is the old program 'indent' with a cryptic but very
> wide-range configurability but with a lack of knowledge of c++ - only
> meant to deal with c.
> So it's nice to have automatic code-formatters, so you can change the
> code-style, edit, give it back to the author, who recreates his own
> style before reading in anger.
> But of course it is a very complex issue, and for every rule there is an
> exception and exceptions from exceptions and so on.
>
> But they made a great work for 3.0.0M8 !!! gratulation!
>
If you use an editor that cannot reformat the way you want it easily.
Change your editor. I use 4 spaces and only spaces and have in every
team project I have worked on.
|
|
|
Goto Forum:
Current Time: Sat Nov 09 23:11:29 GMT 2024
Powered by FUDForum. Page generated in 0.03292 seconds
|