Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You probably won't need merge sort in your day to day programming, but closures (sometimes called lambdas), definitely. Every time you create a function that captures some variables outside its scope, congratulations, you've just used a closure.


Yeah, without knowing the term closure or lambda(which are not necessarily closures but could be as an implementation detail) I'm not sure how one would effectively communicate with others about code in a high-functioning environment using high-level languages. They are very widely used.


i now know of closures, and have actually used them intentionally, and rarely, and def not enthusiastically.

i lived mostly in the java world, and discovered closures when i was getting wacky results while playing around with a Clojure looping example.

then ran into similar situations about once a year when doing something in javascript -- usually passing some function for a callback, and needing access to 'this' in the original/calling scope - which only confused things when i needed access to 'this' in the (local?) function scope, too.

guess i'm not against closures -- they just seem mysterious to me.

ditto lambdas. they seem like a good way to write esoteric code, and write more error-prone/less-defensive code -- that, for instance, might be more likely to produce NPEs, and generally be less maintainable b/c of the focus on brevity instead of clarity, and be geared more towards expert users/coders instead of the generalists (like me) who are often brought in to maintain older code.


The point being here is that you can use them, but you don't have to necessarily know the term for them.

The only reason I know what a closure is in JavaScript is because I have heavily practiced for Frontend interviews.

I've been otherwise using them productively forever now.


That's true. The problem in this case is that they are weeding out applicants based on their knowledge of terminology. Talking about a concrete code sample may not fall into that trap.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: