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: Freeciv List <freeciv-dev@xxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] cranky mode mail
From: Daniel Sjolie <deepone@xxxxxxxxxx>
Date: Sun, 6 Jun 1999 17:39:59 +0200

On 1999-06-06 17:04:43, Manuel Gutierrez Algaba wrote:
> 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.

Nah...
I don't think we should let a script name constants...
I *really* want standard indent options though!!!
Come, on! I don't care what they are...
I just want to be able to write my code in my own
way and then use indendt to transform this to whatever
all You people that are not like me can read... :) 

> PS: I'd use python instead but,... awk is enough powerful and 
> any Unix system have it.
> 
Hehe...
Well, if a system doesn't have Perl I don't consider it unix... :)
I like python, but I just keep coming back to perl... :)

> The process would be 100 % automatic.

Like it should be... :)

I really liked that thing about making cvs do this on the fly...
That would really rock!

By the way:
I think a minor change to the packet handling in the client
would make client side AI feasible...

Is there a way to figure out the number of elements in a enum type?
I could add a PACKAGE_TYPE_LAST or something to mark the last entry
if it is not... I don't really need this but I think it would be best...

/Daniel

-- 
Now take a deep breath, smile and don't take life so seriously... :)

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