|
|
|
|
|
by nimbix
1162 days ago
|
|
The scenario I was referring to is one of many gems found in app we outsourced. The piece of code in question had a very straightforward task: look at some bytes in the input and produce a string label to be stored alongside the whole input value. There are 5 different labels tied to equal number of fixed byte sequences. I would like to think that most people would solve this problem using an if/else or a switch statement inside a function. Instead, what we got is a group of matcher classes, a mapping of matchers to enum values representing the labels, another mapping of enum values to actual strings, and a class that actually calls those matchers and does the mapping. I really hope this is not the DDD way and instead we just managed to find a team that's prone to massively overcomplicate solutions to simple problems. |
|
1: https://www.reddit.com/r/csharp/comments/qomcps/comment/hjo1...