Wednesday, December 19, 2012

It's simple really

  One question I get asked about what I do for a job is why do things have so many bugs. I think a quick explanation of that could be assisted with this picture here about the C++ language.
  This picture just covers the basic groups (18 of them) of concepts (189 in total) in use for the C++ language. All that just to understand how a programming language is used let alone the syntax, libraries and just general good practice requirements to write code that always works. Then try and make a program that has to deal with every single possibility that could ever happen and you have something that is far beyond the complexity of anything any person or group of people could possibly hope to understand. The best you can do is be vigourous in testing and design to try to cover all potential trouble areas. Even then you don't have enough time to do everything so you do the largest and/or the most likely troublesome areas you can think of.

  It gets scary when you think about it. All this complexity doing things that could potentially cause all sorts of real world physical problems. With physical products you can see you can think of the possible problems, it is something you can hold and look at. With software unless you can visualise what it is doing in your head it is hard to imagine what can go wrong.

  Not a very good explanation I know but it shows the fundamental problem with trying to make sure software always works. You simply can't conceive and test every possible real world situation, just as many as you can feasibly think of. Take my companies current software release, it has 398 known bugs (ranging from broken stuff to potential improvements), 631 potential code problems (from static code analysis) and about 1500 compiler warnings across roughly a million lines of code. Yet as a product it works incredibly well for the vast majority of potential applications.

  Finally lets get back to important stuff, Lego. This time a little more silly, a Lego dog and fire hydrant.

No comments:

Post a Comment