I used to work with someone who said that most bugs in software didn’t exist.
His reckoning was down to the fact that most specifications for functionality aren’t tight enough. For example, if the spec for an adding function was to add two numbers together, adding 5 and 9 together and returning a value of 162 was acceptable. Even returning nothing, or null, or a gazillion was also ok. The specification should have said that the function had to add two numbers and return the correct mathematical result.
For a developer, this is great news. You don’t have bugs anymore, you have “undocumented features”. Feature specifications get better and it’s easier to write code that satisfies the requirements.
It’s a bug!
But I personally think blaming bugs, and they are bugs, on the specification writers is lazy. Bug reporters, whether they are developers or not can get quickly hacked off with being told that an error they’ve found isn’t actually a bug, but it’s the fact that it’s actually been implemented exactly to spec.
A bit of common sense in all of this is definitely required. If you need an adding function, it’s obvious to anyone that it should return the result. If the spec doesn’t say so, just do it and move on.
And if you need a function to return the results of whether a visitor is a mobile device or not, it’s probably wise to actually return the value rather than store it in a cookie. Oops!Tags: bugs, Code, undocumented features