Minimising Points of FailureMay 13th, 2019
When it is right, it is right. Code behaves as intended when implemented correctly. One of the best courses to get closest to right as fast as possible is to minimise the points of failure.
By focusing on reducing the number of things that can go wrong, you will inherently reduce how much testing is required, how difficult it is to maintain, and develop more rapidly.
One such example is creating and updating objects. You want enough flexibility that these two processes can go their separate ways if need be, but upon going their separate ways, it creates more things to test.
By getting the create/update code in the same spot, you can reuse all of the validation, all of the SQL queries, all of the language for form elements etc.
Depending on how you do it, a single SQL query can handle adding and updating elements. I like to you REPLACE INTO for simplicity, however this can be dangerous with foreign key constraints that coalesce. You can also do INSERT INTO ON DUPLICATE KEY UPDATE. I respect that decision as it does well to get things in one spot and doesn’t run the same risk with foreign key constraints. The queries are bigger though.
Fell free to send me benefits to minimising points of failure.
jsturgis May 13th, 2019ABOUT THE AUTHOR:
I am TSLA long. I do not fear uncertainties and doubt. Numbers matter. Their i'n't e''ry word I gunna get edit'n'.