If you've ever tried to learn to code from a book, you know how boring it can be. Why not try some engaging options to make learning more fun?

Each of these websites has its own distinctive style, but they all have elements of games built into them. They're quirky and fun, and they'll keep you coming back to learn more.

Code Combat

If you're looking to learn JavaScript and you don't have much — or any — coding experience, give this free game a try. Take control of a wizard and his minions. Level up from simple concepts like pre-programmed and conditional behaviors to more advanced spells like calculations.

codecombat

The learning environment is a cute fantasy RPG with knights, ogres, and mages. Move your minions, target your enemies, launch attacks, and destroy the servants of darkness!

Code Combat launched in 2013, so levels are still limited. But the team behind Code Combat will be developing like mad to get more tutorials and games up, so expect more from this site in the future. They've even opened it up and made everything open-source so that Artisan Wizards (users) can write their own levels.

codecombat-levels

A bonus feature of Code Combat: if you can pass the Gridmancer level, they'll help you get a programming job in San Francisco!

Code Wars

Though you don't get to wear a wizard hat at Code Wars, you can level up by gaining points for completing kata, or coding challenges. You can complete kata in Ruby, JavaScript, or Coffeescript. A kata is available in different languages, so you can get a good understanding of how the different languages handle the same tasks. Plans to add other languages, including Python, Java, PHP, and Objective-C, are in the works.

codewars

The martial-arts- / samurai-themed leveling system is fun and compelling -- each time you complete a kata, you gain honor points. Gather enough points to level up to the next rank, unlocking more difficult programming challenges. You can also gain honor points by writing your own kata, leaving comments on others' kata, and by referring your friends to Code Wars.

The challenges are useful and fun, and Code Wars is the only site listed that also teaches you to test your own code. But there's little in the way of instructions, so prepare to do a lot of Googling to solve the problems. Although it can be a slow process, this is a great way to learn what coding is really like.

codewars-editor

It's not as goofy as Code Combat, but support for more languages and a less childish should appeal beginners. Code Wars also has a strong community, which helps beginners get up and running. And leveling up and gaining prestige are motivating rewards on their own!

Code School

Unlike the previous two sites, Code School is not free. And at $290 per year ($29 /month), it feels like a bank buster. But the Code School team has created a website so engaging and useful that it's worth the investment if you're serious about learning to code. With a subscription, you can take as many courses as you want and switch between them at any time. They also offer a free two-day "Hall Pass" that gives you 48 hours to try out everything here for free.

codeschool-courses

With Ruby, Javascript, HTML/CSS, and iOS development courses, you have a wide range of options for learning. Try the electives for things like Chrome DevTools, Google Drive API, and Git.

Of the three sites discussed here, Code School has the least "gamey" feel. Each lesson consists of a short video lesson followed by challenges; each challenge that you complete earns you points, and asking for hints reduces the point value of the question.

codeschool

Code School points don't do much at the moment. In the past, when you completed a course, you would get a $5 voucher that could be used at the Code School store, but that program has been scrapped. Hopefully we'll see something similar in the future! But for now, you can collect points and badges and show them off to your friends. That is certainly worth something.

Which one should you choose?

So here are three fun ways to learn programming — which one should you try first? I recommend choosing a programming language and the website based on your experience level and what you want to program. For example, if you want to develop online apps, you should go with JavaScript. If you have little or no programming experience, sign up for Code Combat. If you know some of the basics, take a shot at Code Wars. If you want to develop iPhone apps or Ruby on Rails apps, Code School is the way to go.

If you have no idea what you want to do or where to start, I'd recommend Code Combat. It's the friendliest and simplest of the three, and it'll give you a good introduction to the basic concepts behind all programming languages. If you decide that you really like it, you can move on from there.

Code School, while very useful, requires some knowledge before getting started. If you don't know the difference between a function and an array, you might want to start with something a bit simpler.

Leveling Up

Once you've got your feet wet with these programming sites, you're ready to graduate to more challenging tasks, like creating your first app. Beyond this point, you're limited only by your imagination!

Secure some web hosting space for your web app, or write a program to help you with your daily tasks. Get yourself a Raspberry Pi or Arduino and try your new skills. Don't forget, we have a Raspberry Pi guide and an Arduino guide for the first glimpse.

Have you used any games or fun sites to learn programming? What's your favorite way to learn to code?

Image Credit: Javascript by Dmitry Baranovskiy via Flickr