Skip to main content

Posts

Showing posts from 2010

Subjective technical decisions

Saw an interesting discussion today on what points to cover when evaluating what software language to use. I threw a few points in and it was pointed out that half of them were very subjective to measure. How would one get a team to agree on such points?

This got my brain ticking as to all the subjective choices programmers make every day and the effects it has on others. We adopt 'standards' within a team to try and keep some sanity in it all. Coding standards is the most familiar to avoid future arguments about where a brace should be. And coding standards an a good example because they're defining all the small things. I'd love to see a coding standard that states: "Write tests first".

We argue over decisions that don't have a large impact either way. It's very easy for me to say Java is annoying and I'd rather C#. But with very little experience in either language it'd be hard for me to defend that view against an experienced Java or C# deve…

App stores are good for games

By now I think most gamers have bought something from an App-store. Steam, Xbox live Marketplace, iTunes or whatever.

Furthermore I think a lot of people have bought games from places like Apple's app-store but do not consider themselves gamers. So app stores are all the rage now and with Steam now available on the mac it becomes the de-facto PC place to buy games. proprietary platforms all will come with their own. It's seen a boom in independent and low budget games going through a huge surge in market that hasn't been seen since the shareware days.

But even more so for games than other software. Look at the statistics from apple's apps and you find games are number 2 in size. Second only to books which may get kicked out now apple has their own iReader system. So all these app stores regardless of platform or format are a boon for games.

But why games? Honestly I'd love to know myself. There's something about open source that has made it difficult for games to …

Are mocks/fakes reusuable?

Programming 101 states:
Don't copy and paste code. If you find yourself doing something repetitive then do it right so you can reuse the same code. Functions, classes and even separate files all serve this end.

Now that I'm writing tests all the time I often find myself creating Mocks. Mocks are where you tell code to use a pretend version of some functionality instead of the real one. It could be because the real one does something you don't want in your tests (writes files, reads a database) or it could be that you've got some messy legacy code you can't to pull into your tests (yet). There's other reasons too but you get the idea.

So if I make a Mock version of a class it makes sense to try and share that with everyone else that might be trying to test with that same class. Or does it?

That assumption has some serious flaws that I'm only now starting to understand. And here's a few:

Behaviour you need to test may be completely different to the next guy

So …

Just one more X

What is it about human psychology that makes this such an effective way to keep people paying attention. It's the most obvious in games. There's always 3 or more short term goals you're aiming towards. Just this one fight. Just until the next save point. Just until I get 10 of this item.

It works for other things. Tasks at work (go on, admit it!). Novels with short chapters.

Is it possible to transfer this fantastic power to other things in life? Cleaning the house (just dust one more cupboard). Exercise (just one more lap). Often not. Why is this?

The human brain is a stupid but fascinating thing

A brief history of Javascript

Javascript is the ugly duckling that is now ruling the internet. It's now a fully grown ugly arse duck! But you'll respect it because it got a lot right where corporations have failed.

Back in 1996 I heard how Netscape was coming out with a new version 2.0 that would include Javascript. Apparently in a deal with Sun Microsystems they renamed it from Livescript and it would allow programming to be embedded into HTML and run in the browser instead of on the server.

At this time Netscape defined the web. If you browsed webpages you used netscape. Sure it crashed a lot. Yes it ran out of memory when some punk decided a page with 12 frames would be cool. But if you used anything else you were missing out on the full glory of the web. So when Netscape said they were doing something cool for the internet you listened with equal interest, excitement and doubt.

Sounded like a toy. Netscape already messed up websites with the damn <BLINK> tag. Sure you could have some nice effects li…

C++ sucks part two

You like speed? C++ will not get any faster

Because C++ support for multi-threading is lackluster. You've pretty much got to roll your own carefully constructed tools to avoid even the most common mistakes multi-threading can introduce.

"What about C++0x?" I hear you say. Screw that! Sure a lot of the stuff being proposed is a huge improvement. But it's been sitting around since 98. When am I going to see this in a compiler? When can I use it? I'm slowly dying here as processors get more and more cores.

To write a program in C++ today is to write code that will never run faster. Or will probably crash trying.

You like speed? C++ build times will feel like riding the bus

Builds are sooo slow. While trivial programs can build from scratch in seconds. Typical programs can take minutes to build from scratch. Complex programs can take so long to build it's usually farmed off to servers to do a 'nightly build'.

Let's do some math. Assume a program takes 2 min…

C++ sucks part one

This is going to be too much to fit in one post. So lets start with the most provocative.

