For C Programmers
Results 1 to 8 of 8

Thread: For C Programmers

  1. #1
    Fastest Thing Alive s0nIc's Avatar
    Join Date
    Sep 2001
    Location
    Sydney
    Posts
    1,584

    For C Programmers

    The Ten Commandments for C Programmers

    I Thou shalt run lint frequently and study its pronouncements with care,
    for verily its perception and judgment oft exceed thine.

    II Thou shalt not follow the NULL pointer, for chaos and madness await
    thee at its end.

    III Thou shalt cast all function arguments to the expected type if they are
    not of that type already, even when thou art convinced that this is
    unnecessary, lest they take cruel vengeance upon thee when thou least
    expect it.

    IV If thy header files fail to declare the return types of thy library
    functions, thou shalt declare them thyself with the most meticulous
    care, lest grievous harm befall thy program.

    V Thou shalt check the array bounds of all strings (indeed, all arrays),
    for surely where thou typest ``foo'' someone someday shall type
    ``supercalifragilisticexpialidocious''.

    VI If a function be advertised to return an error code in the event of
    difficulties, thou shalt check for that code, yea, even though the
    checks triple the size of thy code and produce aches in thy typing
    fingers, for if thou thinkest ``it cannot happen to me'', the gods
    shall surely punish thee for thy arrogance.

    VII Thou shalt study thy libraries and strive not to re-invent them without
    cause, that thy code may be short and readable and thy days pleasant
    and productive.

    VIII Thou shalt make thy program's purpose and structure clear to thy
    fellow man by using the One True Brace Style, even if thou likest it
    not, for thy creativity is better used in solving problems than in
    creating beautiful new impediments to understanding.

    IX Thy external identifiers shall be unique in the first six characters,
    though this harsh discipline be irksome and the years of its necessity
    stretch before thee seemingly without end, lest thou tear thy hair out
    and go mad on that fateful day when thou desirest to make thy program
    run on an old system.

    X Thou shalt foreswear, renounce, and abjure the vile heresy which
    claimeth that ``All the world's a VAX'', and have no commerce with
    the benighted heathens who cling to this barbarous belief, that the
    days of thy program may be long even though the days of thy current
    machine be short.

  2. #2
    Member
    Join Date
    Apr 2002
    Posts
    72
    ha ha good stuff.

    VII Thou shalt study thy libraries and strive not to re-invent them without
    cause, that thy code may be short and readable and thy days pleasant
    and productive.
    Hmmm, code should be both short and readable, I can only seem to acheive one of those most of the time so I normally I go for the short option. (Half the time I can't understand my own code five minutes after writing it )
    live life, don\'t just endure it

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Location
    Ireland
    Posts
    735
    Ha! I wonder what the Seven Deadly Sins are...

  4. #4
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Location
    Beverwijk Netherlands
    Posts
    2,534
    lol good one...

    about them 7 sins... I'd bet someone here (with a little more time on his hands then me) could come up with them.

    thx
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

  5. #5
    Senior Member
    Join Date
    Oct 2001
    Posts
    346
    Well, I'll give it a shot...

    1. Releasing buggy code.
    2. Ignoring warnings because "it seems to work fine."
    3. Failure to fully test your program.
    4. Not saving constantly.
    5. Not keeping hard copy.
    6. Not leaving room for expansion.
    7. Fast tracking any program for Christmas.

    Not the best, but I don't care... I figure if this was followed, software would be a lot better.

    SSJVegeta-Sei


    Pierce me with steel, rend me with claw and fang; as I die, a legend is born for another generation to follow.
    An\' it harm none, do as ye will. - Wiccan Rede

  6. #6
    Senior Member
    Join Date
    Nov 2001
    Location
    Ireland
    Posts
    735
    Ignoring warnings because "it seems to work fine."
    Amen to that!

  7. #7
    Junior Member
    Join Date
    Jan 2002
    Posts
    1
    Good one
    knowledge is power!!!

  8. #8
    Senior Member
    Join Date
    Aug 2001
    Posts
    110
    Thou shalt not disobey The Ten Commandments.
    Listen closely to your enemies. They tell you your faults.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •