When the CEO is the ex-developer of the company's flagship product, it probably means that the other developers were just hired to add features the CEO was now too busy to be bothered about. Obviously, it is impossible that the design of the system could be imperfect in any way. As technology changes, however, it sometimes becomes necessary to do drastic things like change software platforms.

As the product had grown --- "Organically, like a weed." --- more and more logic was shared between the SQL database and the application.That's where Trent came in: it was his job to discover and recreate all the nuances of this dance on the new platform.

In order to track whether a new user had accepted a particular offer, the CEO added a new column, b_accepted, to the database. Its value was controlled by the following code.


  If sAction = "Send" Then
      bAccepted = True
  ElseIf sAction = "Cancel" Then
      bAccepted = False
  ElseIf IsNull(sAction) Then
      bAccepted = 1

  ' ...

  sql = "INSERT INTO MyTable (...,b_accepted)


The important part (for anyone that doesn't know) is that in Visual Basic, True is equivalent to negative one when you shove it through CInt. (When using System.Convert.ToInt32, you get positive one instead.) That takes care of three values, but what about the fourth? Since the column was added to the table as a modification and the default value was null, that makes four.

Incidentally, the addition of b_accepted was so well accepted that it is now one of many similarly quad-valued fields in the database.