Third Shelf

Programming pragmatically

Posted in books, dont-program-if, productivity, reviews by Sydney du Plooy on June 13, 2010

Don’t program if… you have not yet read The Pragmatic Programmer: From Journeyman to Master by Andy Hunt and David Thomas. I never understood what all the fuss was about and here I am making a fuss about it.

pragmatic 1540s, from M.Fr. pragmatique , from L. pragmaticus  ”skilled in business or law,” from Gk. pragmatikos  ”versed in business,” from pragma  (gen. pragmatos ) “civil business, deed, act,” from prassein  ”to do, act, perform.” (1)

Pragmatic programmer

So, what makes a pragmatic programmer? A pragmatic programmer is someone who exhibits certain attitudes and practices when thinking, writing, testing and deploying software. This includes being an early adopter or fast adapter, being inquisitive and thinking critically. It also means being realistic and being anything-ready. And to be anything -ready one must learn continuously.

One of the major philosophies is to always place the problem and the solution in a larger context. This means to always think beyond the immediate problem and see the bigger picture. Why? Simply, so that you can make informed decisions such as deciding where to comprise and where to apply the Pareto principle.

A pragmatic programmer takes responsibility for everything they do. They don’t just sit there and watch the code rot. A pragmatic programmer will always endeavor to keep the code pristine.

Instigating change is another important skill that a pragmatic programmer must learn to apply. People are naturally opposed to change and in order to be a pragmatic in a software project, it is sometimes necessary to break the “we have always done it like this” mentality.

Skills and Tools

Using the appropriate tools is one of the best ways to amplify your productivity. Try various tools and pick the ones that work for you. Then, learn them extremely well. Mold them to the shape of your hand. Consider the following categories of tools:

  • Source control
  • Text manipulation
  • Debugging

Another important tool is to be able to touch type. This is a worthwhile skill to learn, so be prepared to put in a lot of time.

Life as a pragmatic programmer

Being a pragmatic programmer does not make you write perfect programs. Accept it. Things will go wrong and when they do, we should ensure that the data always remain consistent. As the book says “dead programs tell no lies” and sometimes it is best to just simply kill it.

As long as there are people, software will change, continuously. That’s life. Pragmatic programmers guard themselves against the impact of these changes by observing the Law of Demeter (it’s not a dot counting exercise) and decoupling dependencies. Keep separate concepts separate.

Coding is not just a matter of transcribing requirements into source code. It is a continuous process of making decisions. Decisions that will either pave your way or cause you grief later on. The choice is yours. Think critically about every line of code and remember to refactor continuously. Test, test and test some more.

While building software, there are two important principles that a pragmatic programmer always observes. These are avoiding duplication at all costs and avoid splitting a piece of knowledge across multiple components. Failing to observe these two principles will invariably bring you headaches in the future as the source code spirals out of control.

This is the way of the pragmatic programmer.

By the way, there are loads of tips in the book that will not only benefit you now, but for as long you write code.

(1) Dictionary.com, “pragmatic,” in Online Etymology Dictionary. Source location: Douglas Harper, Historian. http://dictionary.reference.com/browse/pragmatic. Available: http://dictionary.reference.com. Accessed: June 13, 2010.

Kindle review

Posted in kindle, reviews by Sydney du Plooy on March 22, 2010

I finally took the plunge and purchased the Kindle 6″ Global Wireless edition from Amazon. I simply couldn’t wait for it to arrive. Something akin to a 7 year old getting his first bicycle. Finally, the day arrived!

Packaging

The packaging was so impressive it is almost worth its own blog post – the attention to detail was outstanding. For example, how much attention do you pay to bar codes? Well, Amazon didn’t slip on bar code detail. Have a closer look and you’ll see that little man sitting under the tree reading his book…

The next interesting part is the “Certified frustration-free packaging” seal. That seal lives up to the promise. Opening the box is done with a peel-off strip. What a neat way to open the box. Again, Amazon had the detail going – the opening strip read “Once upon a time…”. Mission accomplished: frustration-free packaging.

Cover

I decided to get the well-worth-it leather cover for the additional $31.99. At the bottom right there is a metal branding insert. Nice idea, although, I was a little disappointed with the top right hand corner as the leather wasn’t properly fitted around the plate. The stitching around the edges is very neat and the feel of the cover is luxurious.

Inside, it has a soft padded inner; front and back; that is essential to protect the screen from accidental bumps. Before I bought the cover, I was perplexed about how the device attaches to the cover. Maybe with elastic bands around each corner, I thought?! The website wasn’t too detailed about it and for the price of $31.99 I would expect it to be a decent cover with a proper attachment mechanism. And so it was. The attaching mechanism of the cover just simply blew me away. With only two ingenious hinges the cover and the device will have a hard time separating by itself. The bottom hinge slides into the device at an angle and the top hinge slides into the device. It has a spring action and releases when pulled downwards. So, the device attaches by sliding in the bottom hinge at an angle and secured by the top hinge. Ingenious.

