Re: [PATCH][CFT] IDE TCQ #3 for 2.5.8-pre3

From: Martin Dalecki (dalecki@evision-ventures.com)
Date: Fri Apr 12 2002 - 06:55:51 EST


Jens Axboe wrote:
> Hi,
>
> The third version is ready, lots of changes since last version.
>
> General IDE changes (not directly related to TCQ)
>
> - ata_request_t -> struct ata_request (was actually done before Martin
> posted his first merge, better conform to current ide style)

Well I don't do much things for no reasons. So please allow me to
write down my reasoning. My general coding style guidiance is the following:

1. First and for most: NO INVENTION FOR THE SAKE OF IT.

typedef on a struct is most of the time just adding syntactical shugar,
and *deleting* the information that we deal with a struct in case of it's
usage.

This is the kind of code obfuscation which I *hate* even more in C++ or Java.

Many programming language "designers" out there think that making data types
look opaque in usage is a nice thing and a sign of good taste/style. Trust me
they are misguided (read: *idiots*). It is taking valuable information
away (well actually hiding it elswere) for the person looking at the
functional code. I mean the preson looking at the fsck-ing procedural
code which actually *does something*...

2. typedefs for function signature capturing are fine, since there is no other
way to express them sanely.

This is what they where inventid for - just as back doors for things
which couldn't be expressed otherwise. But avoid them where possible,
due to the same reasons as above.

3. typedefs for variable integral entities, which serve a dedicated
puspose are fine, since they:

- Acutally add information to the code where they are used.

- Don't obfuscate the structure of the object in question if you follow rules
1. and 2.

- Allow for differentiation where there are portability issues. size_t is one
example of justified proper usage in this context.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 15 2002 - 22:00:20 EST