Complete.Org: Mailing Lists: Archives: freeciv-dev: June 1999:
Re: [Freeciv-Dev] cranky mode mail
Home

Re: [Freeciv-Dev] cranky mode mail

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Cc: deepone@xxxxxxxxxx, Freeciv List <freeciv-dev@xxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] cranky mode mail
From: Manuel Gutierrez Algaba <irmina@xxxxxx>
Date: Sun, 6 Jun 1999 17:04:43 +0000 (GMT)
Reply-to: Manuel Gutierrez Algaba <irmina@xxxxxx>

On Wed, 2 Jun 1999, David Pfitzner wrote:

> Daniel Sjolie wrote:

> > And why can noone indent decently???
> > Use a tab to indent!!!
> > And what about the if (0) stuff?
> > And a switch consruct with one case in it???
> > And don't write numbers in the code!!!
> > Use constants! With long and descriptive names...
> > And a main() with more than 300 lines is not right...
> > Ever heard of functions?
> 
> Amen!  Preach it, brother!!  :-) :-)
> 
> Ever since I became involved in maintaining freeciv I've been
> intending to improve some of these things, but have not had 
> the time to do much.  
> 

I couldn't resist .... Recently I discovered the awk utility...
This utility is a kind of lexical analyser that can perform certain
actions depending on the lexems ( regexp) it finds.

With awk, and gnu indent... both problems could be eliminated.
Is there any interest in doing so? to what extent ? Even, you
could associate constants to numbers in an automatic way,...
just imagine this:

file file_a:

void foo( footype_a fa, foo_type_b fb ) {
 code_c
 code_d

 if ( constant_e == 23.7 ) {
  code_e 
 }
 code_f
}

you could generate  something like this:

constants_on_the_fly_file:
...
#define file_a_foo_Comparison_1 23.7
...

or even
#define file_a_foo_Comparison_1_constant_e 23.7

Is there any guidelines or interest in handling freeciv code in
such a way.

PS: I'd use python instead but,... awk is enough powerful and 
any Unix system have it.

The process would be 100 % automatic.

Regards/Saludos
Manolo



[Prev in Thread] Current Thread [Next in Thread]