3 ms·
I momentarily "forget" something that's only tangentially related to the problem at hand. It's usually something like "I've been working primarily in the new (
by DavidWoof 11y ago
I momentarily "forget" something that's only tangentially related to the problem at hand. It's usually something like "I've been working primarily in the new (or beta) version for the past three months, do you remember if you could do it this way in the current version, or is that a new feature and I have to do it this other way?".
The trick is finding something minor but indicative. Things related to testing frameworks or immutability are usually good IMO. Things that are incredibly important to good devs but afterthoughts to medium-level devs.
Lately, I've been asking about C# read-only autoproperties, which just came out 2 months ago. That's a really minor nano-feature in and of itself and sounds like an overly-technical syntax aside, but if you're a c# dev and you care about immutability then the lack of that feature was a constant annoyance and you would be intensely aware that it wasn't possible. So if you just don't know or don't care, that tells me something about what's important to you (The usually caveats about ensuring exactly what is the interviewer's primary daily language apply, but that's usually easy to determine).
- steven777400 11y agoI'm a C# dev and I had to lookup this new feature since it didn't ring a bell. I'm curious, why is this is a big improvement of just having "private set;" in the auto-property? I'm not being sarcastic, I genuinely want to know. (Incidentally, in terms of your filtering, I absolutely categorize myself as a "mediocre" or "medium-level" developer, but that doesn't mean I don't care about things. Just that their value may not be immediately obvious to me.)
- recursive 11y agoWith private set; you still have to invoke the setter in the constructor. For some cases, it's more readable to have the value of the property calculated in the same place that the property is declared. Also, when reading code, private set; doesn't guarantee that the property is reassigned elsewhere in the class. You have to read the whole class to verify that.
- briHass 11y agoIt is actually the equivalent of a private backing field that is marked readonly. public class Person{ private readonly string name; public Person(string name){ this.name = name; } } It's syntactical sugar that shaves a few lines of code off, particularly if you aren't setting values from parameters in the constructor and just want readonly values that are inherent to the class.
- DavidWoof 11y agoreadonly means the property is immutable. It can't be changed after construction, period. "private set" suggests it can be changed at any time, but only privately. Like I said, it's a small item, but if immutability is a primary concern to you during class design, then typing that "private set" constantly (or alternately, using a backing field) annoys you just a little bit multiple times a day. You're acutely aware of it and its workarounds. Most devs, even most "advanced" devs, don't think about immutability that much. I would never dream of using this as some kind of hiring filter when hiring devs, it's too obscure. But if I'm on the other side of the interview chair, I find it useful to know if your top devs, the people you rely on to evaluate others, care about things like that. OTOH, in practice, I think the question turned out to be not nearly as useful as some of the testing questions I've asked in the past.
- S4M 11y agoActually, I would use that technique of mentioning a cutting edge or rarely used feature of a language, not to discretely test the interviewer as he does, but to show off my knowledge and redirect the conversation on something I will be familiar.