The Hardest Part of Programming

... is easily naming things and clearing caches.

There is nothing that will trip you up more than how to clear something out of the cache that you spent a while figuring out how to cache in the first place.

Then there's naming things. Sure you could go with temp and all sorts of non descriptive names like that, but how does that help the next person who comes along to read your code? It may as well be a non-romance language to someone who speaks a romance language natively. It's not readable.

Your code should always be legible, no matter who is looking at it. Whether it be your ex-girlfriend or your brother who is a freshman in high school, good code can be understood by anybody who reads it.

I don't mean that anybody who reads your code should be able to understand what each line of code does, but by reading variable names and function names any person on this planet should be able to understand roughly what a function does, or what a variable contains.

If the average human wouldn't be able to read your code and understand roughly what it accomplishes, you should consider re-writing your function to be more clear and maintainable. Your code should be as readable as a sentence in the English language.

Okay, maybe that's too ideal. But consider the following lines of code:

[print(y) for y in x for x in l]

vs.

for user in users:
    for friend in user.friends:
        print(user.name)

Not sure that python syntax is correct above, but I'm sure you understand the point. The second block of code is far more readable to the average person than the nested list comprehension that is in the first block.

Sure, the first block may be fewer lines of code, but if you were a new hire with little Python experience which block of code would you rather run across?

Every line of code you write should be written with the goal of being maximally maintainable. Sure, you might be able to do it in fewer lines of code, but would you rather debug a problem in production that involves easily read code or the fewest lines of code?

Sometimes writing the fanciest/least code possible isn't the best solution. The best programmer on your team will write code that can be understood by every other member of the team, no matter their experience level.