Monthly Archives: November 2012

On Complexity

This is about programming or at least solutions materialized using computers and software. Apply it to other areas at your own risk.

I know how to program. Its not what I do for a living anymore.

For many problems within my field of expertise I can give a rough estimate, and with rough I mean that I get it right within a factor of 2. Ask me the price for building something and I can tell you 8h, 16h, 40h, 80h, 160h, 400h, 800h, 1600h… you get it. The estimate also includes generally what tools to use (C, ASP.NET, Linux+bash, LAMP).

My observation: many people – professionals – cant get this right.

I believe it has to do with (a lack of) intuition for complexity:

  • Software-related problems are much more non-linear that most real-world-problems.
  • For software, the hardest part of a problem tends to determine the hardness of the whole problem
  • Solving two problems together, or merging the solutions of two problems, tends to generate a much more than twice-the-size challenge

The result: people who fail to thoroughly understand the above can not reasonably (within a factor of 2) estimate the cost of a software solution.

There are simple solutions, and complex solutions – often to the same problem. Once I watched news about the unmanned subway trains in Copenhagen. They interviewed the responsible manager and asked him: is it not dangerous with no one to brake the train? He answered: no it is safe, we have a very complex system monitoring the trains and the safety. Horror – I thought! I wish he said they had a very SIMPLE system. Because to me

Simple means many people are able to understand and verify the correctness of the system.
Complex means few people (and maybe no single person) are able to understand and verify the correctness of the system.

Sometimes I draw this matrix:

Simple Solution Complex Solution
Simple Problem Yes No
Hard Problem Yes No

In Einsteins words: Everything should be made as simple as possible, but not simpler.

Where is this going? Well, my question today is:

Why do people choose to attempt unnecessarily complex solutions to problems?

In other words: Why do so many computer professionals suck so bad at their job?

First lets just despise those who intentionally make money by selling more hours than necessary. But those with good intent, who are just bad?

I think they simply fail to understand complexity, as I mentioned before, so they simply can not tell a simple solution from a complex solution. Obvious.

Whats worse, I believe that they prefer complex solutions, based on the real-world fact that more-is-more.

Whats even worse, and this is just my conspiracy theory, is that they prefer complex solutions because; not understanding a complex thing is normal, but not understanding a simple thing is obviously stupid. Thus, stupid people are drawn to complicated stuff to not reveal their stupidity. It is just a survival strategy in the job market, to level the field a bit.

Train Simulator 2013 and PS3 gamepad

Train Simulator 2013 was released a while ago and among the new features was the possibility to play the game/control the train with an XBox 360 gamepad. I dont have such a thing, and I was not sure it was worth buying one just for Train Simulator.

I will start with the conclusions:

  1. You can use a PS3 controller instead of an XBox controller
  2. You may want to reconfigure/remap the gamepad, not using the default behaviour
  3. First I was sceptical – but after a while, not going back to driving with mouse/keyboard

Making the PS3 gamepad (DS3) work with Train Simulator 2013
Windows 7 (x64) recognizes the DS3, but to you need a software that makes the DS3 appear to be an XBox gamepad to TS2013. This software is MotioninJoy, I installed version 0.7.1001 and if there is a later version available you should probably use the latest.

With the MotioninJoy software you use the “Xbox 360 Controller Emulator” mode.

Default DS3->XBox experience
Since the XBox gamepad is not identical to the DS3 I found it quite hard to play TS2013 with the default settings. XBox has A,B,X,Y while PS3 has Triangle,Circle,Cross,Square buttons. Regulator and Brake control was not on the Joysticks (the same on XBox), and this did not mach my expectations. But the worst was that the left Joystick was both used to control the reverser (up/down) and the HUD-panel (left/right). The result was that the HUD-panel changed mode by accident quite often.

Perhaps the default makes a lot of sense with the Xbox gamepad, but for med and the DS3, not good enough for driving trains.

Reconfiguring the gamepad
I did some thinking, and this is what I want: The right joystick used for braking the train, only. The left joystick for controlling the regulator, only. Up/Down buttons control reverser (mostly important for steam, of course). I use Left/Right buttons for controlling coal and water leves (only relevant for steam, of course). The left hand triggers control the HUD. I decided Triangle looks like A, and then Circle is B. I decided Cross looks like X, and then Square is Y.

This way, the gamepad is primarily used for controlling the train, and can not be used for camera pan.

The mappings look like this (all other set to None):


DS3 XBox
Triangle A button
Circle B button
Cross X button
Square Y button
L1 Left Stick X- (HUD)
L2 Left Stick X+ (HUD)
SELECT Back (Map)
L3 Left hat button (whistle)
START Start (Menu)
Dpad Up Left Stick Y- (Reverser)
Dpad Right D-pad up (Water)
Dpad Down Left Stick Y+ (Reverser)
Dpad Left D-pad down (Coal)
Left stick y+ LB (Regulator)
Left stick y- Left Trigger (Regulator)
Right stick y+ RB (Brake)
Right stick y- Right Trigger (Brake)

I obviously have R1 and R2 to do something with.