News for hackers. Stuff that matters.
Re:If statements considered harmful by egwynn on Tuesday March 14, 2017 @11:37AM (#13868361)
In this case, I prefer FP-style destructured pattern matching (e.g. https://doc.rust-lang.org/book/patterns.html#destructuring) to OOP-style method overloading (FTA). In the FP style, the compiler can make sure you handle all possibilities.
Re:If statements considered harmful by rdnetto on Tuesday March 14, 2017 @09:52PM (#13873174)
It's worth noting you can implement something similar in OOP languages using Church encoding: http://blog.higher-order.com/blog/2009/08/21/structural-patt...