Computer Science Teacher
Computer Science Teacher - Thoughts and Information from Alfred Thompson

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Object Oriented Programming is Dead

    • 10 Comments

    OOPtombstone

    OK perhaps not dead but Robert Harper, a professor at Carnegie Mellon University, says(Teaching FP to freshmen) that object oriented programming and design is “unsuitable for a modern CS curriculum.” More of the quote in context is:

    "Object-oriented programming is eliminated entirely from the introductory curriculum, because it is both anti-modular and anti-parallel by its very nature, and hence unsuitable for a modern CS curriculum."

    As you might imagine there is some dissent in the comments. When I posted this link to my Facebook page there were some 16 comments, mostly in disagreement, in a short period of time. One person, who hires people for industry responded with “I'm tired of interviewing interns who know Haskell but can't code up strlen() in C. ” But as Robert Harper says in a reply to a comment on his post “Our goal at Carnegie is provide students with an education, not training.” What does that mean anyway? Is there a conflict between industry and academia? Academics often believe that “There are plenty of opportunities for them to learn the old ways, and to pick up industry practices on the fly” while industry hiring managers lament the fact, as one VP told me, that it takes an average of a year and a half to turn a recent college hire from a good school into a fully productive software developer. Is is any wonder that many companies prefer not to hire people right out of college?

    I’ve seen programming paradigms come and go. I started programming as industry (and academia) were adopting structured programming. That was a big advance at the time but required some changes in the way people thought and designed code. Later I lived through the long, slow and at times even more painful transition to objected oriented programming. Are we entering the age of functional programming? Perhaps. But perhaps not to the exclusion of other paradigms.

    We do have new needs today. While first structured and later OOP developed to support the needs of larger programs and larger teams of developers as well as the needs of dealing with more data today the key new issue is parallelism. One of the design goals behind the development of F# (a functional language that is built into Visual Studio) is parallelism and making it easier to spread work across multiple processors. Clearly that is where we have to go to continue to be able to take advantage of the newest hardware. But does that mean OOP can become optional or that we can wait for students to learn it after college? That I am not so ready to buy.

    Even at the peak of OOP mania I have maintained that not everything has to be an object and that a mix of paradigms would/did/does work. I think that is still going to be the case even as functional programming grows in usage and popularity. But will old style programming completely go away? I don’t think so.Will objects go away? Not a chance.  I think universities, especially those who provide an “education not training” do their students a disservice if they ignore the reality of what is currently in the field. The handwriting is on the wall and functional programming is going to continue to grow in importance. But ignoring OOP now is not doing anyone any favors. Just my 2 cents.



  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Hacking Vs. Programming

    • 6 Comments

    What is the difference between Hacking and programming? One opinion I have heard expressed is that a hacker can put a lot of code together in a hurry but if a change is needed the code has to be completely rewritten. A programmer may take a little longer but if changes are needed they are more quickly and easily installed without the need for a complete rewrite. One source I heard attributed an observation like this to Maggie Johnson of Google. It rings true to me though. Hacking is usually described as “quick and dirty.” You though a bunch of code together and make it up as you go along. Some hackers are quite brilliant and can do amazing things in incredibly short periods of time. And then they move to the next thing. Or perhaps they stay with the same thing because no one else can understand it well enough to fix it, modify it or improve it. Job security? Perhaps but not a good thing for the people who use, or importantly pay for, the software.

    I do a little hacking – that is to say toss something together in a short period of time without a lot of planning – from time to time. I’m not a genius though and typically this ends poorly. The performance is poor, the maintainability is poor, and no one else wants to use it. This may make be biased against this way of doing things I guess. I prefer to program – to think things out, to plan, to proceed in an organized fashion. I saw the difference made clear to me my first year of teaching (a long time ago). I was working on a little game programming of my own and decided to show it to some of my students. As I explained how I had set things up around a number of constants that is hoped would make the program more easily expandable one of the students turned to another and said “Look at that. He’s just starting and already he is planning for additions.” That is one of the real keys, in my opinion, to real programming.

    I was a major in Systems Analysis in college. This was during a time when computer science majors were rare and software engineering majors rarer still. But one of the things my professors drilled into our heads was that programs had to be maintainable and extensible. We were taught from day one that programs are not finished but, in a sense, abandoned. More likely at some point you declare victory and more on. But others will maintain these programs and expand them and adapt them. Making their lives easier is a good thing. Think of the Golden Rule – program was you would want the programmers whose code you are modifying to have programmed. I think that is how it is written. Smile

    The hackers get a lot of attention these days. These are the basketball players who make the slam dunk that makes it to the highlight reel. But basketball games are won by teams of players executing on the basics – the solid play well executed, the dribble, the layup, the pass that gets the ball to the star. In the long run we need more real programmers to make solid, dependable programs that don’t have be be rewritten from scratch when a change is needed.



  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Readability in Programming Languages

    • 37 Comments

    I saw a side by side comparison of a bunch of scripting languages online recently. Scripting Languages: PHP, Perl, Python, Ruby My first, and second reaction was yuck! Now I have my biases – biases which may  not be shared by others of course. But I like readable code and for me anytime I see a special character (anything not an alphanumeric) it slows me down. This got me thinking about where we are going in design of programming languages? Are we moving forward (what ever that means) or backwards or just sideways?

    Back when I started programming close to 40 years ago the big three programming languages were FORTRAN and COBOL with an up an coming language called BASIC. FORTRAN (short for FORmula TRANSlation) was used by mathematicians (my math major brother had to learn it) and scientists. COBOL (the B stands for Business) was used for business applications. BASIC was a teaching/Learning language that was spreading into business. COBOL was both loved and hated by different people for its wordiness. But it was at least understandable. Take the loop below:

    PERFORM VARYING WS-BOTTLE-NUM FROM 98 BY -1
                   UNTIL WS-BOTTLE-NUM < 2
    END-PERFORM

    Pretty close to an English sentence. Compare that to this sample for a C-style language (C#)

    for (WSBOTTLENUM = 98; WSBOTTLENUM >= 2; WSBOTTLENUM--)
    {
    }

    Which one is more obvious? Pretend you are not an experienced programmer.

    BASIC (Visual Basic in this case) is somewhere in the middle.

    For WSBOTTLENUM = 98 To 1 Step -1
     
    Next

    The step – the counting down – is more easily understandable for me at least. Now let’s take a look at something very simple. k = i / 10;

    This drives beginners crazy. What’s going on here? Sure we programmers know but a lot of beginners struggle with which direction the operation is going. Compare that to the same code in COBOL

    divide i by 10 giving k

    Wordy? Sure, but at least even a beginner can read it. Now I am not arguing that we should all go back to COBOL though honestly with modern IDEs and features like Intellisence it would be a lot easier than it was back when I was typing out punch cards. Rather I am suggesting that beginner languages can and probably should be more wordy rather than more obscure – that English is easier to pick up than “what does # in this programming language mean?”

    Just for fun, if you want to see what different programming languages really look like visit the 99 Bottles of Beer site.

    This Website holds a collection of the Song 99 Bottles of Beer programmed in different programming languages. Actually the song is represented in 1434 different programming languages and variations.

    Somewhat related posts:


Page 2 of 618 (1,853 items) 12345»