re: What habit do many senior engineers have that juniors should try to avoid adopting? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Avoiding clever code. You feel smart writing clever code, and you may even justify it by saying it's less code. However, code should be explicit a...
 

I agree.

But writing clever code for fun can be pretty fun.

As long as other people aren't ever going to be burdened by reading your code-golfed 5 character insertion sort, I think it's fair game :)

 

I was going to mention that. When using something like Codewars, it's really easy to see clever solutions by others and then possibly get into the habit of always trying to be clever too.

It is fun to try to be clever on stuff like that, but it's almost never necessary—at least not to that degree.

I've been doing that a lot in CodeWars. Putting the entire code in a single return statement. I'm talking about converting a string to an array, running map and reduce on it, then converting it back to a string in a single return statement.

Yea exactly what I'm talking about :) It's fun right!

code of conduct - report abuse