Hacker News new | ask | show | jobs
by factotvm 674 days ago
I read Head First Design Patterns years and years ago. I'm a fan of the series. It's less for dummies and more using ideas from psychology to help you learn the material. I'll forever recall the power and conciseness of the Decorator pattern for computing the price of coffee drinks when there are as many variations as there are people. Starbuzz...

From my memory banks after close to 20 years:

    SoyDecorator: CoffeeDecorator {
        price: Cents { price + 90ยข } // Soy adds 90 cents to the price
    }
Edit: My regret is lending it to someone and never getting it back. I believe I might get this bundle.