5 ms·
That doesn't seem remotely like the same analogy to me. If we're talking about analogies, a much more accurate analogy, in my mind, would be "You can drive a c
by tene 10y ago
That doesn't seem remotely like the same analogy to me. If we're talking about analogies, a much more accurate analogy, in my mind, would be "You can drive a car, right? What do you use this lever here on the steering wheel for? You don't have any idea? What about this lever here between the seats? No idea about that one either? Sorry, I don't believe you're competent to drive a car."
- hyperpape 10y agoAgreed. I was just about to make analogy of pointing to the parking brake and asking "what's this?". Also, depending on the role (most people here write both Java and JavaScript), we're fine with "I'm not sure, but I always use it", or something vague about global variables.
- cerrelio 10y agoThe point is that using "vocabulary" tests to determine programming ability is nonsense. You can still write useful JS without knowing what the hell "var" does. And if you discovered that person doesn't know what it does, then it's trivial to correct.
- nadam 10y agoYou say that you can write useful programs in a language for 5 years without knowing how to declare local variables? Wow. Yes, I wrote useful programs using only global variables in C64 Basic when I was 12 years old, but it was much worse code than I write now.
- cerrelio 10y agoYou can. Global variables work like any other type of variable. If you don't like that style, that's a matter of opinion. Some people don't like Hemingway's terseness, and others don't like Faulkner's run-on stream of consciousness. However, they wrote things that "worked" and were "useful" to others (their publishers, their culture, the Nobel committee). At the end of the day, your software has to save or earn money. The salesmen and business heads don't care how pretty your code is, or if the people who developed it knew the language spec inside and out. Again, disqualifying someone who can "do" something but in a way you don't find palatable is the core reason why hiring engineers is such a clusterfuck.
- nadam 10y agoThe problem is that people who write Javascript for a living, who do not use 'var' are usually the people that do not even know what the difference between global and local variables are, and why global variables are dangerous. I have seen code that used global variables with the same name in totally unrelated different functions (the author probably thought these are local variables), and of course as one function called the other there was a bug because of it. Also, even if it were subjective whether to use local variables is good or not (this is not subjective I think, but there are other things that are really subjective), a team cannot hire someone who writes code totally differently than them. Even if a guy is brilliant but cannot fit into a team or into a codebase that needs to be developed together, then it is not wise to hire him. Of course I have seen companies who hire based on extremely tricky questions on certain programming languages, or when they only ask algorithmization, as if on a programming contest. These extremes are not very good in my opinion. Where I work we ask a little bit of everything, and we also work on real-world code with the candiadate together for a few days, before deciding.
- amag 10y ago> At the end of the day, your software has to save or earn money. The salesmen and business heads don't care how pretty your code is You're right, they don't care, but maybe they should. Pretty is one thing but maintainability is another. Global variables is one (out of many) thing(s) that decreases the maintainability of your code. It will make it more difficult to change something because other unrelated things will break. It will mess with your unit tests. It will mess with your head. All in all, bad coding styles (like the use of global variables), while quick in the beginning, will eventually grind your feature spouting code-monkey machine to a halt. Then the salesmen and business heads will care, and by then it will be too late. So, it's not just about taste. The number of whitespaces used for indentation is about taste. Good coding styles are not.
- cerrelio 10y agoI don't disagree. But scope is something that's easily taught. And the term "maintainability" is subjective. Your team decides what's maintainable. So showing someone the door because they aren't aware of your version of "maintainable" is silly. You can play this language-game all day with your candidates (and yourself), but it's largely a waste of time. I'd take someone who can "do" things, is willing to make mistakes, and willing to learn over someone who thinks "good coding styles" are set in stone and stubbornly adheres to them.
- ryuker16 10y agoIdk why you would hire somebody who didn't know JS well for a JS role.