[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Indentation
From:       Melchior FRANZ <mfranz () kde ! org>
Date:       2005-03-05 15:59:02
Message-ID: 200503051659.03088 () pflug2 ! gphy ! univie ! ac ! at
[Download RAW message or body]

* Anne-Marie Mahfouf -- Saturday 05 March 2005 16:05:
> A developer looked into my code (KHangMan in kdeedu if you want to look) and 
> fixed a bug (that was cool) but he also wrote me that he never saw such an 
> indentation mess before.

And I apologize. I'm the worst pedant in these things and I should save that
for my own code.  :-)



> He did not tell me what editor he uses,

... and you didn't ask. I'm using vim with these "special" settings for pedants:

  set listchars=tab:°`,trail:°,extends:>,precedes:<
  set list


Which made the code look like this:

  °`````if (m_view->language == "en" || m_view->language == "it" || m_view->language \
== "nl" || m_view->language =="ru" || m_view->language =="bg") °```````noCharBool = \
true; °```````else noCharBool = false;
°```````if (secondToolbar->isVisible() && !noCharBool)
°```````    m_bCharToolbar=true;
°```````secondToolbar->clear();
°```````allData.clear();
°```````if (!noCharBool) {
°```````QString myString=QString("khangman/%1.txt").arg(m_view->language);
°```````QFile myFile;
°```````myFile.setName(locate("data", myString));

No indents after "if" and "else" and without "jump to matching brace I wouldn't
have found the closing brace to the second if. And then there were wild mixtures
of spaces and tabs, such as these (whereby my vim shows °``````` for tabs):

    °```// Language
    °```selectedLanguage = Prefs::selectedLanguage();
°```````if (m_languages.grep(selectedLanguage).isEmpty())
°```````°```````selectedLanguage = "en";
     °``setLanguage(selectedLanguage);
    °```// Level
    °```currentLevel = Prefs::level(); //default is easy
     °``// Show/hide characters toolbar
   °````m_bCharToolbar = Prefs::showCharToolbar();
   °````if (m_bCharToolbar)



> I use Kate and thought my indentation was quite OK.

Hey, it's not *that* bad.  :-)



> I asked further details but he did not answer yet.

Oh. I didn't get anything from you. But forget the whole thing. It's mainly
*you* who edits your code, and everyone else will be able to live with it. I
shouldn't have said anything. Sorry!

m.
 
> > Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic