Re:Push ifs up and fors down
by BenFrantzDale on Wednesday November 15, 2023 @10:55PM
(#38285693)
I agrée with them and with you. It looks like they work in some poor language that doesn’t allow overloading. Their example of `frobnicate`ing an optional being bad made me think: why not both? `void frobnicate(Foo&); void frobnicate(std::optional<Foo>& foo) { if (foo.has_value()) { frobnicate(foo); } }`. Now you can frobnicate `Foo`s and optional ones!
[ Parent
| on HN ]
Re:Push ifs up and fors down
by leduyquang753 on Thursday November 16, 2023 @05:02AM
(#38287640)
Indeed they are working in a poor language that doesn't allow overloading. It's Rust. :-)