Working as a programmer in Sweden

Sweden Software

This blog ranks quite high on searches related to software in Sweden (gee, I wonder why 🙂 ) so I sometimes get email from people who’s interested in moving to Sweden to work as a programmer.

I just replied to such an email and thought that the answer might be interesting for others to read as well, so here you go.

Great to hear about your moving plans. Even though the weather here right now makes you dream of warmer places, Sweden is a great place for a career in tech.

The job market for programmers is really good at the moment – at least in the Stockholm area. I’m not so sure about the rest of the country but Gothenburg seems to be doing fine as well. The Malmö/Lund area is still suffering from layoffs at the larger companies in the area (Sony Ericsson, Astra Zeneca, Ericsson) but there is a thriving mobile business growing there. They also benefit from having Copenhagen so close. Danish salaries are higher so Swedish programmers are a bargain in Denmark.

In Stockholm there are lots of headquarters, naturally, which means quite a lot of Big Systems written in Java or .Net. This is also where most of the marketing departments are located which means quite a lot of work for web agencies, CMS vendors etc.

In southern Sweden (Malmö/Lund) as I mentioned there is a strong mobile culture with Sony Ericsson at the epicenter. Lots of smaller spinoffs but also competitors or partners that’s establishing in the area. Sony Ericsson is almost always looking for embedded C-programmers with Android development growing a lot lately.

When it comes to the spoken language that varies a lot. The bigger international companies like Ericsson I’d say it’s no problem to speak English. The same goes for smaller firms like web or mobile agencies or startups. Most people in Sweden knows English. It can, however, be a problem once you leave the tech sphere. I currently work for a consultancy business in Stockholm and Swedish is a must for some of our clients. We have clients in the insurance, finance and retail business and they’re not as international as for example the telecom business.

I will probably write more about this subject in the future. Sweden needs more good software developers so please come here! 🙂


nginx and WordPress permalinks in subfolder

I’m playing around with nginx, a light weight http server. One of the first things I tried was to get PHP and WordPress up and running on an Ubuntu 10.4 machine. To do that I followed the following instructions.

First I had to get PHP working so I followed these instructions for PHP-fpm.

The next thing is MySQL and connecting with PHP. This “just worked” after installing php5-mysql.

