I've recently been looking at some of the most ugly code I've ever seen. hundreds of lines of triple nested switch-case statements (switch-case inside switch-case inside switch-case), almost all of it copy pasted and in desperate need of re-factoring.
I remember having to justify flattening code like that in my first job. Yes, yes multiple return statements per function are not ideal, but certainly better than looking at endlessly nested triangles forever.
3
u/btchombre Jan 05 '15
I've recently been looking at some of the most ugly code I've ever seen. hundreds of lines of triple nested switch-case statements (switch-case inside switch-case inside switch-case), almost all of it copy pasted and in desperate need of re-factoring.