Want create site? Find Free WordPress Themes and plugins.
A few years ago I was preparing to switch to a different team at the same company.
I was training a new guy (M) to take over my responsibilities before I made the change.
One day he sent an email to the team saying he found some inefficient automation code and he planned to fix
it. He cc’d me on the email because I wrote that code.
It was verifying a list of authorization codes. Order was not important but all the values had to exist and match. For example:
EXPECTED_AUTH_CODES = KT3, LMA, HU9, MN4, AK2, WNH, M1K, SV2, B2C, G5C, S8H, JP, DB9, LS2, TS, DM, BJ0
AUTH_CODES_FROM_DATABASE = DB9, TS, AK2, BJ0, DM, HU9, K1M, 2V5, KT3, S8H, MN4, WNH, LMA, LS2, B2C, G5C, JP
AUTH_CODES_FROM_API = WNH, DB9, PJ, KT3, B2C, G5C, MN4, DM, S8H, TS, LS2, HU9, 2V5, BJ0, M1K, AK2
He followed up the email saying he was going to reduce my code from 7 lines to only a couple of lines!
The next email showed his 2 lines of code – he seemed very proud.
I asked him – what happens if any of the lists are null? His code would throw a NPE with a stack trace that didn’t give any useful information and the person investigating would have to spend time researching.
I asked him, what happens if any of the items in the list are null? His code would throw a NPE with a stack trace that didn’t give any useful information and the person investigating would have to spend time researching.
I asked him what happens if list A and list B have differences? His code would report a junit assertion failure expected KT3, LMA, HU9, MN4, AK2, WNH, M1K, SV2, B2C, G5C, S8H, JP, DB9, LS2, TS, DM, BJ0 actual DB9, TS, AK2, BJ0, DM, HU9, K1M, 2V5, KT3, S8H, MN4, WNH, LMA, LS2, B2C, G5C, JP
Try eye balling that quickly to spot the differences and try doing that multiple times a day across multiple individuals on a team.
I asked him what was most important to optimize (A) a few lines of code or (B) making daily and hourly investigations (by a high paid employee) faster and easier?
My code reported exactly what the differences were.
EXPECTED_AUTH_CODES does not contain “2V5”, “K1M”, “PJ”
AUTH_CODES_FROM_DATABASE does not contain “M1K”, “5V2”, “PJ”
AUTH_CODES_FROM_API does not contain “JP”, “5V2”, “K1M”
But I’m sure you my reader already spotted the differences from M’s example, right?
M took the rest of the team off the email and told me he didn’t mean for this to turn into a long thread.
My automation concept is “healthy fat” or “a few lines of code that provide useful data” is good because it it optimizes paid employee’s time.
Did you find apk for android? You can find new Free Android Games and apps.