Back to Blog

Programming, Postmodernism, and Ruby’s Self

Posted by Flatiron School on July 24, 2013

The following is a guest post by Kirin Masood and originally appeared on her blog. Kirin is currently a student at The Flatiron School. You can follow her on Twitter here__.

Upon first glance it seems as if coding and programming are subjects that exist independently of all other subjects. Closer observation, reflection, and a little bit of research, however, all bring light to the idea that programming actually overlaps with many disciplines.

Larry Wall believes that programming intersects with philosophy, and that languages such as Perl are actually manifestations of postmodernism. In a talk titled, “Perl, the first postmodern programming language” Wall thoroughly lays out his all-encompassing argument clearly defining modernism and postmodernism. I’ve attempted to produce a very basic and watered down distinction between the two below through quotes and examples used by Wall in his talk.

I. Separating Modernism and Postmodernism

This section’s purpose is to provide a tiny bit of information about the definitions of and differences between both modernism and postmodernism.

Chart that highlights some of the differences between the two:

Blog post image: tumblr_inline_mqg9bdhRLP1qz4rgp.jpg

Analogy
Modernism: “If all you have is a hammer, everything starts to look like a nail. That’s actually a Modernistic saying.”

Postmodernism: “In contrast, postmodernism puts the focus back onto the carpenter. You’ll note that carpenters are allowed to choose whether or not to use hammers. They can use saws and tape measures if they choose, too. They have some amount of free will in the matter.”

Real World Example
Modernism: “ We had to have a whole president, or no president, so people conspired to make sure we kept a whole president (even though there was probably just as much hanky panky going on back then as there is now).”

Postmodernism: “The public, and later the Senate, chose to evaluate Bill Clinton’s morality separately from Clinton’s fitness to govern.”

Blog post image: tumblr_inline_mqg9dpy15F1qz4rgp.jpg

II. Postmodernism in Programming Languages

What makes lan­guages like Perl and Ruby post­mod­ern is the idea that the user is priv­ileged (or burdened, per­haps) rather than the pro­gram or ma­chine. The user is priv­ileged be­cause these lan­guages allow the user to have a vari­ety of tools at their dis­posal, and they are free to do whatever they please. The pro­gram­mer has ex­tremely flex­ib­il­ity. This also shifts the focus away from the ac­tual prob­lem that needs to be solved and puts the focus on the pro­gram­mer’s tools. In con­trast, mod­ern pro­gram­ming con­sists of the pro­gram­mer bend­ing to the will of the pro­gram, ma­chine, or prob­lem. Wall claims that mod­ern com­puters (i.e. lan­guages be­fore Perl) were. “really rather pat­ron­iz­ing: `I’m sorry Dave. I can’t allow you to do that.” Lan­guages such as Perl and Ruby change the dy­namic between user and ma­chine con­sid­er­ably.

III. Ruby’s Self: Postmodern Programming In Action

In Ruby there is a keyword called self. If you use this keyword on an ob­ject then you can gain ac­cess to the ob­ject that is at­tached. Ba­sic­ally, a ruby ob­ject un­der­stands what it is by nature. The fact that an ob­ject in ruby has an iden­tity and can re­cog­nize that it has its own iden­tity can be con­sidered an ex­ample of post­mod­ern cod­ing prac­tices. This pro­cess of a Ruby ob­ject re­fer­ring to it­self is de­tailed in Jimmy Cuandra’s blog, and the image below is an ex­ample he uses in his blog. He ex­plains the ex­ample quite well, “in the con­text of a class, self refers to the cur­rent class, which is simply an in­stance of the class Class. De­fin­ing a method on self cre­ates a class method.”

 

Blog post image: tumblr_inline_mqg9fiWOA51qz4rgp.png

If your interest is piqued by this topic then you should definitely take some time to really read and digest the words of Larry Wall on this subject. I highly recommend it.

About Flatiron School

More articles by Flatiron School