top | item 35486398

(no title)

nimbix | 2 years 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.

discuss

order

diarrhea|2 years ago

My unsolicited, socially unacceptable pet theory on this: that’s what happens when you’re building your 15th e-commerce web store. C# is a great language, but it’s a worker’s language. Its domains tend to not be the most exciting ones (e-commerce, calcified Excel replacements, Windows desktop applications, …). [1] Hence, so my theory goes, the smart but bored engineering minds wander out and conjure up complications to fill their days and minds. A common pattern in IT I’d say.

1: https://www.reddit.com/r/csharp/comments/qomcps/comment/hjo1...