Article 623S5 CodeSOD: Junior Reordering

CodeSOD: Junior Reordering

by
Remy Porter
from The Daily WTF on (#623S5)

"When inventory drops below the re-order level, we automatically order more," was how the product owner described the requirement to the junior developer. The junior toddled off to work, made their changes. They were not, however, given sufficient supervision, any additional guidance, or any code-reviews.

Dan found this in production:

let item = backend.fetchItem(itemId);if (item.quantityOnHand <= item.reorderLevel) { //automatic re-order item.quantityOnHand++;}else { item.quantityOnHand--;}backend.updateItem(item);

As you might imagine, "ordering refills" is slightly more complicated than "just alter the inventory quantity". This code didn't work. It should never have gotten released. And it's definitely not the junior developer's fault.

buildmaster-icon.png [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments