I Finally Understand Closures
iode.co.uk
I Finally Understand Closures
1–10 of 22 posts
Re: I Finally Understand Closures
#2Re: I Finally Understand Closures
#3Why are there so many of these "I finally understand [cloures | pointers | misc CS concept]" posts? I mean these are pretty fundamental concepts that any first year CS student should be able to grasp pretty quickly.
I think it's interesting to see how other people solve problems.
Re: I Finally Understand Closures
#4But, the main idea is right on the mark. The point is that the natural structure of the code (that uses closures) is completely impossible to achieve without closures.
Great stuff! I think the author gets it. :-)
Re: I Finally Understand Closures
#5Why are there so many of these "I finally understand [cloures | pointers | misc CS concept]" posts? I mean these are pretty fundamental concepts that any first year CS student should be able to grasp pretty quickly.
Pointers are easy if you understand the basics of how a computer works and know a language like C.
Likewise, closures are easy when you know a little about functional programming and understand first class functions.
Re: I Finally Understand Closures
#6Why are there so many of these "I finally understand [cloures | pointers | misc CS concept]" posts? I mean these are pretty fundamental concepts that any first year CS student should be able to grasp pretty quickly.
Re: I Finally Understand Closures
#7Why are there so many of these "I finally understand [cloures | pointers | misc CS concept]" posts? I mean these are pretty fundamental concepts that any first year CS student should be able to grasp pretty quickly.
I think the problem arises when people hear about a concept and try to understand it without knowing the foundation required to really understand it. Pointers are easy if you understand the basics of how a computer works and know a language like C. Likewise, closures are easy when you know a little about functional programming and understand first class functions.
Re: I Finally Understand Closures
#8Re: I Finally Understand Closures
#9Maybe now he also understands why objects are often preferable. Closures are liked handicapped objects. Names are resolved when the closures is created, not when it is called. This is not nearly as flexible as an object, where names are resolved when the function is called.
Re: I Finally Understand Closures
#10Which, really, still doesn't explain what he means. That and for the love of god, I hate things such as Clojure. Call me a stick in the mud, but I like languages in which I don't have to mentally expand 80% of words.