Programming, Postmodernism, and Ruby’s Self
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 […]
Reading Time 3 mins
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:
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.”
II. Postmodernism in Programming Languages
What makes languages like Perl and Ruby postmodern is the idea that the user is privileged (or burdened, perhaps) rather than the program or machine. The user is privileged because these languages allow the user to have a variety of tools at their disposal, and they are free to do whatever they please. The programmer has extremely flexibility. This also shifts the focus away from the actual problem that needs to be solved and puts the focus on the programmer’s tools. In contrast, modern programming consists of the programmer bending to the will of the program, machine, or problem. Wall claims that modern computers (i.e. languages before Perl) were. “really rather patronizing: `I’m sorry Dave. I can’t allow you to do that.” Languages such as Perl and Ruby change the dynamic between user and machine considerably.
III. Ruby’s Self: Postmodern Programming In Action
In Ruby there is a keyword called self. If you use this keyword on an object then you can gain access to the object that is attached. Basically, a ruby object understands what it is by nature. The fact that an object in ruby has an identity and can recognize that it has its own identity can be considered an example of postmodern coding practices. This process of a Ruby object referring to itself is detailed in Jimmy Cuandra’s blog, and the image below is an example he uses in his blog. He explains the example quite well, “in the context of a class, self refers to the current class, which is simply an instance of the class Class. Defining a method on self creates a class method.”
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.
Posted by Flatiron School / July 24, 2013
Learn to Code Python: Free Lesson for Beginners
Sabrina Hernandez: From Dental Tech to UX / UI Product Designer
After 7 years as a dental tech, Sabrina Hernandez was ready for a change. She enrolled in Flatiron School and has since pivoted into a career in UX / UI Product Design.