First, this is somewhere between a meditation and SoPW but I had to put it somewhere.

I got to thinking about programming aphorisms today. I thought it would be useful (and, just as important, fun) to compile a list of them. There's no prize except the egoboo. Here's my definition, so that we're all on the same page:

In order to be accepted for this challenge, your aphorism must:

It does NOT need to be original. If you have the attribution and want to offer it, that's great, but it isn't expected.

The Aphorisms

<voice="radio-announcer-reading-fine-print">I will periodically update this list to compile what people submit. I reserve the right to make grammar, spelling, and minor language-choice fixes. See below for the original source; if you don't find it, it's mine. I reserve the right to not add something for any reason including because I missed it or because I haven't been back to update the list lately. If you don't want your submission added to the list (and potentially tweaked), say so and I won't add it.</voice>

Replies are listed 'Best First'.
Re: Quest: Compiling aphorisms
by Joost (Canon) on Mar 16, 2005 at 17:30 UTC
Re: Quest: Compiling aphorisms
by ww (Archbishop) on Mar 16, 2005 at 19:13 UTC
    ...and further:
    Variables won't; constants aren't ~~-- Osborn's Law.
    Wethern's Law: Assumption is the mother of all screw-ups.
    When fixing a problem reported by a user, make sure the fix you think works also works for them. ~~-- William S. Annis.
    To the systems programmer, users and applications serve only to provide a test load.
    The trouble with computers is that they do what you tell them, not what you want. ~~-- D. Cohen.
    The only intuitive interface is the nipple. After that, it's all learned. ~~-- Bruce Ediger.
    Every program has at least one bug and can be shortened by at least one instruction - from which, by induction, one can deduce that every program can be reduced to one instruction which doesn't work.
    Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing. ~~-- Dick Brandon.
    Documentation isn't done until someone else understands it. William S. Annis
    Debugging is anticipated with distaste, performed with reluctance, and bragged about forever.
    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.
    The last bug is fixed when the last user retires the program
    I know I'm on the right track when by deleting something, I'm adding functionality. ~~--Carter's compass
    To err is human, to forgive, beyond the scope of the Operating System.
    A computer is like an Old Testament god, with a lot of rules and no mercy. ~~-- Joseph Campbell.
    A debugged program is one for which you have not yet found the conditions that make it fail. ~~-- Jerry Ogdin.
    Any given program will expand to fill available memory.
    A TRUE Klingon Warrior does not comment his code!
    Hofstadter's Law: ~~It always takes longer than you expect, even when you take Hofstadter's Law into account.
    If builders built buildings the way programmers write programs, then the first woodpecker that came along would destroy civilization. ~~-- Unknown.
    It is against the grain of modern education to teach children to program. What fun is there in making plans, acquiring discipline in organizing thoughts, devoting attention to detail, and learning to be self-critical? ~~-- Alan Perlis.
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. ~~-- Rich Cook.
    Strong data typing is for those with weak minds.
      A pre-condition for the William Annis quote above...

      Before fixing a problem reported by a user, make sure that the problem is in the code and not in the user's chair.

      PEBKAC errors are best debugged via Blunt Force Trauma.

      Jack

      Rick Cook, actually (not Rich). In his book "Wizard's Bane", I believe. Fun book, that. The series got rather silly, but it was still fun.
Re: Quest: Compiling aphorisms
by Jenda (Abbot) on Mar 17, 2005 at 00:57 UTC

    Just an assortment of quotes:

    • With enough eyeballs, all bugs are shallow.
          -- Linus Torvalds
    • Define "doesn't work". That phrase is the most unhelpful thing you can ever say about a piece of code. What does it do that you didn't expect, or what doesn't it do that you expected?.
          -- Jeff 'japhy' Pinyan
    • When the code and the comments disagree, both are probably wrong.
          -- Norman Schryer
    • Stuff is only hard when you dont know how to do it. It is one of the great ironies of life. It is always hard to apreciate your own knowledge, well because you know it.
          -- zigster
    • The only thing that overrides a regexes natural greediness is it's desire to achieve a match. If it can, it will, and it can, so it does:).
          -- BrowserUk
    • Says Chris2323: I am not a great fan of modules because I feel it is cheating when you are a beginner..

      Yeah, just like when you're first learning to build furniture, it's cheating to use a hammer. Everyone should spend some time pounding nails with their forehead for a while before they graduate to complicated stuff like hammers.
          -- Dominus
    • For every complex problem, there is always a simple solution - that is wrong.
          -- H.L. Mencken
    • Computer science is no more about computers than astronomy is about telescopes.
          -- Edsger W. Dijkstra
    • You said it didn't work, but you didn't say what it would have done if it *had* worked.
          -- Dominus
    • Now is the time in our program where you look at the manual..
          -- Dominus

    Jenda
    We'd like to help you learn to help yourself
    Look around you, all you see are sympathetic eyes
    Stroll around the grounds until you feel at home
       -- P. Simon in Mrs. Robinson

