4 ms·
Well, I feel pretty stupid now.
by AndrewMoffat 16y ago
Well, I feel pretty stupid now.
- smcl 16y agoYep, me too. I'm pretty nervous at interviews already, so I reckon I'd melt down if I was presented with some of the questions without having vaguely prepared. But I suppose that's why the page is there, not so we can feel stupid but so we can re-engage that "solve arbitrary problem X" mentality.
- Stormbringer 16y agoProblem is, when would you ever do any of that in the real world? Has anybody ever needed to reverse a string in place since the 80s? (Demo scene excluded of course, they swallowed a different colour pill from the rest of us) I'm aware for instance of the XOR trick to swap to variables in place. I think I used it once in the last ~20 years, and really only then because I was being pleased with my excessive cleverness. These days I wouldn't bother, because it would just make the code fractionally harder to read, it makes for a speed-bump for the mind, whereas spelling it out with a temporary variable lets your brain keep cruising at interstate speeds.