Some idle comments about Linus' e-mail response and Linux
Posted Mar 1, 2007 10:40 UTC (Thu) by
ekj (guest, #1524)
In reply to:
Some idle comments about Linus' e-mail response and Linux by pr1268
Parent article:
Re: [GIT PATCH] HID and USB HID update for 2.6.21-rc2
Taste is always going to be, to some degree, subjective.
I think the example in the post is a decent example of bad taste:
If you only include a header-file once, it doesn't make any difference if you declare some array there, or in a c-file, the compiler-generated code will be identical anyway.
However, it is *bad-taste* because that isn't what generally belongs in header-files, which makes the code harder to understand for non-insiders, and which increases the risk of errors. Also, it starts being stupid the moment someone else gets the idea of including that header-file, unaware that it contains stuff that header-files do not normally contain.
I'd classify as "bad-taste" programming that is not plainly wrong (as in buggy or as in wasteful), but which nevertheless;
- Make the code harder to read and/or understand. (illogical organization, poor breakup into function, ill-defined module-boundaries)
- Increases the chance of subsequent errors. (same as above, confusingly similar variable/function names, unnessecary and unexpected side-effects, lack of handling of corner-cases (even those you know can't *at-the-moment* occur)
- Is inconsistent. (*which* style is subjective -- once you picked one you should stick with it though.)
- Just plain looks bad. (the extreme example being unindented code)
(
Log in to post comments)