25.7.07

Random thoughts on programming

you sure know several books on programming, what they all have in common? what is important, relevant, and what is syntax sugar? abstraction, data, and procedural abstraction.
of course, depending on the type of programming book you happen to read, you may find the abstraction concept closer to the surface. this is the case in many cs 101 kind of books, say SICP, HtDP, or similar. OTOH, if you are stuck with a 'foo language for dummies', or 'foo in 21 days', then you might just be out of luck: abstraction will be there, believe me, but you're gonna have to work harder to find it.
this is really important, once you grasp the basic concepts, and abstractions it is easier to move to higher topics, to other languages. the two books i mentioned before are scheme based, which really eases the translation from concepts to code: first class procedures (or higher order procedures), strong dynamic typing, the whole nine yards. i haven't look myself at any java, c# o c++ intro book lately, but it must be a hell of a lot harder to do without first class procedures, no wonder novice programmers lose themselves in the syntax nightmare.

2 comments:

  1. As always ... we know ... scheme rules everything else sucks...

    Everybody always says that if you learn to program (instead of coding) you can do it with any language the tricky part is that most of us don't really learn to program in the first course instead if you are lucky is something that you end up learning after a while and not before you write some significant pieces of code whether in real or artificial problems.

    I've always liked the writing analogy for describing what programming is, and in this case it fits perfectly. You can't be a writer if you don't learn how to write. In the same way you can't learn to program without coding. Math and CS history arguments please hold, face it we have computers now and your undergrads are not dijkstra (http://www.geekchic.com/repliq5.htm)

    Point made the rest is practical, coding is complicated, coding is messy, it doesn't matter if you are using scheme or java you WILL get into messy situations either by wondering how to use somebody else's library or dealing with exceptions.

    And in the same way you wouldn't admit someone who can't write in a "how to write your own novel" course we shouldn't expect someone who doesn't know how to code to really grasp the important programming concepts.

    IMHO we should spend a reasonable amount of time (3 or 4 weeks) teaching how to code before starting to launch key concepts like scope, encapsulation, data or procedural abstraction.

    I've seen "programmers" that have gone through a full university education and still haven't figure out that programming is all about modeling problems and if lucky solving them too ;)

    ReplyDelete
  2. sure thing, teaching how to code for 3 or 4 weeks sounds reasonable. it would be like a karate-kid-kind of approach to teaching programming.

    of course, coding is messy, but nothing like exercising the coding muscles to ease the messiness. for instance, the number of exercises in HtDP is 450+, which is pretty decent for a newbie.

    ReplyDelete