Re: Update info.c to use size_trun_len() & Co.



On Thu, Aug 30, 2001 at 01:06:26PM -0400, Pavel Roskin wrote:
> 
> Don't comment the code you are replacing and the bugs you are fixing -
> e.g. "1000 should do 1K, not 0K."

I was writing new patch this evening, and asked myself - what commenting 
policy we should use.

For ex. at my work in average we comment every 4 lines of code, so, very
detailed commenting. MC, in turn, practically not commented. I think, we 
should agree on amount of comments for future patches.

> Please use braces in "if" whenever your are writing more that one line
> after it, even if only one line is not a comment.

In general, it's better to use braces ALL the time, even for one line stat-
ments. Actually, some "smart" compilers complaining on the construnctions like:

    while(1)
	for(i=0; i < 10000; i++)
	    if(i == 500)
		break;

which is legal, but difficult to read and understand(well, example is bad, 
but you got the idea, right? :).
	
> Don't use "unsigned" - use "unsigned int".  I remember seeing a warning in
> some compiler about it.

I think, as we started once that movement into the glib direction, we should
continue with it. I've started to rewrite some small independent arts of MC
to use glib data types, functions, etc. I think, we should try to use as much
from this library, as possible. It'll make MC smaller, mor portable, less
buggy(I hope:).

So, I'd like your confirmation, that we are prefer constructions like:

    "gint" in opposit to "unsigned int"

and so on. At the moment we have very dangerous mix, so it's better to eliminate
it as much as possible.

Regards,
    Timur Bakeyev.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]