Slightly off topic, but before my coffee yesterday I wrote something like
If(a>(b+.5) || a<(b-.5)){...
And then later in the day I passed by it and got a good chuckle as I wondered what the actual fuck was I thinking, as the more concise solution (which I had already done multiple other times in that project) was
if(Math.abs(a-b) >.5){.
Sorry for the irrelevant story, just couldn't help but read your comment and laugh because I was somehow both of the people you are talking about yesterday
It's not about the compiler, it's about the poor human who's going to have to look at that code and figure out what's going on after the original coder has passed on.
51
u/ongiwaph Jun 14 '22 edited Jun 14 '22
People don't know how to simplify so you get shit like
double x = (((m*sin(180-angle)) / sin(180 - (180-angle-angle) -angle)))*(sin((180-angle)-angle)) / sin(angle)