Power adapter

Battery powered devices have this tendency to run down from time to time and needs to be charged every so often. Luckily the Kindle ships with more than one way to get this much needed charge. Firstly, there is charging by USB and secondly, charging by plugging into the mains. The latter is done with an American style two pin plug. Having ordered the global edition, it is a little unusual to find an American style plug in the packaging. With this in mind Amazon realized that this is not quite optimal and included another adapter that converts the American style to an European two pin style plug. Great, I live in South Africa where we have huge three pin plugs. Nothing that another adapter can’t fix. A downside is that the battery is not easily replaced, except by sending it in to Amazon. I suspect that this is by design. Annuity income?

The device

When taking the device out of the packaging, I was surprised that instructions were printed on the screen. How amazing to realize that E-Ink doesn’t consume any power to display static  text or images. As can be seen in the photo, a random image is rendered on the display every time it is switched off.

I was pleasantly surprised at the quality of the display. It renders fonts with a very nice smooth precise anti alias effect. The display can be read from almost any angle. The downside is that it doesn’t have a back light and I hope that it will make an appearance in future editions. Although I can easily justify it by saying “you can’t read a book in the dark, can you?”. Another little annoying thing with the display is the “clearing” effect when paging. With e-ink, the reader first has to black the current page, clear the page and then render the text or image. However, this process is fairly quick on the Kindle and one gets used to the effect quickly.

In South Africa I was also surprised to find the 3G connection worked first time round without any hassles and automatically registered the Kindle at Amazon when the first connection was established.It seems to be making use of the Vodacom network. Using the 3G connection is weighs down on the battery and I would recommend using it only when necessary.

The buttons are perfectly placed on the device – when you are not using the cover. Using the left-hand buttons with the cover on is not user friendly. It is rather silly that the previous page-button is only on the left. Not a problem if you use the device without the cover. The five-way scroll button is perhaps a little on the small side but quite functional. Don’t expect to use the keyboard like an ordinary one. The buttons are tiny. Why is there a keyboard on Kindle?

When reading a book on the Kindle, you’ll be surprised to know that it comes with a dictionary that is automatically invoked when you scroll to a word and hover. Brilliant. You can do manual searches in the dictionary, make annotations on pages. Setting a bookmark on a page makes a little dog-ear shape appear in the top right-hand corner.

Another surprise was the back of the device. It has a very neat brushed metal finish and makes it feel expensive. The serial number is printed at the bottom, in case you are wondering. Beside that the Kindle has built-in text-to-speech functionality which works brilliantly.

Loading your own PDF documents to the Kindle is a cinch. It mounts the same as a flash drive in Windows and books and PDF documents are copied to the documents folder. One thing that I found is that when plugging it into the USB port the device becomes “unusable” until you eject it from Windows. I have tried to eject it to get it usable while plugged in but with no success. Maybe it’s just me?

Being able to load PDF documents (from version 2.3) is great. Not being able to zoom them is not so great. I hope to see a zoom feature added to the PDF documents reader. The display can be rotated but the reader just doesn’t feel right being read in a rotated manner.

Shopping on the Kindle is great experience with custom layouts specially formatted for the Kindle. Beware that the quickest way to being broke is to enable the Buy now with 1-Click facility. It’s ease of use is addictive.

When reading a book the Kindle disappears once you get into the book. It’s a great reading device and at the price of $259 I strongly recommend it.

Tagged with: , ,

Personal Knowledge Management with a Wiki

Posted in books, gtd, management, productivity by Sydney du Plooy on April 7, 2009

In the excellent book Pragmatic Thinking and Learning: Refactor Your Wetware (Pragmatic Programmers) by Andy Hunt, he suggests that every programmer should have a personal wiki in order to manage knowledge effectively. A sort of exocortex. A place where you can keep ideas, thoughts and nearly anything you want outside your brain.

Ever received one of those emails that you just have to keep somewhere? That snippet of source code that might come in handy? That chocolate muffin recipe? Why not put all of it into your wiki?

My personal choice of this kind of wiki is TiddlyWiki. Simply because all of the content is in a single HTML file. Fan of Getting Things Done? TiddlyWiki can easily be configured to support the Getting Things Done methodology. Have a look at d-cubed for example.

Bear in mind that it has a learning curve to it, but if you are willing to stick to it you will surely reap the benefits.

Some of the features include:

  • Tagging
  • Searching
  • Text formatting, including support for monospace
  • Highlighting
  • Block quotes
  • Tables
  • Headers
  • Save with backups
  • RSS feeds

I would suggest the following plugins to really spice-up TiddlyWiki:

Check out TiddlyTools and TiddlyVault for other plugins. It supports themes, which can be downloaded from TiddlyThemes. There is also a great cheat sheat available.

Tagged with: , , ,