From: Charlie Gibbs on
In article
<6a111124-d238-4221-a9c7-2136e3575502(a)h16g2000prf.googlegroups.com>,
spinoza1111(a)yahoo.com (spinoza1111) writes:

> On Apr 23, 8:08�am, "Jennifer Usher" <jennisu...(a)gmail.com> wrote:
>
>> Yes, but most supervisors who expect lots of comments also have no
>> sense of humor.

<snip>

> Yes, such creativity is not wanted. Yet more errors are made by the
> dullards.
>
> Many older programmers would simply include a dedicatory quote
> somewhere in the program. The practice is preserved in many computer
> books which quote literature or rock lyrics.

Not quite rock lyrics, but in one particularly nasty piece of code
I inserted a quote from the cover of the Mothers of Invention album
_Absolutely_Free_: "This tree is ugly and it wants to die."

--
/~\ cgibbs(a)kltpzyxm.invalid (Charlie Gibbs)
\ / I'm really at ac.dekanfrus if you read it the right way.
X Top-posted messages will probably be ignored. See RFC1855.
/ \ HTML will DEFINITELY be ignored. Join the ASCII ribbon campaign!

From: Kenneth Brody on
On 4/22/2010 8:08 PM, Jennifer Usher wrote:
>
>
> "spinoza1111" <spinoza1111(a)yahoo.com> wrote in message
> news:4f0aac38-8622-4a1f-aca7-298654644d0c(a)k36g2000prb.googlegroups.com...
>
>> Nothing wrong with this style of commenting in assembler, at all. And,
>> this code sample looks like the one byte per instruction language
>> Mouse.
>>
>> Sure, programmers without verbal skills hate commenting, for obvious
>> reasons. They are unable to come up with witty and amusing comments.
>> But don't make a new edict for those of us who can write.
[...]
>> ...five minutes including the poem...
>
> Yes, but most supervisors who expect lots of comments also have no sense
> of humor. I once wrote some code for use by a couple of programmers who
> had claimed what I did could not be done. I wrote the comments in the
> form of a fairy tale. They were not amused, as it was pretty
> condescending, but it did make it very clear how to implement what I had
> created. And the comments were almost as fun to write as the code.

Just be careful to not be _too_ condescending. Look what happened to
Galileo after publishing "Dialogo Sopra I Due Massimi Sistemi del Mondo".

--
Kenneth Brody
From: Kenneth Brody on
On 4/23/2010 9:37 AM, spinoza1111 wrote:
[...]
> Many older programmers would simply include a dedicatory quote
> somewhere in the program. The practice is preserved in many computer
> books which quote literature or rock lyrics. But to my knowledge, very
> few programmers write actual poetry. And even fewer people have the
> attention span to read it.

There was a young coder named Seebs
Who took a vacation to Thebes
While coding in C
Answered a question (or three)
And now is stuck working for plebes.

--
Kenneth Brody
From: spinoza1111 on
On Apr 24, 12:12 am, Kenneth Brody <kenbr...(a)spamcop.net> wrote:
> On 4/23/2010 9:37 AM,spinoza1111wrote:
> [...]
>
> > Many older programmers would simply include a dedicatory quote
> > somewhere in the program. The practice is preserved in many computer
> > books which quote literature or rock lyrics. But to my knowledge, very
> > few programmers write actual poetry. And even fewer people have the
> > attention span to read it.
>
> There was a young coder named Seebs
> Who took a vacation to Thebes
> While coding in C
> Answered a question (or three)
> And now is stuck working for plebes.

There is an old coder named Heathfield
Who ranted, who screamed and who squealed
About the C standard
But it was SO hard
To see any sense in Richard Heathfield

But what about Edward Nilges?
The name's a feminine rhyme
Not with being but with nothingness
Which is existential, this time.

A student from the Indian Institute of Technology
Asked about yacc on comp.lang.c
The answers made him chortle
Since they were so very orful
Mostly "you're in the wrong group it's comp.sys.blarg you should
see!"

From: Nick Keighley on
On 24 Apr, 07:39, spinoza1111 <spinoza1...(a)yahoo.com> wrote:
> On Mar 21, 2:17 am, Seebs <usenet-nos...(a)seebs.net> wrote:

<snip>

> > [...] I also program in a couple of languages, including C.
>
> >http://github.com/wrpseudo/pseudo
>
> This is the Coding Horror with [...]
> the unnecessary and unstructured use of switch which
> made it appear that you needed to handle ack and nak but did not. I'm
> afraid it is unprofessional work.
>
> switch (msg->type) {
>         case PSEUDO_MSG_PING:
>                 msg->result = RESULT_SUCCEED;
>                 if (opt_l)
>                         pdb_log_msg(SEVERITY_INFO, msg, program, tag, NULL);
>                 return 0;
>                 break;
>         case PSEUDO_MSG_OP:
>                 return pseudo_op(msg, program, tag);
>                 break;
>         case PSEUDO_MSG_ACK:            /* FALLTHROUGH */
>         case PSEUDO_MSG_NAK:            /* FALLTHROUGH */
>         default:
>                 pdb_log_msg(SEVERITY_WARN, msg, program, tag, "invalid message");
>                 return 1;
>         }

I'm pretty sure the original code was mine. It's made up code to
illustrate that C doesn't have any other way to use the same code to
process multiple items. Except duplicating the code which I regard as
an even greater sin. This idiom makes it plain that ACKs and NAKs
haven't simply been forgotten.

It's a pretty common idiom where I work.

> It has been cleaned up since I looked at it last, perhaps owing to my
> comments earlier this year. Now it's more obvious that you mean to say
> that ACK and NAK are invalid. However, it's still unstructured
> fallthrough and it makes a professional and knowledgeable programmer
> wonder if you're missing some code for ACK and NAK.

hence the comment... Though the idiom is so widespread I don't think
it's really necessary.

>
>         switch (msg->op) {
>         case OP_FCHOWN:         /* FALLTHROUGH */
>         case OP_FCHMOD:         /* FALLTHROUGH */
>         case OP_FSTAT:
>                 prefer_ino = 1;
>                 pseudo_debug(2, "%s %llu [%s]: ", pseudo_op_name(msg->op),
>                         (unsigned long long) msg->ino,
>                         msg->pathlen ? msg->path : "no path");
>                 break;
>         default:
>                 pseudo_debug(2, "%s %s [%llu]: ", pseudo_op_name(msg->op),
>                         msg->pathlen ? msg->path : "no path",
>                         (unsigned long long) msg->ino);
>                 break;
>         }
>
> Here's the same somewhat cleaned up practice, but here you should have
> defined the assignment of prefer_ino, the pseudo_debug and the break
> as a macro. Better yet you should have used an OR statement.

could you illustrate the use of an OR statement with an example?

<snip>