Case study on ranges and lazy evaluation

Matt Kline via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon Jul 20 11:32:34 PDT 2015


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.


More information about the Digitalmars-d-announce mailing list