Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Eclipse UserFriend
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 #156154 is a reply to message #156065] Tue, 27 April 2004 16:31 Go to previous messageGo to next message
Henning Rogge is currently offline Henning RoggeFriend
Messages: 148
Registered: July 2009
Senior Member
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.

Eclipse 3M8 is working fine with both 4 and 8 spaces as tabs.

> [cite Linus Thorvald:
....
> ]
>
> Is eclipse part of this heretic movement?

Do you know what pain 8-style tabs are in inner classes ? ( 16 spaces
just for the class body, an additional 8 spaces for functions, ect. )

Henning Rogge
Re: editor-tabs don't exceed 4 spaces - 3.0.0M6-linux-gtk [message #156211 is a reply to message #156154] Wed, 28 April 2004 03:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wagner.stefan.berlin.de

Hi Henning,

> Do you know what pain 8-style tabs are in inner classes ? ( 16 spaces
> just for the class body, an additional 8 spaces for functions, ect. )

No - I enjoy it.
For an indentation-level of 7 there are still 16 characters place for
code on a plain 80x25 terminal.
If you don't prefer program on a mobile-phone, you get bigger screens
from year to year.

I entered this bug and invite for voting:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=60194
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #156232 is a reply to message #156211] Wed, 28 April 2004 06:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wagner.stefan.berlin.de

> I entered this bug and invite for voting:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=60194
>
Sorry for wasting your time -

The font was set to a text-publishing font (which imho is a kind of
brain-damage) and not to an equal-with/ aequidistant/ monospaced, so my
code looked as if it was 4-spaced-tabbed, because 8 spaces are as tall
as 'publ' in 'public class foo'.

public class foo
{
int bar;

Changing the java source font helped.

I marked the bug as solved.
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Wrong compiler compliance level when exporting feature
Next Topic:Using Eclips with Versata and Websphare
Goto Forum:
  


Current Time: Fri Nov 08 22:49:29 GMT 2024

Powered by FUDForum. Page generated in 0.03875 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top