Principled Programming

Some time ago I stumbled upon this web site
http://www.developerdotstar.com/mag/articles/read_princprog.html

It is language agnostic and makes a lot of sense, but is challenging at the same time. I encourage everyone to read it. As a result, I always include the following comment at the start of each project (below the copyright and acknowledgements comments :-

! ---------------------------------------------------------------------------
! From www.developerdotstar.com:
!
! Principled Programming:
! =======================
!
! Personal Character
! ------------------
! Write your code so that it reflects, or rises above, the best parts of your
! personal character.
!
! Aesthetics
! ----------
! Strive for beauty and elegance in every aspect of your work.
!
! Clarity
! -------
! Value clarity equally with correctness. Utilize the proven techniques that
! will produce clarity in your code. Correctness will likely follow suit.
!
! Layout
! ------
! Use the visual layout of your code to communicate the structure of your code
! to human readers.
!
! Explicitness
! ------------
! Always favour the explicit over the implicit.
!
! Self-Documenting Code
! ---------------------
! The most reliable document of software is the code itself. In many cases,
! the code is the *only* documentation. Therefore, strive to make your code
! self-documenting, and where you can't, add comments.
!
! Comments
! --------
! Comment in full sentences in order to summarize and communicate intent.
!
! Assumptions
! -----------
! Take reasonable steps to test, document, and otherwise draw attention to the
! assumptions made in every module and routine.
!
! User Interaction
! ----------------
! Never make the user feel stupid.
!
! Going Back
! ----------
! The time to write good code is at the time you are writing it.
!
! Other People's Time and Money
! -----------------------------
! A true professional does not waste the time and money of other people by
! handing over software that is not reasonably free of obvious bugs; that has
! not undergone minimal unit testing; that does not meet the specifications and
! requirements; that is gold-plated with unnecessary features; or that looks
! like junk.
!
! Written by Daniel Read <[email protected]>
! Full version at http://www.developerdotstar.com/mag/articles/read_princprog.html
!
! -----------------------------------------------------------------------------

It serves as a reminder to do the right thing when writing code. Always assume your code is going to be read by hundreds of people on Github or somewhere similar.

2 Likes