Re: Quest: Compiling aphorisms
by grinder (Bishop) on Mar 16, 2005 at 17:44 UTC

    Just because you can, doesn't mean you should.

    This is a nod to the concept that TIMTOWTDI is not always a good idea. Sometimes, a person asks a question on Perlmonks, and some people post the most ridiculous answers "because no-one else has yet done it this way". Sometimes, there are sound reasons why that is the case. (update: oops, I just realised I wasn't supposed to explain this. Oh well, I still think the meaning is obvious).

    In other words:

    Strive for clarity

      Actually i think those TIMTOWTDI posts are great. They remind me of the way children will play with words and vocabulary to the say things that adults understand but dont quite follow the rules. I think they represent part of the learning process of exploring the boundaries and interactions of the language and as such are part of the pathway to better programming. Realizing that there twenty ways to do something, of which 17 are fairly silly 2 are ok but cryptic and 1 is succinct, expressive and to the point requires knowing what all those ways are.

      I agree with you on clarity, but i think i would add elegance and succint. Ive seem code that is perfectly clear but totally annoying because of its oververboseness and poor structure.

      ---
      demerphq

Re: Quest: Compiling aphorisms
by jZed (Prior) on Mar 16, 2005 at 18:31 UTC
    Release Early and Often

    I was going to write more, but I'll save that for a later release of this post.

      Your wish is my command, sahib! I just added the section with the fine print about how I intended to compile the submissions. :>

      I also updated the list with the submissions to date.

Re: Quest: Compiling aphorisms
by hardburn (Abbot) on Mar 16, 2005 at 17:43 UTC

    Languages you don't know are hard

    Corollary: Failure to learn a language on your part does not imply suckage on the language's part

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Re: Quest: Compiling aphorisms
by kimanaw (Beadle) on Mar 17, 2005 at 05:44 UTC
    Don't recall where i first heard this, but it has haunted me for over 15 years:

    Object oriented programming is a lot like sex:

    • Everyone agrees its a great thing
    • Everyone thinks everyone else is doing it all the time.
    • In reality, very few are doing it that often
    • And, when they do it, at least one of the parties involved is less than satisfied with the results.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Quest: Compiling aphorisms
by jplindstrom (Monsignor) on Mar 16, 2005 at 20:00 UTC
      A better programmer also looks up :D

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

        "From beneath you, it devours."
Re: Quest: Compiling aphorisms
by Old_Gray_Bear (Bishop) on Mar 16, 2005 at 17:42 UTC

    Don't out clever-code yourself.

    ---
    I Go Back to Sleep, Now.

    OGB

      Writing node text in your signature produces apparently empty posts for some people.

        Is that a perlmonks aphorism? {grin}

        "Write your nodes in the node box so that people can see them."

        "Write your nodes in the node box or chromatic will pee on you."
Re: Quest: Compiling aphorisms
by blazar (Canon) on Mar 17, 2005 at 10:09 UTC
    • Have you ever stopped to consider that what is crashing your Perl is sitting between the keyboard and chair?
      Sherm Pendley in clpmisc, "Re: Perl IDE" (edited)
    • No one can ever predict all of the possible error conditions, of course; as soon as we write idiot-proof code, along comes a better idiot. But it's still worth making the attempt.
      Sherm Pendley in clpmisc (edited)
    • "a few lines of code" and "prevent it from being insecure" should not appear in the same sentence.
      Tad McClellan in clpmisc, "Re: free source for bbs"
    • It's also amazing how much use Larry's getting out of his colon. (The character, obviously).
      "The Perl 6 Summarizer".
    • And: Every book which has a title that promises you to learn something in x weeks, day or even hours is lying.
      Tore Aursand in clpmisc, "Re: wow...jackpot."
    • Nevertheless, any resemblance between the Perl design process and bouncing down stairs is entirely coincidental. (I hope.)
      Larry Wall in p6l
    • Larry's First Law of Language Redesign: Everyone wants the colon.
      Larry Wall, "Synopsis 1 draft 1"
    • My assertion that we can do better with computer languages is a persistent belief and fond hope, but you'll note I don't actually claim to be either rational or right. Except when it's convenient. :-)
      Larry Wall in p6l, "Re: Containers vs Objects."
    • Nope. I used to think RPN was completely unnatural. Then I started learning Japanese, and now I not so sure am. :-)
      Larry Wall in p6l.
    • Of course *most* users aren't going to do that. *Most* users aren't trying to hack your site! You don't program securely for *most* users - you program securely for the few users who *are* trying to be malevolent.
      Paul Lalli in clpmisc, "Re: free source authentication script"
    • He "steals". You "reuse". I "enhance the value of".
      "Alex" on comp.lang.perl.misc (slightly edited)
