TankWar has online mode again: This time on Opera Unite

December 2, 2009 – 6:45 pm Tags: , ,

You may recall an earlier post about TankWar, my 100% JavaScript cannons-game. Back when I wrote it, I included online play, but the server went down with a hard disk failure.

Now, I have rewritten the online mode – this time that part is also all JavaScript – continue reading to find out what makes it tick.

Read the rest of this entry »

Dynamic precompiling of JavaScript functions for fun and profit

November 27, 2009 – 6:13 pm Tags:

Hey it’s Friday so it’s time to try a fun JavaScript hack – Let’s go and precompile some functions!

What does “precompiling” mean? In principle, it means we take a function which takes multiple parameters and pre-define some of them. All this is done dynamically, so your code can do it on the fly.

Let’s check out how this works and what benefits it has.

Read the rest of this entry »

Git tips for SVN users

November 19, 2009 – 7:27 pm Tags: ,

SVN is the version control system I’ve used the most, but lately I’ve been using Git more and more. I’ve also been using Git with projects that have an svn repository thanks to git’s built in svn support.

While working with it, I’ve ran into several typical cases that I’ve often needed to deal with, that I haven’t encountered with SVN, so I thought I’d share some tips with you, as I’m really starting to think Git is a much better tool than SVN.

Read the rest of this entry »

A simple way to make your code better: Stop adding more parameters

November 11, 2009 – 9:46 pm Tags:

You need to add some new functionality to your function or class. Let’s say you need to remove all objects stored, but optionally also call a method on them.

It’s pretty simple, isn’t it? Let’s just add a parameter to removeAllObjects! If you make it true, the additional method is called, otherwise not.

Except it’s not really such a good idea at all…

Read the rest of this entry »

More blogs that I read

November 5, 2009 – 7:13 pm Tags:

Continuing the trend from last November, when I posted some of my favorite blogs, I think it’s time to highlight some other good blogs!

So here’s a bunch of more – be sure to check them out:

The car steering wheel usability exercise

October 24, 2009 – 5:24 pm Tags:

Apologies if this post shows up twice for anyone using feed readers. Windows Live Writer screwed things up a bit…

With today’s cars having more and more functionality – stereos, built-in navigation, the engine computer metrics etc. – the steering wheels start to have more and more buttons. Sometimes it’s on the wheel itself, sometimes it’s on separate “whiskers” behind it, similar to turn signals and others.

However, many cars just get the controls for all that very very wrong, so I thought it would be fun to do a small usability study.

Read the rest of this entry »

Did you think your site validated input properly? Think again!

October 21, 2009 – 10:14 pm Tags: , ,

You’ve written a PHP based web app, and you’ve made sure it doesn’t cause errors if the user submits unexpected values via any URLs or forms.

But there’s something you quite likely forgot to test: What if the data that’s expected to be a singular value happens to be an array? If you assumed a GET or POST parameter will never be an array, your site probably joined the ranks of several high-profile sites that go into funny-mode when given unexpected arrays…

Read the rest of this entry »

Is commenting your code useless?

October 15, 2009 – 6:19 pm Tags:

James Carr has written a well argumented post about comments. To sum it up shortly, he says comments are the lowest form of communication, and that commenting freshly written code is not a good idea.

I tend to disagree, and here’s why.

Read the rest of this entry »

Going to review Zend Framework 1.8 Web Application Development

October 12, 2009 – 5:16 pm Tags: ,

I was contacted by Packt Publishing to review a new Zend Framework book, Zend Framework 1.8 Web Application Development. I have previously reviewed Object-Oriented JavaScript, also published by Packt, which was a quality title so I’m looking forward to reading this ZF book.

The book is written by Keith Pope, a web developer/project manager from the UK. I don’t yet have the book and reading it will probably take a while, so in the meantime, do check out Keith’s blog which I have been following for a while already. Amongst other things, he has posted a free chapter from the book.

Common programming errors and how to avoid them

October 8, 2009 – 7:02 pm Tags: ,

Back in august, I introduced the error tracking challenge. While it didn’t get as much participation as I had hoped for, I did manage to collect some results.

In this post, I’ll go through the most common ones, and suggest some approaches to avoiding them. Suggest your own errors and tips in the comments!

Read the rest of this entry »