3 ms·
This has not been my experience with the real world. Riddles and gotchas have played a very small role, so far.
by Fripplebubby 2y ago
This has not been my experience with the real world. Riddles and gotchas have played a very small role, so far.
- shermantanktop 2y agoUnfortunately they do show up in tech interviews. “What’s the correct way to delete an element from a Java array while iterating over it?” “Well I suppose you’d need to avoid invalidating the iterator state but I don’t recall the…” “BZZT!”
- johnisgood 2y agoI am not sure I understand. It seems very easy. You cannot directly remove an element from an array, you could create a new array that excludes that element. Arrays have a fixed size once declared, and I cannot imagine anyone who has written some code not knowing. :/
- HappMacDonald 2y agoI "have written some code" but it's been decades since I've done anything significant in Java in particular, and every language handles arrays (and/or data structures that get called "arrays") differently.
- johnisgood 2y agoThe terminology may be confusing, yes, although you would rather call them dynamic arrays or lists (like in Common Lisp). Plus you did say "decades", that is a long time nevertheless. I was not referring to people who have written some code decades ago, of course.
- shermantanktop 2y agoThe point of my fake narrative was that failing to recall trivia about exactly which method to call is considered failure. And btw, some arrays are fixed, but many languages call something an “array” which is dynamically-sized.