Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #9211 > unrolled thread

Got a chuckle and wanted to share.

Started byScott Johnson <noonehome@chalupasworld.com>
First post2013-04-27 13:51 -0700
Last post2013-04-29 06:37 -0700
Articles 8 — 6 participants

Back to article view | Back to comp.lang.php


Contents

  Got a chuckle and wanted to share. Scott Johnson <noonehome@chalupasworld.com> - 2013-04-27 13:51 -0700
    Re: Got a chuckle and wanted to share. The Natural Philosopher <tnp@invalid.invalid> - 2013-04-27 22:06 +0100
    Re: Got a chuckle and wanted to share. Arno Welzel <usenet@arnowelzel.de> - 2013-04-28 22:36 +0200
      Re: Got a chuckle and wanted to share. Scott Johnson <noonehome@chalupasworld.com> - 2013-04-28 16:03 -0700
        Re: Got a chuckle and wanted to share. Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-04-29 02:42 +0000
          Re: Got a chuckle and wanted to share. The Natural Philosopher <tnp@invalid.invalid> - 2013-04-29 04:45 +0100
            Re: Got a chuckle and wanted to share. Tim Streater <timstreater@greenbee.net> - 2013-04-29 09:29 +0100
            Re: Got a chuckle and wanted to share. Richard Yates <richard@yatesguitar.com> - 2013-04-29 06:37 -0700

#9211 — Got a chuckle and wanted to share.

FromScott Johnson <noonehome@chalupasworld.com>
Date2013-04-27 13:51 -0700
SubjectGot a chuckle and wanted to share.
Message-ID<klhdig$n9r$1@dont-email.me>
I was brushing up on some debugging techniques and ran across a page 
with this quote that made me chuckle.

"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." - Brian W. Kernighan

[toc] | [next] | [standalone]


#9212

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-04-27 22:06 +0100
Message-ID<klhek3$4l6$1@news.albasani.net>
In reply to#9211
On 27/04/13 21:51, Scott Johnson wrote:
> I was brushing up on some debugging techniques and ran across a page 
> with this quote that made me chuckle.
>
> "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." - Brian W. Kernighan
>
that makes a LOT of sense to me..

After revisting code I had written months before I thanked heaven I had 
written it for any damned fool to debug, cos frankly I couldn't 
understand or remember how on earth I came to write it in the first place!



All I can say is that working under extreme pressure I was on some sort 
of coding planet...

-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.

[toc] | [prev] | [next] | [standalone]


#9215

FromArno Welzel <usenet@arnowelzel.de>
Date2013-04-28 22:36 +0200
Message-ID<517D8833.8010506@arnowelzel.de>
In reply to#9211
Scott Johnson, 2013-04-27 22:51:

> I was brushing up on some debugging techniques and ran across a page 
> with this quote that made me chuckle.
> 
> "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." - Brian W. Kernighan

That's why peer programming and code review exists ;-) In our team code
*always* get's reviewed by someone else before it will make it to the
final production stage.


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de

[toc] | [prev] | [next] | [standalone]


#9217

FromScott Johnson <noonehome@chalupasworld.com>
Date2013-04-28 16:03 -0700
Message-ID<klk9mf$ce8$1@dont-email.me>
In reply to#9215
On 4/28/2013 1:36 PM, Arno Welzel wrote:
> Scott Johnson, 2013-04-27 22:51:
>
>> I was brushing up on some debugging techniques and ran across a page
>> with this quote that made me chuckle.
>>
>> "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." - Brian W. Kernighan
>
> That's why peer programming and code review exists ;-) In our team code
> *always* get's reviewed by someone else before it will make it to the
> final production stage.
>
>

Yeah but when you are the team, that is all out the door.

I understand what NP is saying though.  I have revisited code I wrote 
years ago.  I know I must of been in 'the zone', because some of the 
algorithms (some) where just short of brilliant and trying to figure out 
what I was thinking without comments (kind of wipes out the brilliant 
part I know), was like an outer body experience.

:)
Scotty

[toc] | [prev] | [next] | [standalone]


#9218

FromDoug Miller <doug_at_milmac_dot_com@example.com>
Date2013-04-29 02:42 +0000
Message-ID<XnsA1B0E7690B85Ddougmilmaccom@78.46.70.116>
In reply to#9217
Scott Johnson <noonehome@chalupasworld.com> wrote in news:klk9mf$ce8$1@dont-
email.me:

> 
> I understand what NP is saying though.  I have revisited code I wrote 
> years ago.  I know I must of been in 'the zone', because some of the 
> algorithms (some) where just short of brilliant and trying to figure out 
> what I was thinking without comments (kind of wipes out the brilliant 
> part I know), was like an outer body experience.

And that is why I *always* comment code whose purpose is not immediately obvious: self-
defense. Even with a large applications group, you still wind up maintaining a lot of your own 
code, maybe years later: "Hey, who wrote this module? Doug did? OK, Doug, you get to do 
this enhancement." Never mind the fact that Doug is now the sysadmin, and hasn't worked in 
apps development for five years... Naah, that'd never happen... Would it?

[toc] | [prev] | [next] | [standalone]


