2017-02-24 23:00:00 hackers

Programming Language X is my Religion

Hello. My name is Breanna. I study programming languages.

PG != PJ

Before we begin (cough cookie-cutter-y answer the specific questions that have nothing to do about how the readings made me feel or the englightenments they gave me), I would like to point out a discrepancy I found in good ole PG's writings.

From my previous post, on PG's Hackers & Painters:

Graham sets up computers as "a medium of expression", but I do not think
that that's one hundred percent accurate. Sure, you can use a computer to
express yourself. But that's *so* not what computer science is all about.
Do you think physics is a way to express yourself? Do you think pure
mathematics is a way to express yourself? Heck, philosophy isn't really
even a way to express yourself- all philosophers do is ponder about the
world and what it is to know and be and all that jazz. Computer science is
not just a way to express yourself because it is not just a medium. It is a
philosophy, a study of change and theoretical concepts meant to explain the
world.

Now, from Graham's Beating the Averages:

Lisp is worth learning for the profound enlightenment experience you will
have when you finally get it; that experience will make you a better
programmer for the rest of your days, even if you never actually use Lisp
itself a lot.

This is the same argument you tend to hear for learning Latin. It won't get
you a job, except perhaps as a classics professor, but it will improve your
mind, and make you a better writer in languages you do want to use, like
English.

But wait a minute. This metaphor doesn't stretch that far. The reason Latin
won't get you a job is that no one speaks it. If you write in Latin, no one
can understand you. But Lisp is a computer language, and computers speak
whatever language you, the programmer, tell them to.

So if Lisp makes you a better programmer, like he says, why wouldn't you
want to use it? If a painter were offered a brush that would make him a
better painter, it seems to me that he would want to use it in all his
paintings, wouldn't he?

Woah woah woah there, PG. Sounds like you changed your mind? Computers aren't a medium of expression, but rather programming languages?

Now, this is better. I agree completely that the language is your medium of expression. Programming languages are what you use in order to achieve a goal, whether it be building software or hacking the government or teaching children and minorities how to code. Programming languages are both the paint brushes and the paint: languages are your tools and your medium. How? Well, languages being tools are obvious. The only way to interact with a computer is through coding in some language, all the way down to binary (0s and 1s are just encodings, I would argue that makes it a language). Obviously your language is a tool. But the medium... that's a bit more tricky.

Medium: an agency or means of doing something - Dictionary.com

Exercise: go code mergesort in C. Now code it in Python. Now compare the two.
Assuming you embraced each language (if you didn't, then the lack of power in your implementation completely rides on your shoulders), the code should look different. In fact, you should have used constructs specific to the language to not only embrace the ideology of the language, but also to maxmimize effectiveness. You used the lanuages as a medium to solve your problem, and just as the languages were different, the mediums were different.

Now here is an idea I think "programming languages as tools" miss: languages are more than just tools and mediums, languages are ideologies.

Every language has been designed with a purpose, to solve a problem. But here is where the painter's paintbrushes metaphor falls short: every language has a community with specific ideologies that form around the language, the use of the language, and the optimization of the language. Paint brushes don't have that, now do they.

Programming languages are more than natural language as well, because natural languages do not influence how you think about an idea, how you solve a problem and theorize ideas. Programming languages do just that. Learning and using (by 'using', I mean really using) a programming language is like thinking about the world through the eyes of another religion. I think this makes the most sense. Though I have a minor distaste for organized religion and cults in general, I am a very spiritual person and I can understand the different mindsets of a few religions (World Religions is my favorite course this semester btw). Actually using (embracing) a language that's different from your comfort language (we all have one) is like embracing the viewpoint of another religion. For me, I think in Python. When I solve a problem or have an idea, it's completely influenced by Python. Now, when I try to program in C, I always default back to Python... sometimes on accident because I am used to Python, sometimes because I do not know the way in C and the Python way is really the only way I know, and sometimes because it's hard to understand C and I get a little closedminded every once in a while because it's only human nature.

Now replace 'Python' with 'Christianity' and replace 'C' with 'Hinduism' (and edit the helper verbs bc life isn't perfect).

When I solve a problem or have an idea, it's completely influenced by
Christianity. Now, when I try to think in regards to Hinduism, I always
default back to Christianity... sometimes on accident because I am used to
Christianity, sometimes because I do not know the way in Hinduism and the
Christian way is really the only way I know, and sometimes because it's
hard to understand Hinduism and I get a little closedminded every once in a
while because it's only human nature.

Works, huh? That's because it's true.

Now, PG seems to get a bit closer to the light when he says programming languages are not merely technologies, but habits of mind as well, but I think he still has some englightment left to obtain. Now, I do think programming languages mirror religions in terms of how you view the world, but I think they do follow the painters metaphor in terms of using a language that most benefits you for the problem you are trying to solve.

If you have a choice of several languages, it is, all other things being
equal, a mistake to program in anything but the most powerful one.

I feel like 'powerful' is the wrong word. I think it should be replaced with 'effective', because power is not always what you need. Also, as Jeffrey mentioned, PG uses the word 'powerful' to mean something other than 'having great power or strength.' 'Effective' is the more proper term, and obviously you wouldn't use a roller paint brush to paint in watercolor, just like you wouldn't program in Clojure to hack the Linux kernel. I think most of my classmates mimic this idea, so I will not reiterate.

Questions

Discuss the idea behind the statement: "programming languages are not just
technology, but what programmers think in." How does a programming language
impact the way you tackle a problem or construct an application?

Did that.

Discuss whether or not "programming languages vary in power." Are some
languages intrinsically more powerful than other languages? What makes one
language better than another?

Did that?

Discuss your experiences with alternative languages such as Lisp, Scheme,
Erlang, Haskell or any non-mainstream language. What drew you to these
languages? Did you find them to be useful? Do you still use them? Explain why
or why not.

So I worked a bit with Prolog during my first internship. It was my first experience with logic programming and it was interesting. I didn't get to do much, but that experience was part of my introduction to programming languages as a research area (since that summer was my first experience with programming languages research), so I am forever grateful. Additionally, I did a bit of Scheme, like everyone, in Paradigms, but I am going to go back to functionaly programming soon. I had a bit of an epiphany during the reading:

If you understand how compilers work, what's really going on is not so much that Lisp has a strange syntax as that Lisp has no syntax. You write programs in the parse trees that get generated within the compiler when other languages are parsed.
Of course! Of course! It all makes sense! Why didn't Collin tell us this during paradigms? Why wasn't I able to figure it out, now that I have taken Compilers? It's beautiful, and it makes perfect sense. It makes sense in terms of why you would ever use it, but also why it was ever created to begin with. I realized I have the foundations of programming languages, the foundation of programming language implementations found in parse trees, right at the tip of my nose and I was so ignorant. Beautiful.

Finally, consider what will programming languages look like in 100 years. What
are the big problems in computer science that programming languages can
address? What is missing in our current set of tools? What ideas or features
will continue to persist?  Blub is good enough for him, because he thinks in
Blub.

I think not much will change in 100 years. I think C and Python will be at the head of things, Bash still the main shell. I think there may be a bit more of Go, or probably just another concurrent programming language will come along. I mean, look how much we haven't changed in the last 70 years...