News for hackers. Stuff that matters.
Re:Functional thinking: Functional design patterns, Part 2 by hardboiled on Wednesday April 04, 2012 @03:23PM (#3799361)
Not sure the example of fitting a square peg into a round hole is a good one to demonstrate the adapter pattern.

Also, would a Java programmer really reach for that pattern first for this example?

Re:Functional thinking: Functional design patterns, Part 2 by headbiznatch on Wednesday April 04, 2012 @04:10PM (#3799600)
I feel like a total idiot right now, checking algebra wikis and shit to make sure I am not insane, but isn't that inequality wrong? Wouldn't the listed formula's value need to be less than the radius SQUARED? Or: w * sqrt(2) / 2 < r?
Re:Functional thinking: Functional design patterns, Part 2 by ismarc on Wednesday April 04, 2012 @05:43PM (#3800006)
If you look at the implementations, they didn't include that it's the square root of the formula that must be less than or equal to the radius in the initial math overview, but did it right in the code.