[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Simulavr-devel] Script to count tab spaces in source files
From: |
Petr Hluzín |
Subject: |
Re: [Simulavr-devel] Script to count tab spaces in source files |
Date: |
Thu, 5 Jan 2012 21:39:54 +0100 |
On 5 January 2012 17:50, ThomasK <address@hidden> wrote:
> Hi Petr,
>
>> Are you aware that spaces-vs-tabs issue is a holy war which has been
>> going on for decades and remains unsolved?
>> It is unlikely that anyone finds a solution people would like. Maybe
>> if the solution was implemented in an editor.
>
>
> Yes, I know it! :-) In the historical computer age ;-) it was necessary to
> use tab character, for example for some assembler programs. One one hand to
> hold it readable, on the other because of simple parsing algorythms. And it
> has saved space. In this time, where a computer main memory with 64 kbyte
> was a really good machine! :-) But not now in a time, where a Gbyte is the
> smallest counting unit. :-)
Readability and parsing were not affected. There are other, more
important reasons for tabs.
>
> And, as Klaus wrote, modern editors have the ability to use space characters
> instead of tab characters or able to transform it to spaces and back, if
> somebody want's this. ;-)
People do not want to change setting for each file individually or
worse - reformat the file (using editor). Therefore presence of the
feature is no excuse. Also it does not explain why spaces and not
tabs.
> Btw. @ Klaus: I agree with you in using spaces and
> editor functionality to have a good formating. But I know some people, which
> think about such agreement as a attack to theirs personal freedom!
Does Klaus want to send his mail to mailing list?
I think that people on Earth mostly agree to keep some coding style
and are willing to lose some freedom. However people on Earth do not
agree what coding style to use. Also they do not agree (to lesser
degree) on whether files/classes/functions are allowed to differ in
style if they are internally consistent.
>
>> What is SOFT-Tabs? Indenting using 4 spaces? (If yes, then it is
>> indentation using spaces, not soft-tabs.)
>
>
> Yes, but I think, that soft-tabs is a better and shorter ;-) description for
> that fact. Anyway, we can call it as we like, but should do it! :-)
The word "soft-tabs" is new and not used. In fact googling that leads
to a Viagra tablets page.
We are discussing that yet, we should not do it (yet).
>
>> I think it is lame to commit changes which only change whitespace.
>> Possible exception is to change few lines that are inconsistent with
>> lines immediately above and below.
>>
>> I try to avoid changing indentation while changing code. Sometimes I slip.
>
>
> :-) That's the holy tab war, I see! But to have a good formated source makes
> it more easy to understand it. Believe me, I have seen some horrible
> formatted source in my business.
I believe. But can you explain how do tabs lead to horrible formatting?
(Make sure to read the SmartTabs article I linked before, a person has
to use spaces if he wants align text within a line.)
Yes, I occasionally forget a tab in place where simulavr uses spaces,
because other projects I work on use tabs. Some people work on
projects using spaces and occasionally forget spaces where tabs are
used. Tie.
> And the task: there are some problems,
> solve it! My first task was: reformatting this source. (and this was a
> terrible work and the main work for this contract!) After this I was
> wondering, why this software was working! ;-)
The re-formating produced the change which causes
edification-conflicts you described earlier.
You could have re-formated using tabs using the same logic.
>
> And, for interest: we have about 9000 tabs in about 150 source files from
> about 320 source files total. Maybe some are necessary, but not all. :-)
Tabs are necessary in makefiles. No other file format specifies
indentation characters, therefore neither tabs or spaces are
necessary. The word "necessary" is inappropriate here.
--
Petr Hluzin