Why you should treat code as an Essay

Following my interest in programming languages, coding and Ruby (more recently), I’ve been reading some text by Yukihiro Matsumoto aka Matz 🙂
Yukihiro is a Japanese computer scientist and software programmer best known as the chief designer of the Ruby programming language and its reference implementation. (See Wiki.)
He is a fellow of Rakuten Institute of Technology, a research and development organization in Rakuten Inc.

Yukihiro Matsumoto

Yukihiro Matsumoto
松本行弘 (まつもとゆきひろ)

Here some some interesting thought and ideas from Yukihiro’s writing, that I read early this week:

“Most programs are not write-once. They are reworked and rewritten again and again in their lived. Bugs must be debugged. Changing requirements and the need for increased functionality mean the program itself may be modified on an ongoing basis. During this process, human beings must be able to read and understand the original code. It is therefore more important by far for humans to be able to understand the program than it is for the computer.”

“Computers can, of course, deal with complexity without complaint, but this is not the case for human beings. Unreadable code will reduce most people’s productivity significantly. On the other hand, easily understandable code will increase it. And we see beauty in such code.”

“Brevity is one element that helps make code beautiful. As Paul Graham says, “Succinctness is power”. In the vocabulary of programming, brevity is a virtue. Because there is a definite cost involved in scanning code with the human eye, programs should ideally contain no unnecessary information.”

“The real shortcut for developing elegant code is to choose an elegant programming language. Ruby and other lightweight languages like it support this approach.”

I’ve personnaly coded on the .NET stack using C# for a long time now, and I think that C# also allows brevity and beautiful code when properly used.

“The DRY principle. Don’t Repeat Yourself. If the same code exists in multiple places, whatever you are trying to say becomes obscured.”

if (Beautiful code == Juhu Beach, Mumbai)

if (Beautiful code == Juhu Beach, Mumbai)

“Most people find it difficult to embrace new concepts or change their ways of thinking. Instead, many prefer to continue suffering rather change. Most people are unwilling to replace familiar tools or learn a new language without a good reason.”

“Compared to other contemporary programming languages, Ruby does sometimes look old-fashioned. But it’s important to keep in mind that “never be too innovative” is also a key to creating beautiful code.”

“Mike Cowlishaw, who designed the Rexx scripting language at IBM, once pointed out that because language users are more common than language implementers, the needs of the latter must give way to those of the former.”

“When programmers are forced to do something against their intentions, for the tools’ sake,the result is stress. This stress negatively affects the programmer. The end result is far from happiness, and far from beauty as well, according to our definitions of beauty in code.”

“Humans are more valuable than any tools or languages.”

“Computers should serve programmers to maximize their productivity and happiness, but in reality, they often increase the burden instead of the lightening it.”

“If you make sure you have fun writing and reading code, you will experience happiness as a programmer.”

“Brevity, familiarity, simplicity, flexibility are the pillars of “beautiful code”.  Balance is the element that allows them to mix together.”

More Links:
Ruby Interpreter
Martin Fowler explaing using the Rake Build language
Juhu Beach

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s