#9219

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-04-29 04:45 +0100
Message-ID<klkqc4$c8g$1@news.albasani.net>
In reply to#9218
On 29/04/13 03:42, Doug Miller wrote:
> Scott Johnson <noonehome@chalupasworld.com> wrote in news:klk9mf$ce8$1@dont-
> email.me:
>
>> I understand what NP is saying though.  I have revisited code I wrote
>> years ago.  I know I must of been in 'the zone', because some of the
>> algorithms (some) where just short of brilliant and trying to figure out
>> what I was thinking without comments (kind of wipes out the brilliant
>> part I know), was like an outer body experience.
> And that is why I *always* comment code whose purpose is not immediately obvious: self-
> defense. Even with a large applications group, you still wind up maintaining a lot of your own
> code, maybe years later: "Hey, who wrote this module? Doug did? OK, Doug, you get to do
> this enhancement." Never mind the fact that Doug is now the sysadmin, and hasn't worked in
> apps development for five years... Naah, that'd never happen... Would it?
I think what happens with me anyway, is that after a while I have more 
or less the whole structure and design in my head, and coding is just a 
matter of writing the mental picture in the language. The temptations is 
to do that but IF the actual concept is flawed or its got lost in 
translation its  vile to debug without the comments.

Often I will write the pseudo code as a comment and see if the code 
actually corresponds..



-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.

[toc] | [prev] | [next] | [standalone]


#9220

FromTim Streater <timstreater@greenbee.net>
Date2013-04-29 09:29 +0100
Message-ID<timstreater-1223C5.09292529042013@news.individual.net>
In reply to#9219
In article <klkqc4$c8g$1@news.albasani.net>,
 The Natural Philosopher <tnp@invalid.invalid> wrote:

> On 29/04/13 03:42, Doug Miller wrote:
> > Scott Johnson <noonehome@chalupasworld.com> wrote in 
> > news:klk9mf$ce8$1@dont-
> > email.me:
> >
> >> I understand what NP is saying though.  I have revisited code I wrote
> >> years ago.  I know I must of been in 'the zone', because some of the
> >> algorithms (some) where just short of brilliant and trying to figure out
> >> what I was thinking without comments (kind of wipes out the brilliant
> >> part I know), was like an outer body experience.
> > And that is why I *always* comment code whose purpose is not immediately 
> > obvious: self-
> > defense. Even with a large applications group, you still wind up 
> > maintaining a lot of your own
> > code, maybe years later: "Hey, who wrote this module? Doug did? OK, Doug, 
> > you get to do
> > this enhancement." Never mind the fact that Doug is now the sysadmin, and 
> > hasn't worked in
> > apps development for five years... Naah, that'd never happen... Would it?
> I think what happens with me anyway, is that after a while I have more 
> or less the whole structure and design in my head, and coding is just a 
> matter of writing the mental picture in the language. The temptations is 
> to do that but IF the actual concept is flawed or its got lost in 
> translation its  vile to debug without the comments.
> 
> Often I will write the pseudo code as a comment and see if the code 
> actually corresponds..

How about internal documentation? I've already written 30 pages of that 
for my app.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#9221

FromRichard Yates <richard@yatesguitar.com>
Date2013-04-29 06:37 -0700
Message-ID<ggtsn8d4ik835bk36bgpojbt3ri688iesq@4ax.com>
In reply to#9219
On Mon, 29 Apr 2013 04:45:08 +0100, The Natural Philosopher
<tnp@invalid.invalid> wrote:

>On 29/04/13 03:42, Doug Miller wrote:
>> Scott Johnson <noonehome@chalupasworld.com> wrote in news:klk9mf$ce8$1@dont-
>> email.me:
>>
>>> I understand what NP is saying though.  I have revisited code I wrote
>>> years ago.  I know I must of been in 'the zone', because some of the
>>> algorithms (some) where just short of brilliant and trying to figure out
>>> what I was thinking without comments (kind of wipes out the brilliant
>>> part I know), was like an outer body experience.
>> And that is why I *always* comment code whose purpose is not immediately obvious: self-
>> defense. Even with a large applications group, you still wind up maintaining a lot of your own
>> code, maybe years later: "Hey, who wrote this module? Doug did? OK, Doug, you get to do
>> this enhancement." Never mind the fact that Doug is now the sysadmin, and hasn't worked in
>> apps development for five years... Naah, that'd never happen... Would it?
>I think what happens with me anyway, is that after a while I have more 
>or less the whole structure and design in my head, and coding is just a 
>matter of writing the mental picture in the language. The temptations is 
>to do that but IF the actual concept is flawed or its got lost in 
>translation its  vile to debug without the comments.
>
>Often I will write the pseudo code as a comment and see if the code 
>actually corresponds..

My best commented code happens when I start by writing a complete
outline of the module with each line starting with // and then write
the code between the comments. 

Doing that first exposes logic errors since I am thinking of the
overall flow without being bothered by little syntax details. It also
makes writing the code easier since the tasks are all broken down into
manageable and logical pieces. Then when it's done the code is already
commented as if by magic and i don't have to do that drudgery.

Of course, I don't always discipline myself to do it that way, but I
am always glad when I have done so. 

Richard Yates

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web