Re: Quest: Compiling aphorisms
by samizdat (Vicar) on Mar 16, 2005 at 17:56 UTC
    Write the least code that will solve the most peoples' problems.
Re: Quest: Compiling aphorisms
by Whitehawke (Pilgrim) on Mar 16, 2005 at 18:41 UTC

    I was going to add this one:

    Programming is like sex: it's fun and can create incredible things, but you need to use protection or you'll catch bugs.

    But I decided that was cute and maybe amusing, but not really all that deep.

      Whitehawke's contribution made me come up with this one:

      Programming is like sex. Sure, it may give some practical results, but that's not why we do it.

      (Based on a quote by Richard Feynman, where s/Programming/Physics/.)
Re: Quest: Compiling aphorisms
by ww (Archbishop) on Mar 16, 2005 at 18:35 UTC
    "The last bug is fixed when the last user retires the program."

      I've heard basically the same one, but with a twist. I'm not sure who to attribute it to, but I think it was one of the various "Klingon Programmer" lists around the web.

      The program isn't finished until the last user is dead.

      "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Re: Quest: Compiling aphorisms
by dragonchild (Archbishop) on Mar 16, 2005 at 17:46 UTC
    If you didn't write a test, you're taking it on faith that you fixed the bug.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Re: Quest: Compiling aphorisms
by Anonymous Monk on Mar 17, 2005 at 09:33 UTC
    • RTFM.
    • First rule of optimization: don't. Second rule of optimization: for experts only.
    • Patches welcome!
    • Go To Considered Harmful. -- E. W. Dijkstra (Well, to be pedantic, it was actually C. Hoare who came up with the title).
    • "... in constant time". -- D. Conway.
    • Beware, I've only proven the correctness of the program. -- D. E. Knuth.
    • Be nice. -- L. Wall.
    • You can't just make shit up and expect the computer to know what you mean, Retardo! -- M. J. Dominus.
    • Premature optimization is the root of all evil. -- D. E. Knuth?
    • What happened when you tried? -- c.l.p.m
Re: Quest: Compiling aphorisms
by jZed (Prior) on Mar 16, 2005 at 19:02 UTC
    chromatic can speak for himself, but I love his (from memory, may be wrong) "There's a name for software that can't be changed, it's called hardware."

      I also like "It's just software" along those lines.

      Another aphorism I've toyed with over the past week or two is something like Software that's difficult to maintain is a failure of your development process, not your maintainers nor your language. That's barely pithy though.

        Well, to match the cliché office sign: A failure on the developer's part does^H^H^H^H^should not constitute a crisis on the maintainer's part.
