4 ms·
I know approximately what a closure is, and I am sure I have used such constructs instinctively in my work many times. I don't have a formal Cs education, but h
by ramraj07 5y ago
I know approximately what a closure is, and I am sure I have used such constructs instinctively in my work many times. I don't have a formal Cs education, but have never failed to not be able to finish my coding work because I didn't know stuff.
Once a guy asked me to write out merge sort on a whiteboard and I couldn't. I didn't get the job. Surprisingly I'm doing just fine in my current position and am very productive (as much as I may say so myself) and have never heard complaints from anyone that I don't know what I'm doing.
So if you don't see a CS degree in the resume then don't ask what a closure is or to implement a merge sort in the interview. Ask them to solve a real problem. The top computer scientists didn't discover the merge sort for years or decades and you want me to figure it out on the spot? Or you just expect me to memorize useless shit like this? Give a problem a programmer would encounter on a day to day basis that wouldn't need a lot of googling. Let them figure out how to solve it and see if it works for you.
- Leherenn 5y agoYou 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.
- Rapzid 5y agoYeah, 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.
- deleted 5y ago[deleted]
- mewpmewp2 5y agoThe 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.
- imtringued 5y agoThat'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.
- readonthegoapp 5y agoi 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.
- tsukikage 5y ago> "I don't have a formal Cs education, but have never failed to not be able to finish my coding work because I didn't know stuff." ...that statement looks kinda sus. In a code review I'd maybe get you to simplify it or break it up to confirm the negatives end up meaning what you wanted them to mean.
- dominicjj 5y agoHe's always succeeded (never failed) at not finishing his coding work because he didn't know things. Probably not what was meant.