The Case for Simplicity
In our monthly meeting (this almost implies some kind of professionalism that doesn’t actually exist) at the linuxbbq irc, the subject of obfuscation came up. While we’ve often discussed avoiding brittle algorithms just to catch edge cases, the flip to this would be that any implementation (ANY of them) should be easy enough to understand that the users who would fall under ‘edge case’ should be able to figure out how to modify things to suit their needs.
I’ve seen simple programs written to be confusing and complex programs written to be easily understood. The latter of which should honestly be the goal of any programmer. I cannot even begin to stress how important being clear and concise is. While it makes troubleshooting your own work easier, it also helps anyone who might have a project based on similar concepts, those who fork your project for their own purposes, and even for people who are just looking to understand how something works. A well written example can often be more educational than an explanation.
James spoke about the usefulness of well placed white-space and commenting, and how breaking things up into digestible portions makes it easier on someone to make sense of even if they are unfamiliar with the language. For FOSS projects that are written to be simple, this can allow the user to not only use but modify your work to fit their particular purpose. I personally believe that this allows a project to grow organically to fill needs.
I simply don’t understand why someone would not look for the simplest way to present a concept. It’s also worth mentioning that shorter isn’t always simpler. It’s better to be verbose without adding layers of abstraction if at all possible. If I’m missing some advantage to making code hard to understand, then please share it with me. Until such time as a good reason for making things more complex than they should be is presented to me, then I will make it a personal goal to make sure that anything I do is easy to understand and modify.