Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

knowing your audience

by doom (Deacon)
on May 09, 2007 at 08:05 UTC ( #614318=note: print w/replies, xml ) Need Help??


in reply to Re^2: Programming *is* much more than "just writing code".
in thread Programming *is* much more than "just writing code".

There is simply no way for me to predict what gaps there will be in the knowledge of any programmer that will see my code. Or what they will find difficult to understand. Or what idioms they will eshew as 'too complex'. I do not know who they will be, or what their experience levels will be. Or how many of them there will be. Or what their personal coding preferences, prejudices or blind spots will be.

Well yeah. And there's no way for you to be able to predict whether the folks here on perlmonks can understand these sentences you wrote, and even after trading remarks back and forth on the subject several times, you may still have some doubts about whether we can follow what you're saying here, and difficulties like this arise in every single aspect of communication right on down to choices of appropriate subroutine names... and yet we all must muddle through, as best we can.

You may be someone who can read code better if it has no comments: don't assume everyone is like that.

(Would you like some help writing a comment-stripper script?)

Replies are listed 'Best First'.
Re: knowing your audience
by BrowserUk (Pope) on May 09, 2007 at 08:45 UTC
    You may be someone who can read code better if it has no comments: don't assume everyone is like that.

    The point is, that comments lie; code cannot.

    (Would you like some help writing a comment-stripper script?)

    No. I have an editor macro that handles that just fine thanks :)


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      No. The point is, that comments CAN lie. But they usually don't.

      By the same token code CAN lie -- either through complexity resulting in misinterpretation, or by function names that don't do what they say (such as a routine named die_with_errors that actually only warns). But code usually doesn't lie.

      BrowserUK:
      The first thing I do in most every piece of other peoples code I pick up is to throw away the comments (in a copy!). The second is to manually reformat the code to my personal preferences. The third is to 'fix' any obvious verbosities, by recoding them to use (my preferred) idiomatic constructs and discard any extraneous (used once intermediary) variables.

      You're a contractor aren't you. You've broken the hippocratic oath of programming - you know - the one that says "First do no harm." At the places I work, which have been with teams of 5 to 20 perl programmers of various abilities and coding styles, that sort of attitude doesn't fly. At the very least it inflicts your choice of programming style on everybody else - even if your choice of programming style is the best. At slightly worse level it removes comments that other programmers may have been using for visual cues - even if you don't use them. Getting worse it kills CVS annotation which is actually a valuable thing to have when tracking changes. And potentially the worst is that you have refactored all of the code that was probably working just fine - now rather than testing just the broken bug, you have to test for all of the other errors that you may have introduced. Good thing you have a test suite, but sometimes you don't.

      Patient: Blurp! (breathe) (wake)
      Doctor: Oh - good morning glad to see you're waking up.
      Doctor: How do you feel?
      Patient: gack!
      Doctor: Well, you're good to go now. We took care of your appendix.
      Doctor: Oh and while we were in we lipo-suctioned your abdomen, removed your gall bladder, performed a bypass, refactored your nose, placed skin grafts over your tattoes, and shrunk your stomach.
      Patient: But it was just my appendix.
      Doctor: Don't worry. I figure you're 30 pounds lighter. Your much more refactored and simple now.
      Patient: But it was just my appendix. (gasp)
      Doctor: Oh - and we removed one of your kidneys.
      Nurse: Doctor - he only had one kidney.
      Patient: (die)


      my @a=qw(random brilliant braindead); print $a[rand(@a)];

        Did you see

        (in a copy!).
        ?

        Because everything you are trying to say and imply is voided by that.

        I modify a copy. This is my way of becoming thoroughly familiar with the code I am going to work on.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://614318]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2020-10-27 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (258 votes). Check out past polls.

    Notices?