Re: Quest: Compiling aphorisms
by chas (Priest) on Mar 16, 2005 at 20:08 UTC
    Even though now a major cliche (perhaps why it wasn't mentioned), I still like:
    "It's not a bug, it's a feature."
    (Maybe a quasi-aphorism. Attributed to a large software vendor.)
    chas
      It's not a bug, it's a feature!
      I remember seeing an umpteenth Xerox generation of the Jargon Dictionary, which had an entry for "feecher" (as compared to "feature").

      I seem to have thrown that out at some point, thinking the online version had it all covered. But now I can only find one link :(

      Update: That link is no more, I found a PDF here, search for "feecher")

      [feecher, feechur]
      n. An unforeseen, arbitrary, or capricious attribute, which, once documented, is spelled feature (q.v.).

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

        I can't find that in the online Jargon file, but did find: "The "One-Question Geek Test". You say to someone "I saw a Volkswagen Beetle today with a vanity license plate that read FEATURE". If he/she laughs, he/she is a geek.
        (Not Perl, but aphorism related...)
Re: Quest: Compiling aphorisms
by g0n (Priest) on Mar 17, 2005 at 11:36 UTC
    It's not a bug unless it breaks the spec. No spec, no bugs.

    g0n, backpropagated monk
Re: Quest: Compiling aphorisms
by holli (Abbot) on Mar 16, 2005 at 19:56 UTC
    Being paranoid does not mean that nobody is after you.


    holli, /regexed monk/
Re: Quest: Compiling aphorisms
by nobull (Friar) on Mar 17, 2005 at 08:11 UTC
    Two of my favourite ones. I doubt they are original but I think I came up with them more-or-less independantly.
    • "Always write less code (unless this would be less readable)"
    • "If you are doing it three times you are probably doing it wrong"
Re: Quest: Compiling aphorisms
by husker (Chaplain) on Mar 17, 2005 at 15:40 UTC
    Calm down: in the end, it's all just ones and zeroes.

    If automobiles had advanced at the same pace software development has, today's cars would cost $1.98, get 1000 miles to the gallon, emit zero pollution, and occasionally explode for no reason, killing all the occupants.

    All bug-free programs are obsolete.

    Having a large data processing staff hovering around any computer is as profound a sign of overt design failure as is having several mechanics ride around with you in your car.

    It's all about the *data*.

    To iterate is human; to recurse, divine.

    Programs must provide correct results in spite of the best efforts of the user.

    Always solve the hardest part of the problem first. If you can't do that, the rest of the program is a waste of time.

    If you can't explain the operation of your program to managment, you are probably on the right track.

    Question: What are C, C++, and C#? Answer: They were grades.

      To reiterate is human; to recurse, divine.

      Because, obviously, humans may repeat themselves but never when cursing.

Re: Quest: Compiling aphorisms
by hsmyers (Canon) on Mar 17, 2005 at 02:05 UTC
    Programmer's Corollary to Occam's Razor --- Don't screw things up anymore than you have to, to make the code run.

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."
Re: Quest: Compiling aphorisms
by johndageek (Hermit) on Mar 17, 2005 at 17:30 UTC
    Ignorance is curable, Stupidity is forever

    Enjoy!
    Dageek

Re: Quest: Compiling aphorisms
by gregor42 (Parson) on Mar 18, 2005 at 14:18 UTC

    "Any fool can write code that a computer can understand. Good programmers write code that humans can understand."

    - Martin Fowler, Refactoring: Improving the Design of Existing Code



    Wait! This isn't a Parachute, this is a Backpack!
Re: Quest: Compiling aphorisms
by bageler (Hermit) on Mar 17, 2005 at 20:11 UTC
    Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make the additional features appear necessary.

    Simplicity of the language is not what matters, but simplicity of use.

    A language that doesn't affect the way you think about programming, is not worth knowing.

    The string is a stark data structure and everywhere it is passed there is much duplication of process. It is a perfect vehicle for hiding information.

    This page, is titled "Perlisisms": http://www.cs.yale.edu/homes/perlis-alan/quotes.html
Re: Quest: Compiling aphorisms
by husker (Chaplain) on Mar 18, 2005 at 16:19 UTC
    Just because a program was hard to write does not mean it should be hard to read.
Re: Quest: Compiling aphorisms
by BrowserUk (Patriarch) on Mar 17, 2005 at 09:54 UTC
    Brevity == Clarity.
Re: Quest: Compiling aphorisms
by dragonchild (Archbishop) on Mar 21, 2005 at 00:54 UTC
    While not programming related, I relearned this gem today while repainting my kids' room.

    A shortcut makes for a long journey.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Re: Quest: Compiling aphorisms
by troykoelling (Initiate) on Mar 17, 2005 at 21:07 UTC
    Can a Perl 'script' be a program? Scripts are what you give the actors, programs are what you give to the audience.
Re: Quest: Compiling aphorisms
by doom (Deacon) on Mar 20, 2005 at 06:33 UTC
    No programming doctrine is complete until it replicates global variables under some other name.
Re: Quest: Compiling aphorisms
by Anonymous Monk on Mar 19, 2005 at 19:20 UTC
    Eschew Surplusage.
      Is that sort of like "Never use a large word when a diminutive word will suffice"?