Finally WordPress which also worked fine – except for permalinks which in the default installation relies on Apache .htaccess redirects. After doing this things sort of worked, but I’m running WordPress in a subfolder (http://localhost/wordpress) so I had to modify the redirect to look like this:

location / {
  root /var/www;
  index index.html index.htm index.php;
  if (!-e $request_filename) {
    rewrite ^.*$ /wordpress/index.php last;

…and now it works with any permalink structures.


Gotcha with jsTree

If you get the javascript error:

“$.vakata.context.cnt.delegate is not a function”

when using jsTree and jQuery you need to upgrade your jQuery to the latest version. I had 1.3.2 and got the error, upgraded to 1.4.2 and it works fine.


Picking a programming language based on personality

There are many ways to pick what programming language to use in a project or which one to learn and dedicate ones career to. Most programmers are naturally techie people who loves to argue for hours about the merits of certain syntax of a particular language or programming style.

But I think that’s the wrong way of approaching the question. Instead you should ask the more fundamental question: where do I want to work for the rest of my life?

They don’t tell you this in school, but there’s a certain organizational personality connected to each language. For example:

  • C++. Very techie, if you want to work in the engineering department in a large industrial company, pick C++. Also the language of choice for most games.
  • Java EE. Software architects love Java EE. It is used mostly in the financial world, banks, insurance companies, large web sites usually use Java. If you enjoy writing PTS reports and working in a cubicle, pick Java. Expect to spend a lot of time going through huge log files with debug exception print-outs.
  • C. Also very techie and close to hardware. There are usually wires and expensive prototype equipment involved when you program C. Expect to spend a lot of time chasing memory leaks or optimizing code to fit in to a finger nail.
  • PHP. Rapid development of web sites, pretty common amongst web hackers, startups and PR agencyes building WordPress sites for customers who wants to “get in to social media”. Usually a fun and relaxing atmosphere – or total chaos depending on your point of view. Many PHP programmers are self-taught – and that shows.
  • Ruby. This is the smarter sibling of PHP. Common in startup environments or web agencys.
  • Scala. Java EE refreshed. You can probably get away with using Scala in a Java organization, making your life in the cubicle a little less miserable but don’t count on it showing up in a job ad – yet.
  • Java SE / Java ME / Android Java. A completely different beast than Java EE. Java SE on the desktop is hardly used anymore but Java on mobile phones is of course a growing opportunity. Java ME is a dying breed of Java and most of the development is done in India or Eastern Europe. Android Java will be huge the coming years and the kind of organization that will want Android developers is wide and varied.

These are just a few programming languages but I hope my point goes through: every language has a certain personality and a certain type of organization that uses the language. You have to pick a language that fits your own personality. I am myself a Java developer who started out as a C++ developer but now coming to realize that I actually like the more fast paced world of PHP and Android development better.

It’s not a matter of the powers of the languages themselves but how they are used and who uses them and what kind of projects will you be doing with the language. Just try to keep that in mind if you’re thinking about becoming a programmer.

I should also add that you definitely should learn more than one language for precisely the same reason: to learn different ways of thinking and widen your perspective.

Update: as always, good discussion on Hacker News.

Linus G Thiel points out that Javascript is up and coming. I agree.


How to build a web service in 8 hours

I was a big fan of Jaiku (here I am) and didn’t “get” Twitter until about a year ago when a friend showed me Tweetdeck. Aha! So that’s how you’re supposed to use it! Not through the web page but by using a third party tool. I got so excited that I proclaimed Twitter the future of the web.

And I stopped using Jaiku.

One thing I did miss from the Jaiku-days, though, was the long discussion threads under each “jaik” (the Jaiku version of a “tweet”). Here’s an example. This provided Jaiku with depth, something you can hardly accuse Twitter of.

So an idea emerged: what if you could build a web service that made it possible to comment and discuss each tweet just like you did in the Jaiku-days.

Thus, Discuss a Tweet was born.

Or, well, at least the domain was registered. I did this April 17 2009. It then ended up in my pile of great-ideas-I-should-one-day-implement and nothing happened.

Until… last weekend.

I knew that it would be possible to put it all together quite fast. I had used Disqus when we built Rate My Pitch during 24 hour business camp – so I knew that the commenting system, the most difficult part, I would get for “free”. I wouldn’t even need a database. It was all about putting things together in a slightly new way. A classic mashup.

So, I started hacking away. A couple of hours later, the result is a mashup of the following services:

This is just a tiny little hack but I think it serves as a good example of how modern web development is done. You pick bits and pieces from all over the web, some open source components, some embedded web services. You put things together and something new emerges.

I used PHP and this is also worth noting. People complain about PHP but one of its biggest strengths is its user base and size. When you’re doing a mashup such as Discuss a Tweet you can be sure someone else has done about the same things you need and there is code out there ready to be used. You can’t say that about Scala or Erlang regardless of how powerful and beautiful the languages are. (Things are changing of course as the popularity of the language grows.)

Another thing happened while Discuss-a-Tweet was in my idea-pool: Google Buzz launched. According to Mr Jaiku himself, Jyri Engeström, Buzz is the continuation of Jaiku. And, yes, it allows you to comment and discuss tweets.

Maybe a usage pattern is emerging in how we use different social networks. Twitter for quick news updates and cool links, Facebook for our friends and Buzz for the discussions. Maybe the Opportunity Cloud for a service such as Discuss-a-Tweet is dispersing. We’ll see. It was fun building it anyway – and it only took a few hours after all. 🙂

(PS. Follow me on Twitter.)


Mobile Development SDKs compared: MoSync, PhoneGap and AppWhirl

Ever since I started my first consultancy business back in 1998, I’ve been thinking “next year will be the Year Of Mobile”.

I’ve been wrong every year.

Of course the sales of mobile phones have been great but in terms of mobile applications and the mobile web, things were more or less stuck in black & white text mode. But, the last couple or years, things have finally started to change – and change fast!

So, it is a very good time to get in to mobile development. This is like the early days of the web all over again. Opportunities are plenty! Before you know it, every company will want a mobile application to accompany their social web site. If you don’t know mobile yet, now is the time to start learning.

The obvious first question is: where do I start?

There are many mobile development tools out there. This blog post is a little deeper look in to three different approaches that will give you an app running in less than an hour.

By far the simplest approach is taken by tools such as AppWhirl. This is an online tool that generates a complete application for you. Not only that, it sends the app to the Apple App Store for approval. That’s right, AppWhirl is only for iPhone.

It is also extremely limited in that you can only generate apps from existing RSS feeds, making it less of an application toolkit and more of a mobile RSS reader-generator. Nothing wrong with that, you just need to be aware of the limitations.

AppWhirl is:

  • Extremely simple to use – anyone can generate an application with this tool.
  • Extremely limited – this is not an application SDK but a very simple way to publish your RSS feed as an application.
  • Only supports iPhone.

PhoneGap is far more advanced. This is how they describe themselves:

PhoneGap is a development tool that allows web developers to take advantage of the core features in the iPhone, Android, BlackBerry, and Symbian with a unified JavaScript API.

Now, while PhoneGap is a cross platform tool, the development process and setup is slightly different for the different platforms. You need to install all the different SDKs to fully use this tool. This can be quite a hassle.

What is PhoneGap? It’s basically a bridge that enables Javascript to call native functionality not normally accessible to a web page running in a browser. It does this by packaging the PhoneGap framework, your HTML/CSS/JavaScript-files and a magic JavaScript-file called “phonegap.js” in an application package. It then uses the built in browser component to render the “pages” of the app.

This means if you’re used to web development you will be up and running quickly on PhoneGap. It also means you can use nice frameworks such as JQuery for that AJAX mojo.

Unfortunately the documentation wasn’t exactly up to date so I had some problems getting things up and running on my Android Developer Phone. If this is the same on the other platforms, you’re in for a couple of hours of tweaking settings and installing SDKs and googling around for fixes if you want your app running on more than one platform.

To summarize, PhoneGap is:

  • Cross platform, works on many devices – but will require setup for each.
  • Web developer friendly. People familiar with HTML and JavaScript will feel right at home.
  • Capable but still limited by browser. With the upcoming HTML5 PhoneGap will become really interesting, though!

Next in line is MoSync. (First a disclaimer: I have worked for the company behind MoSync.) The platform recently became open source and received an investment from none other than the MySQL founders, Michael “Monty” Widenius and David Axmark. Like MySQL, MoSync is based in Stockholm.

You don’t need to install any other SDK than the MoSync IDE to get started. Programming is done in C++ which means you will feel at most at home if you’re coming from the embedded or gaming world. In fact, MoSync can run legacy games like Castle Wolfenstein just fine:

(That’s me speaking in the background, by the way.)

So far, MoSync is Windows only (although the IDE is based on Eclipse) so Mac- and Linux-users are out of luck. Supported platforms include Symbian S60, Java ME, Moblin and Windows Mobile. Android, iPhone and Maemo are “coming soon”.

MoSync is cross platform but obviously you won’t get more features than the underlying platform supports. Best support you’ll get for basic graphics, sound, simple Bluetooth access and networking. Without a doubt the best feature of all is the promise of one codebase, multiple platforms, but your mileage may vary.

MoSync is:

  • Cross platform, works on many devices – Android and iPhone “coming soon”.
  • C++ based, suitable for porting old embedded apps to native but a little higher barrier to cross for the beginner (but C++ isn’t that difficult).
  • Still a bit untested, MoSync needs a few more success stories that proves their claims.
  • One codebase, one tool!

All in all, three completely different approaches to mobile development. Which one suits you? Well, that’s for you to decide. They all have their strengths and drawbacks and I think it will be quite obvious for you which one fits your bill.

Now, get out there and create great stuff for mobile!

Updated: MoSync just announced Android support.

Updated 2: David Wood wrote an overview of some other cross platform tools.


Flash Lite to Java Midlet in 10 seconds

I am currently helping Sony Ericsson as a community manager for their developer site. As part of this I’m blogging over at and just recently I wrote a short post on how to convert swf to jar for mobile phones.
In case you didn’t know, Sony Ericsson has a framework embedded in most of their newer phones called Project Capuchin, making it possible to run a Flash Lite application inside a Java midlet. Quite cool, actually.


Firefox 3.5: huge step forward

This article sums up all the new features in Firefox 3.5. An amazing list! HTML5, local data storage, vastly improved font support, location aware browsing and a bunch of new CSS-features are some of the highlight features.
Adding it together sums up to a new web platform unlike anything we’ve seen before. The step forward is so big there will be web services written exclusively for Firefox 3.5. With a growing market share there’s certainly a user base big enough for developers to go Firefox-only.
The web vill look vastly different in about a years time thanks to Firefox 3.5. Exciting times! Download a beta here.


How to become a good programmer

The blog CodeLathe offers some advice. This is true, and in line with the subtitle of this blog:

Programming is purely a mental activity and has no relationship to any physical activity including typing. To become a better programmer, you will need to exercise and build up the part of the brain that deals with managing complexity and dealing with the relationships between countless objects.

Learn to manage complexities. That’s the core of programming. Add human communication to that and you have software engineering.


SEO-friendly titles in WordPress with Atahualpa theme and Headspace plugin

The Atahualpa theme for WordPress is a really powerful theme with lots of settings. But it doesn’t give you full control over the titles of posts and pages the way the Headspace plugin does.
How the titles of your blog posts look like is important for search engine optimization. If you want your post to be higher ranked in the search result (and who doesn’t?) the title is one of the most important factors to consider.
The Atahualpa theme and the Headspace plugin doesn’t work together without a minor modification to one of the helper php-files in Atahualpa. Look in the functions directory of the theme for the file called bfa_meta_tags.php. Open it in an editor and look for the line that says:

<title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>

Change it to:

<title><?php wp_title(''); ?></title>

Now you can enable the Headspace plugin and go to Settings -> Headspace and define exactly how your titles should be generated.