Wednesday, 20 June 2007

My Love Affair with C++

I first started learning C++ in around 1997, and I used it in my second job as a developer up until around 1999. I lost my job then and pretty much stopped programming entirely so I never really got my teeth stuck into the language.

Over the years I dabbled a bit but I didn't get to do much with it until I went to Uni. Here I had lots of opportunities, most notably in the third year for my project. I chose to develop an online RPG creator called Morde. This was quite a hefty project, there was a client and server, both developed in C++ (my first foray into network programming) and a 'builder tool' which I wrote in C#.

At first I had a lot of plans for Morde and I wanted to continue with it after Uni but towards the end of the project I ran into many problems and in the end, I just decided to do what I needed to do for the sake of the Uni project and then dump it.

However, it had given me a taste of non-trivial games programming using C++. After Uni I got a job at Aston Broadcast and for the first 6 or 7 months I used C++ to develop client / server applications which was pretty cool. In those first few months I got myself reacquainted with the industry and started learning about all the new developments to the C++ language that had been going on in recent years.

There were a few things that struck out at me. Firstly, the Boost libraries which are open-source libraries of handy utilities written by many well known industry professionals, had really grown over the years. C++ is renowned for being so painful to program in. The standard library alleviated a bit of that pain but it was lacking in many areas. Boost makes up for that lack in a multitude of areas. In particular, there was a groovy library called Asio (Asynchronous I/O) which could be used for robust client / server code and I used this at work.

Another thing I noticed was that many of the familiar faces in the industry were still around. Herb Sutter, one of my favourite authors, had become some kind of C++ God and had released lots more cool looking books such as C++ Coding Standards. The book Effective C++ by Scott Meyers had recently had a 3rd edition published. I devoured these new books quickly.

Lastly, the community seemed to be just as strong as before. The ACCU conference was now in its 9th or 10th year and I was fortunate enough to get hold of 5 years worth of conference slides and looking through those showed me just how C++ had grown over the years.

So at this point I felt like I was beginning my C++ journey all over again except that now I had some new tools to play with such as unit testing, agile techniques, new Boost libraries and so on. I was really enjoying my projects at work but I felt like I needed a really substantial 'pet project' at home to try out all the new techniques that I was learning about. Generally speaking, testing out cutting edge stuff in the workplace doesn't usually go down too well with the boss!

This is when the idea for Mod Wars was born. It was going to be another online game, but without the features that caused me such a headache in Morde - namely, complicated graphics issues. I'm not an artist, neither am I a graphics programmer so this game would be a simple 2D affair with simplistic, mostly static, graphics only.

I also started to get ideas for some web development that I wanted to do and my spare time at home was becoming limited so I put Mod Wars on hold and decided to work on web development exclusively for a while. However, a few months ago at work I was moved off of my C++ work and onto the C# team. This means that I am no longer doing C++ development at all and I'm now missing it badly!

I know it's an old language. I know there are a squillion new technologies now that are probably a lot easier to use but I feel like I need my 'closure' over C++. I'm having some fun with C# at work but I know that I can't rest until I've developed a substantial C++ software project.

Mod Wars was always going to be that project but then I had an idea which threw a major spanner into the works. In the small amount of development I did for it, I had some compatibility issues. My output was displaying fine under Windows but it was all screwed up on a Linux machine. I never did find a solution to that, and that bug is still outstanding. With all this study around Web development I got the idea that I could make Mod Wars a web-based game!

This would allow anyone to play the game, regardless of whether they had a PC, Linux box, Mac, whatever. There would be no download / installation / patching issues to worry about. I'd only need to develop one code base. In short it would make the game far more accessible for the players and would remove many of the technical headaches for me.

But that leaves one tiny problem... How does C++ fit into the plan for a browser based game? This has been a source of major conflict for me ever since I thought of it. On the one hand, making Mod Wars browser based would be an excellent idea, but on the other hand, I still need my C++ fix!

I think I may have a solution to this conflict now, but I need to do some more investigation before I can reach a conclusion about that.

Thursday, 14 June 2007

My Web Development Roadmap

Having completed my Head First HTML book a couple of weeks ago, I started having a play around with some HTML and building a little test site. At the same time I began to sketch out some ideas for the kind of websites that I would ultimately like to build. I have several ideas and most of them have several features in common:

  • They'll be database driven in some way
  • Most will require a secure login system
  • I'll want a nice Ajax front end
