Thought for the Dazed

I've had to give up that Distance Learning course as I was having trouble seeing the teacher.

Flickr
www.flickr.com
RobMiles' items Go to RobMiles' photostream
Twitter
C# Yellow Book

Search entire site
Sunday
Mar252012

Best Programming Language?

IMG_7331-Edit.jpg

There’s a program in the App Store called “Best Camera”. It takes as its starting point the idea that “The Best Camera you’ve got is the one that you have with you at the time”. The application then goes on to provide all kinds of useful tools that make the iPhone camera as good as possible.

I was reminded of this when there was a tiny bit of debate on my post about the CodeAcademy site, which teaches JavaScript. Now, JavaScript is not a great language, but it works and can be used to create useful stuff. So it is automatically a candidate for “Best Language”. In my opinion, the Best Language is the one that you are using at the moment. I base this on “Robs Rules for Programming Languages”:

  1. You can write great code in any language.
  2. You can write horrible code in any language.
  3. The user does not care what language you used to write the program they are using. The user only cares that it works and does what they want. And that they can afford it.

I’ve written programs in loads of languages. At the moment my personal favourite language is C#, but I have really fond memories of writing embedded C, since in that I could do anything I wanted and I could build all the underlying bits myself from scratch.

This is usually the point that people say things like “But blah doesn’t have blah.” or “Blah programs are really hard to use because the debugging support sucks.” So what. This brings me to the Rob’s Other Rule

  1. Having a nice place to work is much more important than the programming language you are using.

If the language you are using doesn’t have a feature that you need, find a way of programming around it. I’ve written lots of object oriented software in C. C doesn’t support objects, but I arranged the code so that it looked like it did and then programmed by “object rules”.

If the development/debugging support is horrible, wrap something around your program to make it easy to work with. I’ve built emulations of LCD panels and even lasers to avoid having to debug my programs on the real hardware. I’ve written code to make ten thousand customers from nothing, to save me having to type things in by hand. And I’ve added cheat buttons to games so that I can skip levels and inflate my scores and avoid having to play the game all the way through so that I can debug the last bits. 

Remember, when you are writing a program you don’t just control what the code does, you also control the environment the code sits in. Bending this to make things easier is something that will pay off tenfold. Can’t debug your program without a network connection? So what. Fake the web request responses so that you can feed the answers back yourself. This also makes test driven development much easier.

Of course, given the choice, you should pick the most appropriate language for the task. Give me an AI problem and I’ll be looking hard at what Prolog (or perhaps F#) can do for me. But for me programming is not about the language, it is about the problem solving, and that means a programmer should be able to turn their hand to whatever the occasion demands. Even if it is JavaScript.

Saturday
Mar242012

Imaginationgamers

image

I love it when people do stuff. Anthony, a student at Hull, is doing stuff. He has started up a web site for gamers who want to talk about, play and even build games. The whole thing is very slick and there are lots of forums and places where folks can pitch ideas and find like minded souls to go on and build something. I wish him the best of luck. If you want to take part then you can find the whole thing at http://www.imaginationgamers.com/gb/

Friday
Mar232012

Coffee Question

The coffee machine that I use sometimes rejects coins that I give it. So sometimes I take spare cash to buy a drink in case my money doesn’t work. But sometimes I take the exact money. Why?

Friday
Mar232012

Codeacademy for learning JavaScript

DSCF6379.jpg

During a First Year lecture this week I said that the students should spend some time this Easter learning JavaScript. Everyone should know a bit of JavaScript, it is what makes web sites work, and with the coming of HTML 5 it will be even more important. I’ve just found a really good way to learn it too. (this also works for anyone who fancies doing a bit of programming). Take a look at Codeacademy.

http://www.codecademy.com

Looks like great fun.

Thursday
Mar222012

Tony Hawk: Shredded

image

One of the reasons why some videogame companies are in trouble at the moment is their love of gadgets. Since the original Guitar Hero made a fortune by throwing in a plastic guitar there have been a whole bunch of exotic peripherals thrown at gamers. I reckon they peaked with the Rock Band drum kit, and it has been downhill all the way since. Tony Hawk Shred is perhaps the last big piece of plastic that you will get with a game for a while. It was originally priced at more than 80 pounds, but you can now pick it up, post free, on eBay for around fifteen quid, at which point it starts to look good value. That’s how I ended up with a copy.

The board itself is really sturdy and bristles with sensors that make it able to detect ollies and the like, as well as when you grab the board during a stunt. It even comes with Velcro strips you can use to stop it wearing a hole in your designer wood floor. If you get the Xbox version you should be able to use the sensor signals in your XNA programs, although I suspect the market for skateboard compatible games is probably a bit limited.

The game itself is nothing more than OK though. Rather than give you an environment to explore as you like, instead you are run through some sequences on rails and have to perform tricks and stunts at pre-defined points. This makes the game very restrictive, although the sequences are nice enough to look at. Tony Hawk himself pops up to make comments on your efforts, although they should have added a mini-game where you could work him over with the board after he has said the same inane thing for around the tenth time.

However, if you fancy a night in with some friends doing something stupid (and ideally you live at ground level and have a concrete floor) for fifteen quid you could do a lot worse.