June 26th, 2009

Pocket Programming: Learning New Skills Anywhere

Summer is here, and in a few days I’m off on holiday. Aside from the eating, drinking, sleeping, sight-seeing and reading: it may be a good chance to hone my problem solving and Python skills.

I’ll be travelling light, taking in the east coast of Spain. So, any coding has to be done in the most portable/light-weight fashion.

Joel's Pocket Programming Kit

Here is my pocket sized kit list for an ultra-portable programming environment:

This list is weighted towards to those of you with Symbian phones, but most smart phones have some sort of access to a programming language.

The one of the most appealing aspects of this kit: it is super cheap. The phone was “free” on a 1 year £25 p/m contract, the O’Reilly Book is about £6, pen and notebook another three quid: that’s a cheap way to learn some valuable skills.

I’m sure there are a ton of alternative setups (Android, Windows Mobile, Palm, I-Phone?). A bare minimum set of requirements could be: a text editor and a web browser capable of parsing JavaScript (this may be possible on not so “smart phones”).

If you’re using an alternative setup, or have another way to program on the move, please add it to the comments.

June 23rd, 2009

Which Language Combination?

I’m trying to be a better programmer. I have been writing and learning as much code as I can, the benefits are a threefold positive feedback loop:

  • Learning is, in itself, very pleasurable (it makes you feel clever, which is nice)
  • New knowledge transfers to, and enhances, existing skills
  • New tools and skills provide a greater resource for providing solutions

But, how does a developer know which skills to learn and which languages are best to learn with? (Assuming that you’re learning for fun rather than as a work requirement.)

If Google is a good bench mark (assuming that they can take their pick of the best developers), one requirement (taken from an ad for a Software Engineer) asks for:

Fluency in two or more of C, C++, Java, Shell, PHP, Perl or Python.

If you are specifically aiming for a career at Google then making sure you are fluent in two major languages is probably the way to go, and there is certainly no downside to a developer broadening their skill set. In my experience, each foray into new languages has improved my PHP, and in turn, I feel pretty comfortable in Ruby and Python.

When deciding to learn something new: you could argue that PHP, Ruby, Python, Perl etc… are pretty much different brands of the same tool (procedural, interpreted languages). It’s great to have the option to use each, but these languages are not necessarily complimentary. It is unlikely that you would write a system with a combination of PHP, Python and Ruby. But, it is conceivable that you could have a project requiring C, PHP and Erlang skills.

