The Edge-case Excuse

I find the excuse that the bug is just for your small “edge case” as an explanation for why it won’t be fixed annoying.

I have found “edge cases” to actually mean we don’t want to fix it. Often the issue isn’t needing some special code to deal with an “edge case” it is the coding was done poorly and breaks in many different “edge cases.” It isn’t that those edge cases need to be coded for. It is that the code should have been written in a robust way that didn’t break for lots of “edge cases” but the excuse given for not fixing the fundamental coding fragility is the bugs found are just “edge cases.”

There are real instances where “edge cases” is a justifiable excuse. For example, adding in special code to deal with some odd category of users that just isn’t worth the cost.

But I just am so tired of fragile coding being excused as if breaking in lots of “edge cases” is perfectly acceptable when the only reason it fails is because the code is fragile instead of being built in a robust way to begin with. The issue isn’t that you have some special edge case that you want special coding for the issue is the code was written in an unnecessarily fragile way that makes it not work unless you follow a list of acceptable use cases.

Code should avoid adding in requirements that are not necessary. The edge case excuse I see used far more due to requirements that the code added which never should have existed instead of actually being an edge case that would require special code. For example, most web pages don’t require javascript (or IE, or flash, or downloading 5 mb of code to view simple text…) to do what should be done (display text, display images…) but some sites code their page to break if javascript… isn’t used by the user. Seeing this as an “edge case” issue missing the point of creating code that has superfluous requirements for the user that create “edge case” failures where they shouldn’t exist but for poor coding practices. In some cases jasvascript is required to do fancy things that are useful, in which case gracefully degrading and potentially not working fully is acceptable.

Related: W. Edwards Deming and Software DevelopmentSoftware Supporting Processes Not the Other Way AroundComplicating SimplicityWhich Prime Minister Said “The last programme I wrote was a Sudoku solver in C++”?

Which PM Said “The last programme I wrote was a Sudoku solver in C++”?

The last programme I wrote was a Sudoku solver in C++ several years ago, so I’m out of date. My children are in IT, two of them – both graduated from MIT. One of them browsed a book and said, “Here, read this”. It said “Haskell – learn you a Haskell for great good”, and one day that will be my retirement reading.

This quote was by Prime Minister Lee Hsien Loong of Singapore in April 2015. I must say I think the Western governments could be more effective with more scientists, engineers and coders in positions of power

His father was the first and long time Prime Minister of Singapore – Lee Kuan Yew

Another quote from the speech

40 years ago, after doing a math degree, I went on to study computer science, on my father’s advice. He said there is a future in that, and he was right. So for the Smart Nation Programme Office, I have put Minister Vivian Balakrishnan in charge, reporting to me. Vivian is both a hacker and a dabbler – He used to be an eye surgeon but since he does not get to operate on eyes nowadays, he dabbles in building simple robots, assembling watches, wireless devices and programming apps. His day job is to be the Minister for the Environment and Water Resources, and so when he builds apps, he uses the real time APIs generated by the Ministry.

It is useful to have governments around the world with different priorities. While the USA has turned against science and engineering in many ways others can pick up the slack. The USA had for decades been firmly in the position of promoting science and engineering. And the results of that are still blessing the USA with economic benefits including the wonderful results of silicon valley and far flung software development throughout the country.

photo of the Marina Bay Sands resort that resembles 3 sky-scapers connected on top by a large ship

The Marina Bay Sands casino and resort hotel has 3 towers connected on top by a what looks like a large ship. Singapore has a huge, and economically important port.

Singapore can improve but they sure do many things well. And the sense to continue supporting science, engineering and emerging technology will benefit them economically as we move into a world where those fields only grow in importance.

Prime Minister Lee Hsien Loong made the source code, the exe file, and a sample printout available after asked being asked about it online.

Related: If Tech Companies Made SudokuChina’s Technology Savvy Leadership (2008)Scientific Illiteracy (USA lead Singapore in this undesirable trait)Math Education Results Show China, Singapore, Korea and Japan Leading