SHARE:
Uncategorized

Programming, Postmodernism, and Ruby’s Self

Flatiron School / 24 July 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:

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: “[In the past] 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.”

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: [they said] `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.”

 

0
0
1
26
149
Flatiron School
1
1
174
14.0

Normal
0

false
false
false

EN-US
JA
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Table Normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:””;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}

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.

Previous Post Starting Out With JQuery Mobile in Rails Next Post