I'm over Constructors and Deconstructors

It's such a staple of OOP and yet I could seriously do without them now. If you're like me you learned these are great places to create/delete required objects, open/close files and all that stuff. But it just causes trouble.

Here's a typical example:

MyObject()
{
anotherObject = new AnotherObject();
fileHandle = open("configfile.xml");
}
~MyObject()
{
close(fileHandle);
delete anotherObject;
}


Great! What could be wrong with that? We'll there's two things.

1. You want to customise things in a child class
Ideally you shouldn't need to mess with the parent. Maybe due to some rules on shared code you can't change the parent (easily). But if you want anotherObject to be CustomObject and use a different filename you end up with this crap:

MyObjectChild() : MyObject()
{
delete anotherObject;
anotherObject = new CustomObject();
close(fileHan…

I'm sick of ret-cons

Blah blah Han shot first blah blah.

This was brought to my attention yesterday!
http://kotaku.com/5485075/valve-updates-portal-again-now-with-new-ending

Like WTF!? The ending was pretty vague anyway. You get to the surface with things blowing up. Cut to music. Why is there even a need to change to and re-capture?

Why is there this growing trend of writers going back and reworking their story? It's not like there's a Homer's Odyssey (revised edition). I'm sick of it. Let it sit. Write a NEW story.

Embrace change or fail and wonder why you wasted your time

Ok so I mentioned how I've been getting my head around TDD and Agile recently. I'm kinda late to the game since I only discovered it 2 years ago with a presentation by Uncle Bob in Chicago. So it's taken a lot of reading and talking to get to the point where I am now. But I'm also carefully watching trials others are doing and making notes about those who succeed and those who fail.
So time to talk about the interesting one. The failures. Let's break them down to some common archetypes.
I'll keep coding the same way and make some token effort with planning cards.

Yeah you suck. You've got to change your ways! The order you do things isn't going to be the order you always did it. You've got to talk to the customer/designer/whatever and let them talk about what's most important. That's your new order! Don't spend for ever building some backend database bullshit. You may not even need it by the end. The whole design may change and become somet…

Should video games be addictive?

Now keep in mind I don't think games are addictive like drugs are. That's a rant for another time perhaps. But they are designed to keep you playing and playing and playing. Now for most people this is not a problem. You choose when to play and when not too. It's something you enjoy in moderation.
But some weak minded fools will ignore their significant other, stop showing up to work (or whatever) and allow personal hygiene to lapse.
Now you have never done that. I have never done that. But perhaps like me you've played a game just a little bit more. Just one more level. Just one more fight. Just let me hand in this gopher. Next thing you know the morning sun is streaming in the window. What happened?
You just had a damn good time! That's what happened. Stop freaking out. We've done it with that extended edition of Lord of the Rings. We've done it with a good novel and short chapters (just one more!) And we've done it drinking too much with friends. Get ov…

Stephen Conroy is not Satan

That statement is probably getting two types of reactions.
a) Who is Stephen Conroy? Well if you live in Australia then all your internets belong to him. But otherwise you may as well stop reading.
b) He is too! Okay you're the ones I want to talk to. You're wrong and you're wasting your time getting upset about Internet censorship.
Let me lay out the facts as I see them (read: opinion and opinion cannot be wrong no matter how much you disagree).
He's not evil he's just stupid There's nothing really wrong with that. Lots of politicians are stupid. Some of the best have been morons! I'm very fond of the saying "Never assume malice that which can be adequately explained by stupidity" so I'm applying it here. He thinks he's doing a great service to Australia. Finally we'll be protected from all that nasty stuff that we were not supposed to be seeing anyway. Finally the internet has reached maturity where such things are possible. Or at least t…

A brief introduction

And then I'll get into my first rant.
I'm some guy who thinks about stuff. Stuff you probably don't care about but I'm going to tell you anyway! Now I don't think I'm going to cure cancer or create world peace but it'd be nice if I could make the world a little better. Stuff I'd like to talk about will focus on:
Games I've always been a game player and am fascinated in how one designs a game. Yes it's mostly computer games these days and even then it's mostly consumed by World of Warcraft. Shut-up you in the back! We all have our vices and I'll avoid sniggering at your hentai collection if you leave my level 80 mage alone.
Programming Only 2 years ago I was introduced to this weird concept of Test Driven Development and the broader concept of Agile. Programming has been part of my life since I was eight. When I haven't been doing it professionally I've found myself doing it more in my free time. So it's nice that after 20+ years to…