This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A bug in mark_constants () in varasm.c

Pal Engstad writes:
> > Linus Torvalds requires that all code in the source is using a tab
> > length of 8 spaces, and he also states that you are a bad programmer
> > if you write code with more than 3 indentation levels.

Linus has also said that the GNU coding standards should be burned.
Since gcc uses the GNU coding standards, it isn't going to make Linus
happy.  The gcc developers aren't going to reject the GNU coding
standards because Linus says so.

Per Bothner writes:
> I didn't know that Linus Torvalds has done research on programming styles.

In fairness to Linus, much of gcc is difficult to follow and to maintain
in part because many of the functions are too large (especially with the
#ifdefs mixed in).  Furthermore, since many of the algorithms turned on at
higher optimization levels cost O(n^2) or even O(n^3) in the size of the
function, gcc would bootstrap faster if these were cut down a bit.  And
egcs was supposed to be about the gcc developers learning from the success
of Linux, after all.

Just the same, it's unrealistic to implement many of the algorithms in
gcc with only three indentation levels, so it's just wrong to declare
that as a strict rule, and arrogant to say that those who violate it
are bad programmers.  Sometimes it appears that Linus's success and
fame has gone to his head a bit.

> > This has caused the code to be fairly easy to read and maintainance is
> > pretty straight forward.
> Irrelevant - a kernel is a lot simpler than an optimizing compiler,
> in terms of complexity of algorithms and data structures.

Well, let's say that there is some relevance (smaller functions make
for ease of understanding and maintainance), but nevertheless Per is
right: gcc is vastly more complicated than the Linux kernel.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]