Re: Reverse comma operator?



Lew Pitcher wrote:
On August 11, 2009 10:16, in comp.lang.c, Victor Bazarov
(v.Abazarov@xxxxxxxxxxxx) wrote:

Tom St Denis wrote:
[..]
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.
[..]
Isn't this a contradiction? If you write it properly the first time (so
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
.



Relevant Pages

  • "no symbols have been loaded for this document"
    ... I´m trying to debug a Outlook Add in made with C#. ... I run the first time i did ... and i could do debugging. ... I add more features and i want to debug the add on again, ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: gridview paging oddity
    ... Typically, when you encounter something not working on the first click, but ... In debugging, it runs thru the code just like it should ... without error the first time thru and loads the page as planned. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: gridview paging oddity
    ... "JohnE" wrote: ... In debugging, it runs thru the code just like it should ... without error the first time thru and loads the page as planned. ... shows false when hovering over it. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Disc lock up on 8.0-STABLE
    ... I am not sure that ym debug kernel will help now - assuming this is the ... Was yoour system a fresh install, or an upgrade from ... the first time it happened was about 10-14 days ago, ... I had to enter reboot like 30 times before the box rebooted. ...
    (freebsd-stable)
  • debug builds needing VS DLLs
    ... I've been working with Visual Studio for quite some time, ... today I ran into something surprising for the first time. ... I compiled a small command-line executable in Debug mode and sent it ...
    (microsoft.public.vc.ide_general)