3 ms·
"Closures are far more confusing." IMO (obviously this is subjective) this is not true but it depends upon whether you mean confusing to use or confusing to un
by georgemcbay 15y ago
"Closures are far more confusing."
IMO (obviously this is subjective) this is not true but it depends upon whether you mean confusing to use or confusing to understand the full implications of a thing under the hood.
Closures are pretty easy to start using for just about any halfway decent programmer if you lay off the theoretical underpinnings and just show them: here do this, and this will happen. Actually understanding how they function is another matter, but to just start using them is fairly simple assuming the language you are using supports them natively.
Pointers on the other hand are a fairly simple concept and unlike closures there is really no depth to the concept, but because most people's brains don't deal well with indirection beyond one level, pointers are very "tricky" when it comes to training your brain on how to use them correctly even after you understand the concept.
Closures are easy to use, hard to grok; pointers are easy to grok, hard to use, so which is more confusing depends a lot on what you mean by confusing.