Re:Closures and Objects Are Equivalent (2013)
by Kamq on Tuesday November 22, 2022 @10:33PM
(#33714819)
> The way you call upon closures vs. objects also requires different syntax.
The syntax isn't what I'm talking about. I'm talking about the patterns.
> You however must write different code depending on which approach you choose
Only code that is different in syntax, not code that is conceptually different.
The code you write must be different, depending on if you write closures or objects. The way you call upon closures vs. objects also requires different syntax. You must write different code, you must "do it differently".
But I agree they do pretty much a similar thing. You however must write different code depending on which approach you choose, and depending on your language there are pros and cons to each.