5

So yeah... This guy just copied and pasted the same 5 lines over and over again. 5 lines that do the collection of values for variables, setup call, and then an API call for different CRMs based on name. Repeated 7 times for each of the CRMs that we support. On top of the insane switch statement which is actually only used once to check if it's not null and matches within the switch statement. See the following loose but true example of this shit show I'm dealing with.

```pseudo-code-example
switch(crm)
case crm1
case crm2
case crm3
// (keeps going like this)
var temp = true
default
var temp = false

if (temp)
if (crm="crm1")
crm1.setup()
crm1.values(foo, bar, baz,...)
...
if (crm="crm2")
crm2.setup()
crm2.values(foo, bar, baz,...)
...
// Yup still keeps going like this
```
This absolutely insane mess was finally refractored by me to be an actual factory and not this absolute senseless murder to my mind.

Comments
  • 4
    Usually people like that say “eh if it works who cares, we ain’t got time” while coping with skill issues
Add Comment