Rather than learning interchangable skills, complementary languages might offer the opportunity to become a more rounded developer:

  • Interpreted, procedural (PHP, Ruby, Python, JS)
  • Compiled, procedural (C/C++, Java)
  • Functional, concurrent (Erlang, Scala, F#)

Assuming that side stepping between similar languages is easier than picking up a completely new concept: it would seem learning these varied skills opens up more possibilities.

Sometimes I worry that by learning a particular, none mainstream, language (like Erlang) I could be backing the “wrong horse”. However, bearing in mind my earlier ramblings, there’s little downside to picking up a new way of doing things, for example Elang may not prove popular, but the functional approach will give me a head start learning F# or Scala.

This slide from Painless Payment Processing by Erik Stenman points out other benefits of learning more “unusual” languages:

Nice paradox:

The lack of Erlang programmers makes it easier for us to find great programmers.

  • There are many great C and Java programmers, I’m sure, but they are hidden by hordes of mediocre programmers.
  • Programmers who know a functional programming language are often passionate about programming.
  • Passionate programmers makes Great Programmers

Or am I talking nonsense?

June 11th, 2009

What I’ve been reading/learning this week

I’ve been too busy this week to form a proper blog post, so instead I thought I’d mention some good content I’ve consumed.

Functions + Messages + Concurrency = Erlang : Joe Armstrong

This talk from Joe Armstrong (author of Programming Erlang) gives a really clear breakdown of the reasons concurrent languages (like Erlang) are becoming more important as processors gain more cores. The following quite gives good flavour:

Due to hardware changes:

  • Each year your sequential programs will go slower
  • Each year your concurrent programs will go faster

Although Joe focuses on Erlang, this applies to all languages tackling concurrency (Scala, F# etc…), thoroughly recommended to developers wanting to know more.

McMafia, Seriously Organised Crime : Misha Glenny

This book has nothing to do with programming (directly), and it may appear at first glance to be some sort of “aren’t gangsters cool” book for macho teenagers. Far from it.

Misha Glenny has been a BBC correspondent covering eastern Europe’s wars, politics and then crime (if you’ve ever heard or read his reports and articles you’ll know he’s a very clued up chap). This interest lead him to investigate organised crime around the world. The resulting book is unbelievable (in the literal sense), it reveals how deeply organised crime is intertwined with our day-to-day lives.

The entire book is fascinating, and highlights they way organised crime can eventually gain so much power it becomes a part of the establishment and has influence over global politics (not just as an issue but as an instigator). It literally effects the lives of everyone on the planet.

Perhaps one of the areas that gets the least coverage is “digital crime”. This is not due to it’s insignificance, quite the reverse. It is huge and vastly profitable, the problem seems to be that researching it is almost impossible. Police forces simply don’t have the funding and resources to gain enough understanding of the way the cyber criminals operate. It’s a subject I’d love to know more about, and one that I’m sure will become more and more important over the coming years.

I can’t recomend it highly enough.

Code Complete 2 : Steve McConnell

People have been banging on about this book for ages, so I caved in and started reading it (especially as I found it in the work bookshelf, saving me 30 quid).

I’m only 1/3 in but it already lives up to the hype. Clear, humorous and very well written. One misconception I had was that it is a straight manual to writing code. In many ways it is, but it goes much further into the thinking processes developers use. It highlights familiar problems and explains the solutions in a way that “just works”.

Basically, if you heard about it and thought it might be worth a read: it is. Read it sooner rather than later, two chapters in I felt like I understood my trade better and that I was on the right track.

June 3rd, 2009

Goodbye Browsers: What Next?

It has been mooted fairly often: that the web may be breaking free from the browser, and I’m enclined to agree. So what does this mean to developers and how will this effect the web development process (and my first Erlang Web App)?

I’m currently upgrading a site that will need dynamic elements and interactivety intertwined with flat HTML files in a standard directory structure. During the technical design process it is also becomming apparent that these dynamic features will need to be distributed over various media and platforms.

None of these are unusual requirements and I’ve been developing similar projects for a number of years. However, my approach is beggining to change. Previously I would have built the whole system with my PHP framework of choice (CakePHP) and used it’s inbuilt Views to publish the content in various formats (e.g. HTML and RSS), I’m now rethinking.

Our content needs to spread onto the ever widening array of platforms and media, so our publishing methods need to become more flexible. The solution I’m favouring is to publish content over some sort of web service or API and have the client platform, what ever it may be, interpret (and possibly redistribute) it. The RDF Standard is one format that is gaining popularity, especially as semantic technologies become more mainstream.

These principals are probably further advanced in the realm of Web Applications: it is becoming common place to produce an API allowing other platforms to interact with them. Turning the app into a platform (via an API) allows other’s to build on top in turn engraining it into their business model (For example Good Baad relies on 5 or 6 different APIs). Google have been providing useful APIs for years and the results are plain to see.

It seem likely to me that the development process may change as a result. Currently an web app or content is built first as a website and then expanded into and API or feed. It seems more practical to build the API first and then this can be adapted to other platforms.

For example: I moved my blog consumption to Google Reader, now I rarely see the sites that the content originates from; I interact with blogs entirely via their RSS feed over the platform of my choosing. With web applications it seems like the same is becoming true, very few people interact with Twitter directly, but prefer to interact via the API (3rd party apps is one key to their phenomenal growth). And, if concepts like Ubiquity take hold: the web may break free of the browser entirely.

And this brings me around to my Erlang project: I’m still mulling over ideas, but it seems to me that a real-time app that is purely an API would be a very good first project. Also, Erlang seems very well suited to the Web API building task, e.g: from a data distribution view point Couch DB is pretty much all you need.

Over the next few weeks I’ll build a simple Erlang app that interacts with the web over an API, it’s possible I won’t need to worry about building a client at all.

Powered by Wordpress using the theme aav1