I already have a book on Ajax and its after starting that book that I realised I would need to take a step back and brush up on my HTML and learn a little Javascript too. So my initial plan was to study HTML, then Javascript and then move onto Ajax.

However, after pondering my above list I realised that all of my sites needed to be dynamic. They would all need to be database driven but I could cope without Ajax to start with. So this has changed things a bit. As much as I've like to play with the cool features of Ajax, I am more concerned with getting something functional up and running quickly so I had to find out a little about database driven websites.

After a little digging there seemed to be two popular paths that stood out - the Php / MySql one, and the ASP.NET / Sql Server one. They seemed to be biased towards *nix / Windows respectively though in the case of Php / MySql they can also be run on Windows servers. I don't know any of those technologies though I am a C# developer by day so I'm pretty sure that ASP.NET is going to be easier for me to pick up than Php. For that reason alone I went for that route.

I've now bought the Wrox book Beginning ASP.NET 2.0 with C# and I'm working my way through it. I'm feeling a little frustrated at the moment as I realise that I can't really do much yet - it's all just study. Hopefully I'll get to a point where it will all start to click and I can really get moving on something.

Sunday, 3 June 2007

Those Cocky Developers!

What is it about software developers eh? They think that just because they write software for a living (or in my case, fix bugs!) that they know everything there is to know about computers. Do you think they read manuals? Nope. Do they use the CD's that come shipped with their computers? Nope. They just try to fix things by themselves - 'cos that's what they're supposed to be good at.

Thursday night I switched on my PC and within a minute or so of booting it just froze. Odd I thought. So I rebooted and it did the same thing again. It continued to do this and I didn't find a solution to it. Most of Thursday night and all of yesterday afternoon and evening was spent trying to fix it. I went to the Major Geeks forums and followed the instructions in there for removing malware. I did find some extra stuff but it didn't fix the problem. I double checked all my hardware, I fiddled with my router a lot. Nothing worked.

After some hours I reluctantly phoned my broadband provider for help. After walking me through his little checklist of mindlessly pointless things that I had already tried he asked his supervisor for help who told him to tell me that only one PC would be supported and they could therefore offer me no more help as another two computers on our network were working fine.

So, time for a reinstall. I spent ages copying some crap that always gets installed to your C drive (like save games for Oblivion & GTA - how irritating), and I carefully made a list of all the stuff I'd need to reinstall. I reinstalled Windows - still didn't work. This flummoxed me because usually XP is pretty good at just figuring out our network all by itself without me having to fiddle with it too much.

After many many hours of frustration I decided to have a little dig into my Alienware pack that had come with the PC. I realised that I'd installed an old version of XP so I reinstalled all over again using the Alienware version. This was better because at least it came with SP2. But the network was still buggered. Then I found another CD called "Master CD". I wonder what that is I thought to myself.

I plopped it in the drive, found a folder called Drivers and in that, a folder called Network. Hmmm. There was a readme in there that said that the network drivers were installed with the NForce drivers. These NForce drivers were found under Motherboard so I tried installing that. It installed an Ethernet controller and suddenly new hardware was found and installed, I had a LAN and an IP Address. I loaded up a browser and bingo - it all worked!

Now if only I had tried that first...

Moral of the story : check the stuff the manufacturer sends you!

Friday, 1 June 2007

I'm such a w00b!

A what?? A w00b! Ok so I play a lot of computer games and a 'newbie', somebody who is new to the game is often referred to in a derogatory fashion as a n00b in 'dude speak'. I happen to quite like calling people n00bs in the nicest possible way you understand! :)

And what does this have to do with software? Yesterday I finished my introductory book on HTML & CSS so my new mission is to just get started building a website. I flicked through the book and pulled out the main teaching points and built a list of 29 things to do with the site to exercise all of my new skills. Step 1 was to simply create a page with a header, title, headings, paragraphs and an image. Pretty basic stuff and of course there is no styling yet so it looks horrid.

I'm working through my list of 29 things and I'm up to number 4 - making lists whoooo! I thought to myself "I feel like a complete web n00b" and that just led me naturally to the word w00b! So, just in case nobody has thought of it before, YOU READ IT HERE FIRST!

I'm a w00b yay!

Oh dear, back to the HTML...