6 ms·
This is weird. I would definitely fail your interview. Yet, at the same time, I've shipped over a dozen products, dozens of releases, consistently, to hundred
by ap22213 13y ago
This is weird. I would definitely fail your interview. Yet, at the same time, I've shipped over a dozen products, dozens of releases, consistently, to hundreds of thousands (if not millions) of people. I have a solid track record of clean, bug-free, efficient code. In 14 years of development, I've never had a bad review, and I've consistently ranked on the 'A-track' at all companies that I have worked for. I have low ego, work well with others, am a great teacher. Yet, my top priority is the craftsmanship of software: understanding user requirements and shipping great products that meet those requirements. My priority isn't being able to describe the intricacies of closures.
- bigtunacan 13y agoYou have to look at the candidate's overall performance in the interview; not the answer to a single question. Describing a closure is actually a great example of something many great software developers WON'T know based upon their prior domain experience. A strong Java or old school C/C++ programmer (yes I know C++11 has closures) may actually be an excellent candidate, but have no idea what a closure is. I would expect that a front end JavaScript developer, RoR dev, or anyone else "experienced" in a language with some functional support (Scala, Haskell, F#, etc...) should be able to explain a closure.
- jimmaswell 13y agoI can get anything I need to done in JS and I have no idea what a closure is. I've even written an emulator in it. Took me a little while reading to figure out what it is. Apparently it's just using vatiables in a lambda that are from a scope higher than it. I do that all the time, I just didn't know it had a special name. To be fair, I didn't know JS could do lambdas. I've only used them in C# and possibly Python. Well, I guess it's like a closure when you use functions as methods in objects in JS, since they can be defined with this.MyMethod = function(){...} which can then access the object's stuff.
- tonyarkles 13y agoYou've never passed a callback to a JS function?
- elbear 13y agoThat's an anonymous function not a closure. A closure references non-local environments and can "access those non-local variables even when invoked outside of its immediate lexical scope" as Wikipedia puts.
- bjterry 13y agoI don't understand your contradiction to the parent poster. All JavaScript functions are closures, including anonymous functions that don't reference any lexically-scoped variables, and even named functions at the top level, which close over the global environment[1]. Also, callback functions don't have to be anonymous functions, you can just as easily pass named functions. 1: http://javascriptweblog.wordpress.com/2010/10/25/understanding-javascript-closures/ http://javascriptweblog.wordpress.com/2010/10/25/understandi...
- elbear 13y agoI know that confusing anonymous functions with closures is a common misconception. I also know that callback functions don't need to be anonymous, but a lot of the times they are, at least in the JavaScript code that I've seen. Thank you for the clarification that all JavaScript functions are closures though.
- mattmanser 13y agoC# people tend to use lambda to mean lambdas, closures and sometimes anonymous functions. Javascript people use closure to mean lambdas, closures and sometimes anonymous functions. Ask two programmers the difference between lambdas, closures and anonymous functions and be prepared for a different and probably wrong explanation from most of them. Including me. And that's the only reason you don't know what a closure is, if you hung out around javascript programmers a bit more in RL or online you'd have heard it constantly. If it was described to you, you'd know what it is.
- GhotiFish 13y agoFunny thing: I would pass his interview, I know everything he asked and have opinions on everything he asked, but I am so terrible at javascript + html + css. I HATE doing that kinda work. Those three freaking languages man.