HackerRank also taught me how to write pretty clever code. Clever, unreadable, one-line code.
Now I'd rather write 3 lines of code and spend half a second reading the function than writing 1 line of code and spending 10 seconds to read what I was doing.
As you say, coding is for humans.
Agreed. Clever code makes you feel smart but doesn't do other the things that code should.
I feel stupid explaining code, so I tend the other direction. If I'm explaining then I feel like I did it badly and it's very embarrassing to me. Funny how we as humans see the same thing, but view it very differently.
I tried hackerrank and after two of those kinds of questions I quit for the simple reason that I didn't want to feel like an idiot. Opaque code is just tiring and IRL I always just ask. It's not worth my time doing it any other way.
Thank you so much for shining a light on this issue. It needs more attention and I thank you for taking the time to call them out on a very bad practice.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.