Re: Reverse comma operator?
- From: Vladimir Jovic <vladaspams@xxxxxxxxx>
- Date: Tue, 11 Aug 2009 17:14:48 +0200
Lew Pitcher wrote:
On August 11, 2009 10:16, in comp.lang.c, Victor Bazarov
(v.Abazarov@xxxxxxxxxxxx) wrote:
Tom St Denis wrote:[..]Isn't this a contradiction? If you write it properly the first time (so
The "time" you save by not typing a few characters you lose in having
to maintain/debug/review/document. It's better to write it properly
the first time then have to revisit it.
[..]
there is no need "to revisit it"), would you actually not *really* be
concerned with maintenance? I mean, revisiting *is* maintenance.
I am picking this as an example of the difficult decisions software
engineers and programmers face almost every day. Do you write a perfect
function that needs no improvement whatsoever (and then it doesn't
really need any code comments, sensible variable naming, etc.), or do
you write the function in such a way that anybody who comes in will
understand what it does and how and why, even though nobody is supposed
to (since it works)?
You write the function so that anyone who reads the code will understand the
function's purpose, operation, and limits.
In my experience, no source code remains static. New or changed requirements
(even when they don't explicitly affect the code in question) will often
have an impact on how code is (re)written. The "perfect function" (now) may
need alteration in order to fit the requirements of the revised
application.
And then, there's debugging. /I/ prefer readable code, where the author has
taken the time to document his (or her) logic. This way, I can follow the
code as I debug. And, it makes logic errors that much easier to spot.
Few smart things from the internet :
1) Programs must be written for people to read, and only incidentally for machines to execute.
2) Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
What OP suggested is simple obfuscation
.
- Prev by Date: Re: vfork() error
- Next by Date: Re: Reverse comma operator?
- Previous by thread: Re: Reverse comma operator?
- Next by thread: Re: Reverse comma operator?
- Index(es):
Relevant Pages
|