My First (and Last) Programming Language?

Somewhere along the line, I started reading Matt Jadud’s weblog because he talks about pedagogical issues with teaching computer science and I’m interested in this subject both from a personal and a professional standpoint. From the personal side, I spent several summers as a teaching assistant for Computer Science classes at the Talent Identification Program at Duke University and actually taught the introductory class one summer there. (TIP is a program that identifies bright teenagers using the SAT and gives them the chance to take advanced classes over the summer. It’s similar to CTY at Johns Hopkins.) Besides having fun teaching, the experience was also a fascinating problem to solve: how do you teach programming to non-programmers? Having picked up programming at an early age, it was a challenge to try and work out how to impart something that, for me, was very natural. It also helped that I assisted some very good teachers. From the professional side of things, I’m interested in how people learn to program because VB is explicitly designed to be an approachable language for beginners. So how close we do or don’t approach that ideal (and you can certainly argue that with me, if you like) is a big question for us.

A recent entry on Matt’s weblog referred back to an entry he wrote last year called “My First Programming Language(TM)”. Since I only subscribed in the past six months or so, I hadn’t seen it before but I’m glad he linked back to it because it had some very interesting thoughts about how programming languages should be structured for beginners. In particular, he talks about applying Joel Spolsky’s idea of leaky abstractions to programming languages by way of two generic languages named A and B:

In Language A, it turns out that you can’t say anything meaningful without reaching for other parts of the language. While we want to start off with simple bits of code, we must include bits and pieces of the full language to make even the simplest of sentences. Language B, however, is a complete core. We can do simple things simply to start, and if we want to say more complex things, we can. As we grow the language, we don’t have references out into parts of the language we don’t know; instead, we only have references back to the parts of the language we have already learned.

The inability to say simple things simply in Language A is a leaky abstraction. The inability to keep the complexity of the whole language under the covers kills us pedagogically (the blue arrow, below). What should we teach first? Where do we start to build a shared conceptual vocabulary that both the instructor and student can use? Where do we go next if we do manage to find a starting point?

What’s great about his discussion of these two languages is that it captures some of how we think about Visual Basic in a way that I don’t think we (or, at least, I) have been able to verbalize before. When designing new language features, we spend a lot of our time thinking about leaky abstractions and how to avoid them – without calling it exactly that. A good example of this is our design for partial types, which I’ve discussed here earlier. Partial types solve a particular problem for us: they allow us to abstract away automatically generated or templated code from user code. When designing the feature, we had to decide between two designs: one design required the abstraction to leak through into the user code (i.e. explicitly stating “Partial” on all parts of a partial type) and one design kept the abstraction separate at the cost of some explicitness (i.e. not having to specify “Partial” on all parts of a partial type). Each design had it’s advantages and disadvantages, but ultimately we came down on the side of the latter design because we felt it was more important to contain the abstraction, even at the sacrifice of some explicitness.

This does raise a deeper point which Matt references but doesn’t explicitly address. His entire discussion is organized around a split between a “Language A,” which is supposed to be leaky but suitable for “enterprise software,” and a “Language B,” which is supposed to not be leaky but suitable mainly for pedagogy (and not, by implication, enterprise software). The question is: why does there have to be this dichotomy? Why can’t there be a Language C that is designed to be both watertight in terms of leaky abstractions and suitable for writing “real” software? Indeed, our thesis is that Visual Basic does satisfy most of the traits of Language C, but we still end up spending a lot of time having the Language A/Language B argument anyway. Sometimes it’s like the old saying: “There are two kinds of people in the world, those who believe there are two kinds of people in the world and those who don’t.”

4 thoughts on “My First (and Last) Programming Language?

  1. Steve Hall

    My viewpoint is a result of way too much history and compiler hacking: in the year I started programming, there was indeed a Language A and a Language B…both very popular. So popular, in fact, that I can guarantee that over 90% of all code in existence world-wide at that time were in either A or B. (A few other languages comprised the remaining few %…) Fortunate for me, my first language that I learned was a Language C.

    What were the languages and time-point you ask? It was 1965. Language A was COBOL, Language B was FORTRAN IV, and Language C (drumroll please!) was that newfangled language known as BASIC.

    Even though it was seen as a "language any 8 year old could learn", BASIC did everything that I needed for many, many years… (Maybe it had something to do with me actually being 8 years old at the time!)

    Even after learning both COBOL and FORTRAN IV in the following year, I kept using BASIC off and on for the very same reason as alluded in your article that Langauge C’s are created: because BASIC was a unifying language between the two different programming paradigms. As BASIC became quickly embraced by all the major time-sharing companies (Datalogics, Chi Corp., GE, SBC, etc.) and by DEC, and newer more enhanced interpreters (and compilers!) were released, it became apparent by 1970 that BASIC truely fulfilled the Language C role.

    I was amazed (and truly thankful) years ago when Microsoft essentially saved BASIC from extinction by releasing VB 1.0 for DOS and then VB for Windows. It has certainly proven its worthiness over its 40 years…and was worth saving! And now, once again, with its features beefed up to make it a "First-Class Citizen" once again amongst languages, it can continue to fulfill the Language C role!

    Hopefully, BASIC can continue to be a thorn in side of Language A and Language B purists that insist "their language" is the "only true language" and the one you MUST USE…at least to grow hair on your chest. The entertainment value in watching language bigots over the decades has been enormous…esp. when it’s a bunch of newbies (<5-10 years experience) who have never written an interpreter or compiler and had to go through the rigors of language design.

    There are, of course, other Language A and B dichotomies, such as Algol 60 (a Language A in which you could not implement EVERYTHING without a little pain) and Algol 68 (a Language B in which you could not implement ANYTHING without a little pain). Because there was no middle-ground between those two purist camps (the have-nothings versus the have-everythings), Pascal came about as a nice middle-ground (for the have-somethings).

    I sort of view both C#and Java as "have-somethings" Language C’s: they’re compromises between C and C++…and worthy of our attention.

    In short, as time marches on, the desire for Language C’s will always be there…and hopefully some of the Language A’s and B’s will be retired due to their limitations.

    Signed,

    Proud To Have Learned BASIC As A First Language

    Reply
  2. Mike McIntyre MVP Visual Basic

    Paul,

    So Visual Basic has become the ultimate ‘C’ programming language – cool! 😉

    Seriously, I really enjoyed and related to Matt’s blog.

    The VB.NET language and VB.NET code editor provides an environment where teachers can teach new programmers how to ‘do simple things simply to start’. My in Visual Basic 2005 expands this capability.

    After learning the basics of programming with VB.NET, the programmer need only expand his/her knowledge of VB.NET and the .NET Framework to get language ‘A’ results from VB.NET.

    Reply
  3. Xavier Theoret

    I really like this article.

    Some programmers would like to be able to do things the "perfect" way. But there is some programmers that are just happy when it works. And if your work is in Windows and with Office, Visual Basic is really a time saver!

    For people like myself who are not paid to program all the time (it is not the main part of my job), you want it to be "fun" and you want it to be quick. Visual Basic filled this role perfectly.

    I think that there is a role for both language out there. Depending on the work, you have to choose what is the best tool to do the work.

    Thanks for reading,

    Xavier

    Learned 1st language Basic on Radio Shack’s TRS-80.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *