Published in Web Development on Wednesday, November 15th, 2006
A cool link for we programming types and a few notes about some future posts here on Fiftyfoureleven and a possible redesign.
I've recently finished a new iteration - version - of our CMS. It was a fun experience because I wrote it after returning from a two week vacation, which meant that I had some time to let ideas percolate in my head, and that I was quite motivated when I sat down to code.
One thing that I have done with this iteration was focus on setting some real constraints and using the DRY principle to my advantage whenever I could.
And here is that cool link I promised above. Found in amongst the interviews posted on Artima.com is Orthogonality and the DRY Principle, A Conversation with Andy Hunt and Dave Thomas (Andy Hunt and Dave Thomas are the Pragmatic Programmers). It is a short yet profound read, but as I coded I continually came back to this bit to keep myself on track:
DRY says that every piece of system knowledge should have one authoritative, unambiguous representation. Every piece of knowledge in the development of something should have a single representation. A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.
It's not that I wasn't using elements of DRY ideas in the past, but by combing thru my libraries actively looking at it with Orthogonality and DRY in my head, I was able to greatly reduce the amount of functions and lines of code that we use. One must keep these ideas strong in their head so as not to give in to the dark side :-)
I thought I would take a moment to mention two things:
Sitepoint's web devlopment books have helped me out on many occasions both for finding a quick solution to a problem but also to level out my knowlegde in weaker areas (JavaScript, I'm looking at you!). I am recommending the following titles from my bookshelf:
I started freelancing by diving in head first and getting on with it. Many years and a lot of experience later I was still able to take away some gems from this book, and there are plenty I wish I had thought of beforehand. If you are new to freelancing and have a lot of questions (or maybe don't know what questions to ask!) do yourself a favor and at least check out the sample chapters.
The author line-up for this book says it all. 7 excellent developers show you how to get your JavaScript coding up to speed with 7 chapters of great theory, code and examples. Metaprogramming with JavaScript (chapter 5 from Dan Webb) really helped me iron out some things I was missing about JavaScript. That said each chapter really helped me to develop my JavaScript skills beyond simple Ajax calls and html insertion with libs like JQuery.
Like the other books listed here, this provides a great reference for the PHP developer looking to have the right answers from the right people at their fingertips. I tend to pull this off the shelf when I need to delve into new territory and usually find a workable solution to keep development moving. This only needs to happen once and you recoup the price of the book in time saved from having to develop the solution or find the right pattern for getting the job done..
Comments and Feedback
The DRY Principle reminds me a bit of my first serious foray into databases. I had a great instructor who used to chant this:
Heeey Simon! Thanks for that, I'm sure that will be going thru my head all weekend :-)