On Systems Programming

Dated Nov 21, 2020; last modified on Mon, 05 Sep 2022

Garbage Collection

Garbage Collection is about simulating a computer with infinite memory. Consequently, if you have more RAM than your program will ever need, then a null garbage collector is a valid one.

Traits of Beautiful Code

is the chief designer of Ruby, and thus the frequent illustrations and praises for Ruby.

How do other chief designers explain their rationale? For instance, what would Java’s designer say to ’s criticism?

Brevity. The programmer should not have to add boilerplate unrelated to the task at hand. In this sense, Ruby’s print "Hello World\n" is more beautiful than Java’s:

public static void main(String[] argv) {
    System.out.println("Hello World");
}

Does Java’s boilerplate for Hello World offer advantages to more succinct languages like Ruby?

Brevity can also mean the elimination of redundancy. While some argue that redundancy lowers cost when interpreting meaning, redundant code increases cost because of surplus information.

Familiarity. The cost of changing one’s ways of thinking is far higher than is commonly thought. Ruby is beautiful in that it’s extremely conservative in its idioms, e.g. the lack of Smalltalk’s innovative object message passing.

Simplicity. Language implementers should not aim to keep the language simple and clean, because that complexity is shifted to the programmers using the language. For example, Ruby’s Rakefiles (used by Ruby’s Rake build tool), are written in Ruby!

Flexibility. Freedom from enforcement from tools. Programmers should not have to add things just because the tool mandates it.

Balance. Brevity, conservatism, simplicity, and flexibility need to come together to ensure a beautiful program.

References

  1. Everybody thinks about garbage collection the wrong way. Raymond Chen. devblogs.microsoft.com . Aug 9, 2010.
  2. Re: Does memory leak? Kent Mitchell. Rational Software Corporation. groups.google.com . Mar 31, 1995.
  3. Beautiful Code: Leading Programmers Explain How They Think > Treating Code As an Essay. Yukihiro 'Matz' Matsumoto. Jul 17, 2007. ISBN: 978-0596510046 .