The pursuit of (happy|plain)ness

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).

The subject of this post is a request: I ask to all people involved in a software project to keep things simple, readable and explicit. Tim Peters (a Python guru) has said that. Take a time to read books about algorithms and design patterns. Unlock your creativity. When you develop for the web, think about accessibility, and about it yet, cross your browser boundaries: In fact, the future of your application is unpredictable, and you never know when it will be used inside a big screen or in a cellphone. Use javascript very carefully (always in a suspicious way, and if you can, avoid it).


One thought on “The pursuit of (happy|plain)ness

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s