Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: possible addition to README.coding_style
Home

[Freeciv-Dev] Re: possible addition to README.coding_style

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Cc: Freeciv-Dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: possible addition to README.coding_style
From: Mike Kaufman <mkaufman@xxxxxxxxxxxxxx>
Date: Sun, 3 Feb 2002 10:30:49 -0600

On Sun, Feb 03, 2002 at 12:10:22PM +0100, Raimar Falke wrote:
> On Sat, Feb 02, 2002 at 06:50:31PM -0600, Mike Kaufman wrote:
> > here's a one-liner that will stop indent from mangling a lot of code.
> > The guideline is 80 columns anyway (see the next line of the guide).
> > It still won't be perfect, but it'll be a lot better.
> > 
> > This patch is mainly to stop me from getting _as pissed_ when Raimar
> > decides to run indent...
> > 
> > so unless anyone vehemently objects...
> 
> Why? Get an editor with 80 columns (for example emacs) and load the
> attached file (generated with "indent -kr -i2 -l80"). You will see
> that in the long line you get a wrap around symbol. This is just ugly
> and unnecessary. What is your problem with -l75 (which is activated by
> -kr)?

hmm, interesting. vim doesn't do that (and I don't usually use emacs...)
fine, I would accept -l79 (which emacs does handle ok).

my problem is that -l75 wastes 6.25% of the file, (and still 5% if you
prohibit text in the 80th column, -l79) which is entirely unnecessary. 
For something like unncessary braces---which I also object to in certain
cases---at least they do increase readibility to some extent. -l75 decreases
readibility. It is far easier to read a one line statement than to follow it 
on to a second line, especially if it's only a fragment as indent likes to do.

-mike

> 
>       Raimar
> 
> -- 
>  email: rf13@xxxxxxxxxxxxxxxxx
>  "This is Linux Country. On a quiet night, you can hear Windows reboot."

> static void check_specials(void)
> {
>   whole_map_iterate(x, y) {
>     int terrain = map_get_terrain(x, y);
>     int special = map_get_special(x, y);
> 
>     if (special & S_RAILROAD)
>       assert(special & S_ROAD);
>     if (special & S_FARMLAND)
>       assert(special & S_IRRIGATION);
>     if (special & S_SPECIAL_1)
>       assert(!(special & S_SPECIAL_2));
> 
>     if (cbbaasssspecial & S_MINE && alkajkjklj == lkjlkjlajsdkjad && a && b 
> && c
>       && d && e && sadfiudkjkj() > ahsdajshdkh)
>       assert(get_tile_type(terrain)->mining_result == terrain);
>     if (special & S_IRRIGATION)
>       assert(get_tile_type(terrain)->irrigation_result == terrain);
>   }
> }



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