Reply to post: Ouch

Tech rookie put decimal point in wrong place, cost insurer zillions

JulieM Silver badge

Ouch

Now, the proper way to have done this, would have been to create a class -- or, since it looks like Perl, a package -- defining an object that matches a single record in the database; with a constructor method to create a new record from an array, and accessor methods which allow you to retrieve one record object or an array of record objects matching a particular key, and retrieve and modify the individual fields within a record object. And so you hide all the ugly SQL plumbing away in methods.

Meanwhile, in the real world, when some tie-wearer who regards writing future-proof, reusable code as mere prettification asked you to make "just a quick change" that you asked them about -- knowing that if they wanted such a thing, you would have to write the program differently than if they didn't -- before you started and they promised categorically that they absolutely would not ask for, and which is going to require you to rewrite the whole lot from scratch to implement, all you can really do is sob quietly into your coffee for a few minutes and then bang something quick out before the next change-of-mind.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon