Você pode ler este post em português também.
Write and maintain a code should be a pleasure task. Forget about complicated code, difficult things to be understood by human being.
If your program requires concepts that go beyond the classic algorithms, use comments to alert the (or that) future maintainer(s) about what he (they) need to know to maintain the code. Helps a lot to think that next maintainer would be someone else. Consider the simple story of that old KISS (Keep It Simple, Stupid).
Think about the English language. It has a dictionary and rules for syntax and semantics in your writing. There are thousands of resources to write different kinds of text: narratives, poetry and many others. And each type has its rules. In this analogy, each language (PHP, Python, etcetera) Is the English language. Algorithms and design patterns (this last is under the spotlights nowadays) are the types of text available. Each type of text (algorithms and design patterns) have their application, and we need to know and apply them – at the right time. They’re also the issue of preference: I avoid poetry as well I avoid certain algorithms and patterns.
Tell yourself what is a good text. For me, a good text is direct and well focused on its subject, more joinable facts than abstract ideas. Use simple words, the simplest that can express the required sense.
Today, any source code is written almost in the same way that we talk to someone. Manipulate data now has been freed us from those endless loops on tables that needed to be manually locked and indexed. Applications are now object oriented, need to be made for the web, for your phone, for the Xbox, smartphones, 52″ screens and so on.
The human-computer interaction is now an indispensable discipline, fractal-like by the software engineering. By the way, everything related to software development is fractal-like nowadays: We can complicate it to absurd levels, even when unnecessary. It’s common to hear about “abstraction data layers” in applications that never changed your DBMS in last 10 years (and whose supplier will be there for another 10 years).