Have yourself a merry little coding Christmas …

During my career as a software engineer, one of the true delights of the Christmas season was the week between Christmas and New Years.  Most pragmatic project planners recognize that at least in the US, development projects largely grind to a halt for this particular week (plus a day or two prior).  Even if a developer is in the office, there are not typically enough other team members around to be able to get anything substantial accomplished.

Screen Shot 2013-12-20 at 12.53.33 PMSooooooo, what to do with this gift of time?  I used to use this time to learn something new, typically a new programming language (yes, Virginia, there is a geek in that Santa outfit).  I’ve introduced myself to Java, C++, HTML, Javascript and Perl during these Christmas weeks.  I didn’t learn them well enough to commercially program with them, but I did learn them well enough to understand their strengths, weaknesses and possible applications for them.  Plus a few ended up in my toolbox with a little more work like Perl and C++.

All this came to mind when I stumbled across this article by Juliet Waters in last Sunday’s N.Y. Times: The Code of Life.  Juliet describes her journey with coding when she decided that her chosen profession as a book critic was rapidly becoming obsolete and she felt she needed to learn some new skills.  Though she didn’t become a professional programmer, the experience changed her outlook on her original profession and new profession as a features writer.   There are several free on-line methods for learning various computer programming languages, including Khan Academy.  Ms Waters used Codecademy.

That got me thinking.  I’ve been pondering about getting back into coding for fun and possible profit.  More importantly for readers of this blog, it occurs to me that learning to program a computer, even at an elementary level, can help individuals in a myriad ways, including to have a better understanding how the technical world works.  For me, learning to program helped me think more logically about how to decompose and solve problems.   That alone is invaluable.

As we enter 2014, here is my challenge to you.   Learn to code!   You don’t need to do it for a career to get some enjoyment from it.  For the past few days, I’ve been learning Python at Codecademy, which is a scripting language (as opposed to a compiled language like C++).  Its syntax is pretty elegant, yet its capability is powerful.   Python is heavily used in website development for filtering and manipulating data prior to delivery.  It’s also used automating system administration tasks (replacing Perl).  The lessons in Codecademy  are well designed and allow you to progress with the appropriate amount of hand holding.  The screen looks like this:

Screen Shot 2013-12-20 at 12.14.04 PM

Click for a larger view of the screen

The learning window is on the left, the code editor for entering your code is in the middle,with the console window on the right.  Also, when you run your code, they run a test program that will check the expected results before letting you move on.

If you decide to do try coding, a few tips:

  • It can be frustrating.  If you get frustrated, walk away and return in a little while.  This helps me tremendously as I usually find that what’s vexing me is a simple error which I’ll pick up when I return.
  • If you’re an experienced programmer, the early lessons can be frustratingly slow, but trust me they get more challenging as the lessons progress.
  • For the inexperienced programmer, the early lessons provide a fair amount of base programming concepts.  Take the time to learn them.
  • Get a buddy to learn at the same time.  It can very invaluable to have someone to look at your code to say “Idiot, you forgot the colon on line 5” 🙂
  • Use other resources on the Net.  I have a tab with python documentation on my browser so that I can consult with the documentation.
  • If you’re running MacOS or Linux, Python is likely in the distribution and you can take the lessons out of the site and experiment using the terminal.  Here’s an example from my Mac.  The right window has the script and the left is the script being run using “python < tmp.py” syntax:
Click for a larger image

Click for a larger image

If you decide to take coding lessons, let me know how its going.  Also, any tips you might have for others.

If you celebrate Christmas, have a wonderful Christmas holiday with your family and friends.  For all, enjoy the fruits of the season and I truly hope that we finally have Peace on Earth!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: