On Monday, 20 July 2015 at 18:17:18 UTC, Adam D. Ruppe wrote:
Quick, what does this loop in this function do?

void PanelBar::RepositionExpandedPanels(Panel* fixed_panel)

I'm willing to guess it repositions the expanded panels.... named functions are the best abstraction.

Well, yes, but crap code with a good name is still crap code. If you look at the _how_, it rapidly falls away to insanity. Sean Parent's talk discusses how he was able to turn this function, which was over 100 lines of nasty loops, into two std::algorithm calls.

Reply via email to