3 ms·
The tech lead who doesn't know `len()` but claims to know Python? Yes, they're incompetent. It's okay; it's a common problem in our industry, and easily remedie
by lidHanteyk 7y ago
The tech lead who doesn't know `len()` but claims to know Python? Yes, they're incompetent. It's okay; it's a common problem in our industry, and easily remedied by study and practice.
Chinese is not a great example. Native speakers have trouble reading and writing their own language; it is so complicated that people cannot remember how to write commonly-spoken words or how to read. [0][1] (Choice moment from [1] is when a university student says that Chinese literacy is as difficult as English!)
Perhaps we can do better as a community to design better languages, but also we should not condone people claiming that they know the languages when they clearly don't. Yes, Python could be easier; no, Python is not that hard.
[0] https://www.youtube.com/watch?v=HQh1_zyig1M https://www.youtube.com/watch?v=HQh1_zyig1M
[1] https://www.youtube.com/watch?v=zxHskrqMqII https://www.youtube.com/watch?v=zxHskrqMqII
- drizze 7y agoIn their defense, some other languages make the length of a string an attribute/property on a string instance. Python feels like the odd one out here making it a free function you must pass an instance to. If the tech lead spent a lot of time working with another language that made the length an attribute, I think it would be reasonable for them to need to look it up often. https://apidock.com/ruby/String/count https://apidock.com/ruby/String/count https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#length() https://docs.oracle.com/javase/7/docs/api/java/lang/String.h... https://developer.apple.com/documentation/swift/string/3003522-count https://developer.apple.com/documentation/swift/string/30035...
- Eleopteryx 7y ago>Yes, they're incompetent. So you feel confident in asserting that, at the time that the person made that tweet, the quality of the Python code that they shipped was poor, or it took an inordinate amount of time to produce? All because they had to look up len()?
- commandlinefan 7y agoActually, yeah. That one jumped out at me, too: that’s kind of like saying “I know how to drive a car, but I always have to look up which one is the gas pedal and which one is the brake”. If you’ve done _anything_ in Python, the length function is ingrained in your brain, so if you honestly don’t remember it, you just haven’t written any Python (or it’s been more than 10 years).
- jcranmer 7y agoI routinely use several languages, and am constantly forgetting which ones use .size() and which ones .len(). It's not worth committing to memory because, if I get it wrong, the compiler will tell me "what is this function of which you speak?", and I will simply turn around and use the other one, at which point it starts compiling again, wasting me at most a minute of my time. Furthermore, I should point out that it's not out of the imagination that someone wouldn't use len() all that heavily. Python has functional operators that let you do map/reduce-style operations on lists, strings, dicts, etc. that don't require you to use length all that much. My most recent python script only uses len() in two places for more robust error reporting.
- commandlinefan 7y agoWell... try not to take this personally, but... that means that you're not really an expert in Python, which is what (I assume) the interviewer in the linked post was looking for. You're capable in several languages, and may be an expert in one or more of them, but if they're looking for Python expertise, asking you how to find the length of a string is a good way to get a feel for how much time you're going to need to get to where you can really be trusted to produce mission-critical Python software (which may not be a deal breaker, if you're good at a lot of other things).
- lleolin 7y ago>that’s kind of like saying “I know how to drive a car, but I always have to look up which one is the gas pedal and which one is the brake” OK, I agree, it's kind of like saying that. But it's also kind of not like saying that. Incompetence in driving and incompetence in software development are measured in completely different ways for completely different reasons. In driving, notions of what you definitely should know in order to qualify as "competent" extend from the intrinsic risk to other people's well-being. You can't simply transpose those notions onto the low-stakes sandbox environment that is software development. In software development, process is only important as far as it hinders or helps to deliver good code; competence should be dictated purely by results. All of the actual competence of driving comes during the actual process part; successfully reaching your destination is actually considered to be less important than simply not fucking anything up on the way there. Sometimes I pick up a video game that I haven't played in weeks, and perform actions incorrectly because the button layout has been overwritten by the button layout of a similar and more recent game. It would foolish to say I'm wholly incompetent at either game; I still have a strong concept of what I should be doing and what I intend to do, it's just that I'm fumbling a bit at the specifics of executing my intent. Am I incompetent for looking up the button layout? Am I incompetent, but only for the 1 hour that it takes me to get back in the groove of things? Declaring someone is incompetent is a bold assertion to make from such limited information. At the end of the day you either deliver good code in good time or you don't. I would be extremely reluctant to determine this guy can't deliver good code because he had to look something up. Figures no one will hire me.