faq
flatforty
contribute
subscribe
configure
search
rdf
main
parent
|
Crucial Question Forgotten
by KDE User on Tuesday 18/Sep/2001, @01:58
|
Charles, what do you think about the Tabs versus Spaces for indentation situation in KDE? I am never sure which to use and I am not happy about the state of Spaces and Tabs in KDE CVS! We should do something about this.
Thanks for Noatun though. :) |
|
|
The Fine Print: The following comments
are owned by whomever posted them.
( Reply )
|
Nonsense
by Simon Perreault on Tuesday 18/Sep/2001, @05:24
|
Everybody knows that the OTIS (One True Indenting Style) uses 4 spaces for indentation.
pffffffft...
|
[
Reply To This | View ]
|
Re: Nonsense
by Matt Spong on Tuesday 18/Sep/2001, @07:50
|
"Everybody knows that the OTIS (One True Indenting Style) uses 4 spaces for indentation."
Bah! No! Use tabs. If you like your indentation to be 4 spaces, set your tabstop to 4.
|
[
Reply To This | View ]
|
Re: Nonsense
by Christian on Tuesday 18/Sep/2001, @11:35
|
What does 4 spaces mean ? 4 spaces.
What do you intend when putting them ? Indent.
Just as the newline character means a new line,
et the tab mean indentation (or tabulation).
That was it is for.
The first thing you learn while writing XML/SGML
documents is that contents is not presentation.
You waste your time if you take care of presentation
(ie : counting tabs, and why 4 tabs after all - it's
a presentation choice) while coding. Tabs acts as
a XML tag that says... indent !
Let your editor handle the look of your code, and
put only the core meaning in your files.
(of course, that's my opinion... and no, I do not
want to troll ;-)
|
[
Reply To This | View ]
|
Re: Nonsense
by Evan "JabberWokky" E. on Tuesday 18/Sep/2001, @12:00
|
: The first thing you learn while writing XML/SGML
: documents is that contents is not presentation.
Damn it, I
took your
concept to heart
,
and now my python
programs won't
run!
--
Evan
|
[
Reply To This | View ]
|
Re: Nonsense
by Christian on Tuesday 18/Sep/2001, @13:39
|
You misunderstood me. In python, indentation is part
of the semantic. Presentation has nothing to do with
indentation, you can indent with tab (a language that
doesn't accept that is a broken one).
|
[
Reply To This | View ]
|
Re: Nonsense
by Evan "JabberWokky" E. on Wednesday 19/Sep/2001, @12:36
|
:: You misunderstood me. In python, indentation is part
:: of the semantic. Presentation has nothing to do with
In python, indentation is part of the semantic
information used by the interpreter. In C++,
indentation is part of the semantic information used
by the coder.
Otherwise, why comment code? It does not carry any
semantic information that the compiler cares about...
--
Evan
|
[
Reply To This | View ]
|
|
Re: Crucial Question Forgotten
by Neil Stevens on Tuesday 18/Sep/2001, @08:02
|
While reloading http://www.kde.org/ waiting for the KDE 2.2.1 release, so that I can mention it on freekde in a timely manner, I happened to notice this article... and it's a good thing I did.
The definitive answer on code indentation is found at why-to-tabs.html, mirrored on freekde as Charles lost his DSL. A more complete style document is available at s-and-s.html
(I still wish you'd use slash so I can turn off comment display, Navindra)
|
[
Reply To This | View ]
|
Re: Crucial Question Forgotten
by Navindra Umanee on Tuesday 18/Sep/2001, @09:11
|
And this from the person who actually used but subsequently abandoned Slash for some other wanabee LAMP solution? ;)
-N.
|
[
Reply To This | View ]
|
Re: Crucial Question Forgotten
by KDE User on Tuesday 18/Sep/2001, @11:29
|
Definitive my ass. The fact that you prefer it hardly makes it definitive. Plus it was written by Charles. Not to downplay his significance in KDE, but he's hardly an authority on all of programming. K&R say style is choice of the coder (what a shock!), and the only thing they recommend is sticking with the same style throughout your code, which is excellent advice.
So stop this "definitive" crap.
|
[
Reply To This | View ]
|
Re: Crucial Question Forgotten
by Guillaume Laurent on Tuesday 18/Sep/2001, @14:49
|
> The definitive answer on code indentation is found at why-to-tabs.html
I think it comes as no surprise that the person who wrote this (Charles) is still in high school. None of his arguments hold ground. This one in particular is a gem :
"Any editor that doesn't cope with tabs isn't an editor, but a bug (emacs comes to mind)."
Be assured that once he graduates, after a couple of years working as a professional programmer part of a team, he'll have quite a different opinion. At least I hope for him :-).
|
[
Reply To This | View ]
|
Re: Crucial Question Forgotten
by Carlos Rodrigues on Tuesday 18/Sep/2001, @15:33
|
Yeah... really definitive, anyone who uses tabs for identation will eventually use a space (mainly when you break statements into multiple lines) and... voilá, your code now visually suck everywhere but your editor (good luck trying to avoid it). Anyway tabs or spaces are a matter of personal choice, there's nothing definitive about that. I use spaces... I want my code to look the same everywhere... maybe I'm evil, but that's my choice.
|
[
Reply To This | View ]
|
|
The Fine Print: The previous
comments are owned by whomever posted them.
( Reply )
|
|