[En-Nut-Discussion] Tons of trailing spaces in our source code

Thiago A. Corrêa thiago.correa at gmail.com
Sun Oct 17 16:07:43 CEST 2010


Hi,

On Sun, Oct 17, 2010 at 10:41 AM, Ulrich Prinz <uprinz2 at netscape.net> wrote:

> Yes but others use Notepad++ oder SourceInsight and they don't like to
> first diff, then revert, then ...
> So it should be no problem to once remove all trailing spaces and then
> keep care not to introduce new ones. Even if there are plugins, like
> Harald told, that keep care about that.

Why should Notepad++ or SourceInsight care about trailling
whitespaces? Just out of curiosity really.

>>      But I don't agree much with the tab ->  space. Using tabs has the
>> advantage that you can setup your source code editor to display it
>> with the indentation that you prefer. Even on vi, you can just set
>> ts=4 or whatever value you like.
>>
> Yes, I fully agree! But Nut/OS has been told to not use TABs and so we
> either need to change that decision and one time convert everything or
> we need to keep up the rule and clean up.

Sure.

>>      Automatic source identation tools usually mess up with the
>> switch() clauses, so if we use it, we better review the results
>> carefully. Just my 2 cents.
>>
> It is not problematic as long as the compiler doesn't get puzzled. For
> me it is fully ok to write
> switch (a) {
>   case 1: b=5; break;
>   case 2: c=7; break;
>   ...
> }
>
> as this is easy to read, and not blowing up the pages. You justt get
> more to see on your screen. But if there are two or more lines of code
> between case and break then you should put it to separate lines.
> 'Should' is to bread like in datasheets: should = must!
>

Exactly. Except that most tools I've used in the past can't make that
distinction, and sometimes I really want my cases to be 1 line :)
Not sure if there is such a case in Nut/OS code, but still there could be.

Kind Regards,
    Thiago A. Correa



More information about the En-Nut-Discussion mailing list