Slashdot Mirror


Best Paradigm For a First Programming Course?

Keyper7 writes "The first programming course I had during my computer science schooling, aptly named 'Introduction to Programming,' was given in C because its emphasis was on imperative programming. A little before I graduated, though, it was decided that the focus would change to object-oriented programming with Java. (I must emphasize that the change was not made because of any hype about Java or to dumb down the course; back then and still, it's presented by good Java programmers who try to teach good practices and do not encourage excessive reliance on libraries.) But the practices taught are not paradigm-independent, and this sparked a discussion that continues to this day: which paradigm is most appropriate to introduce programming? Besides imperative and object-oriented, I know teachers who firmly believe that functional programming is the best choice. I'm interested in language-independent opinions that Slashdotters might have on this matter. Which paradigm is good to introduce programming while keeping a freshman's mind free enough for him/her to learn other paradigms afterwards?"

592 comments

  1. The Basics. by Anonymous Coward · · Score: 0

    Basic.

    1. Re:The Basics. by LaskoVortex · · Score: 3, Funny

      Brainfuck.

      --
      Just callin' it like I see it.
    2. Re:The Basics. by fireman+sam · · Score: 2, Funny
      --
      it is only after a long journey that you know the strength of the horse.
    3. Re:The Basics. by evanbd · · Score: 2, Funny

      What's wrong with Malbolge?

    4. Re:The Basics. by Anonymous Coward · · Score: 1, Funny

      Malbolge: "Malbolge has eight instructions. Malbolge figures out which instruction to execute by taking the value at [c], adding the value of c to it, and taking the remainder when this is divided by 94. The final result tells the interpreter what to do... After each instruction is executed, the guilty instruction gets encrypted (see below) so that it won't do the same thing next time, unless a jump just happened. Right after a jump, Malbolge will encrypt the innocent instruction just prior to the one it jumped to instead. Then, the values of both c and d are increased by one and the next instruction is executed."

    5. Re:The Basics. by Sarten-X · · Score: 5, Insightful

      Rather than a specific paradigm, you should focus on what almost all languages have in common. Almost all languages operate on statements. They have variables to store data. They get input and produce output. These simple concepts are mind-numbingly dull for anyone with experience, but most new students I've seen haven't done programming before. I feel that students should enter the world of programming with some understanding of the terms used and the core functions. To this end, my personal opinion is to use a language like the old (not Visual) BASICs.

      It is sad that BASIC has fallen out of favor now. Complaints of bad code, lack of power, and old age have tarnished its good reputation with little real reason. Most of the complaints I hear stem from seeing BASIC code in environments where it simply doesn't make sense. As an educational tool, it's the perfect introduction.

      If I were ever to teach such a course, the first day would be a simple program, that just ENDs. Consider the basic concept there. The program starts at the beginning and runs until it's told to stop. It runs a single command. Such a simple program also allows time to understand the process of compiling. Next, I would introduce data, using a Hello World program (with an END statement, of course). There, we get data, output, and commands running in series. Again, these concepts are things we take for granted, but are of vital importance.

      I'd move on to input, assigning variables, order of operations (8th grade WAS good for something!), and probably some basic conditions. If I were really into it, I'd throw in some logical operations for good measure. With the commands being in plain English, it's easier to ignore the details of the language, and focus on what the statement actually does. Best of all, there's no extra code with no apparent purpose. No importing or including libraries at the top of the program, no class declaration, just meaningful code.

      After that comes the most important part of any BASIC curriculum: abandoning BASIC. Move to functions, or objects, or whatever popular concept strikes your (or better yet, the students') fancy, and don't return to BASIC again. By that time, the student should have a solid understanding of how general programming works, so they can focus on adapting to whatever paradigm comes next. In fact, I'd recommend against even telling the students they were using an unstructured language. Use BASIC as a way to understand the code itself, before trying to understand how it fits into the big picture of the program.

      --
      You do not have a moral or legal right to do absolutely anything you want.
    6. Re:The Basics. by Anonymous Coward · · Score: 0

      Actually, that's not a bad idea. If nothing else,

      ++++++++++[>++++
      these comments are
      ++++++.
      just to prevent
      [>++++++++++
      slashdot's hyperactive
      ---.+++++++..+++
      filter from .>++++[>++++++++
      keeping this .>+
      due to having "too many .--------
      "junk characters"
      .

      really makes one appreciate writeln("Hello world!");

      More seriously, it takes people out of their comfort zone, which is good for stimulating learning.

      Of course, you'd only want to do this for a few assignments after discussing a Turing machine and doing other introductory whatnots.

      Afterwards, move onto a language which can be used to teach multiple paradigms, Python and D being my favorites. D is probably a better choice since its syntax is more conventional and it covers a lot of important stuff concerning types, like templates, that simply aren't relevant in dynamic languages.

      The choice of a paradigm-neutral language lets you teach multiple paradigms without having to get bogged down in syntax discussions.

    7. Re:The Basics. by KingMotley · · Score: 1

      Very true. I would likely want to teach visual basic as a very first language. The language is easy enough to pick up, and isn't all that picky. Also using an editor like visual studio express for your first editor will really help with it's real-time syntax checking. This would keep new students from getting frustrated when they get bogged down with trying to learn both programming concepts and memorizing syntax at the same time.

    8. Re:The Basics. by lysergic.acid · · Score: 1

      BASIC would be good for a first programming course in junior high or high school, but definitely not in college. frankly, if you're a CS major you should already have played around in some turing complete programming language or another prior to your first college CS course. things like variables, arrays, input/output, basic control structures, etc. should already be familiar enough to the student so that when he starts his first college-level programming course, the instructor should only have to briefly review these concepts in the first 2-3 days of class and be done with it.

    9. Re:The Basics. by KDR_11k · · Score: 1

      My uni started with functional programming since students are likely to know math already, the basic concepts of variable, array, etc don't hold as easily there. Java was introduced in the second half of the semester.

      A problem with some BASIC interpreters is that they're not very strict with their variable handling, you don't have to define a variable like in C. Pascal used to be pretty popular in education. A general problem is that these days people want to teach OOP but Java is the popular choice for that and Java forces some degree of OOP even when the program is pretty much procedural. Going with a different language forces relearning the syntax though. C++ allows ignoring the OOP parts completely and shows no trace of them until you want them but pointer and reference arithmetic isn't a healthy thing for someone who barely understands that a = a + 1 can work (Pascal uses := for assignments...).

      --
      Justice is the sheep getting arrested while an impartial judge declares the vote void.
    10. Re:The Basics. by wisty · · Score: 2, Insightful

      Brainfuck is fine. It's Turing complete, right, and the only thing to programming is learning rules, and learning to type.

      The real question is, what are you trying to teach? Programming and algorithms would be easy to teach in Python (or a lisp), user interface design would be good in Java or .net (vb or c#), web technologies would be good in Ruby, and systems programming would be good in C.

      Are you trying to teach software development? What other things can you get students to memorize (or "learn", as fashionable people like to say - there is not much difference since education is in a controlled environment - yes I know that good teaching can make a difference). The stages of software development? The rules of XP? Scrum terminology? How about svn?

    11. Re:The Basics. by KDR_11k · · Score: 2, Informative

      "should". From what I've seen of people who join a CS course most have never done any programming.

      --
      Justice is the sheep getting arrested while an impartial judge declares the vote void.
    12. Re:The Basics. by cgenman · · Score: 2, Interesting

      BASIC was created to be a highly accessible introduction to programming concepts, and it remains such to this day. Just because it isn't a tool that they will be programming with until the end of their days doesn't mean it isn't a valid option.

      Also, BASIC gets a bad rap due to people who never left it. How these people survived is beyond me, but it is not the language's fault any more than it is the house's fault when the 30 year old child refuses to move out of his parents' house.

    13. Re:The Basics. by Peter+(Professor)+Fo · · Score: 1
      1. Editors and IDEs are something we take for granted but can be a stumbling block
      2. Blocks and how they nest and never overlap (can easily be introduced by writing myfirstpage.htm) is another 'obvious-that-isn't' concept.
      3. BASIC is good because it has line numbers... Which make it easy to discuss. It serves its original purpose as a learning tool.
      4. A lot of programming knowledge starts with the General which is something acquired in a minute or two and is then developed to the Particular which takes months. For example a loop can be illustrated with a GO TO and some finishing condition inside the loop to start with, but then the flavours and traps appropriate to each language can be built on this foundation.
      5. So you want to differentiate between exercising a program and testing it: Getting somebody else to follow your written instructions for some task is memorable and fun. In reverse, being asked to follow somebody else's instructions is a start on how programmers can get so many things wrong.
      6. It's not what programming language you learn but how you learn to be a programmer.
      7. If a programmer is stuck-in-a-rut with one paradigm then they're not going to be a very good programmer overall. If you're not open to new ideas then you're not going to be good at spotting all the 1001 traps and quirks the Real World has waiting for your program.
    14. Re:The Basics. by lysergic.acid · · Score: 1

      and most of those students will drop out of the class and/or change their major by the end of the semester. so why waste the time/tuition money of the students who have demonstrated initiative in their own academic career?

      if i took college level music theory course for music majors i wouldn't expect the instructor to waste everyone else's time to teach me what major and minor scales are.

      besides, i think one of the most common problems in modern education (at least here in the U.S.) is the habit of instructors to underestimate their students. as a consequence they spend far more time than they need to going over really rudimentary or trivial information at a snail's pace, boring their students in the process and turning them off of the subject being taught. and because they aren't being challenged, the students end up not putting as much effort into the course, and so their grades may drop, which just reinforces the instructor's preconception of the material being too difficult and that he/she needs to slow down the pace of the course. worse yet, if educators keep selling their students short, the students might even begin to internalize this attitude, which can negatively impact their performance as well.

      it's always better to give students a challenge and have them struggle a little with material that's a little bit beyond them rather than have them become bored or complacent with material that's beneath them and not learn anything at all because they've simply lost interest.

    15. Re:The Basics. by Narcocide · · Score: 1

      Let me just say this: FUCK Scrum.

    16. Re:The Basics. by smallfries · · Score: 4, Interesting

      It sounds like you've missed the point. Not all languages operate on statements, with variables and assignment. These are common to imperative languages, which all fall under a single paradigm. The submitter asked which paradigm would be best to introduce someone to programming.

      Your lack of experience in other paradigms (not meant as a slight, 99% of all mainstream work is done in imperative languages) means that you have a similar educational history to what the submitter is considering. You consider imperative languages to be the whole world, rather than just a subset of it.

      Logic, or functional languages are very different. Learning them forces you to consider other approaches to programming than those that are evident in an imperative language. Making someone learn a functional language first can teach them a lot about programming in general. Especially when they move over to an imperative language, but they have a different bag of tricks to apply to problems.

      One of the first languages that I learnt as a child was Logo. It's a bit of style these days, although it was fairly common back on 8-bit home computers. At the time I though of it as a bit weird in comparison to the other languages that I used, but it taught me to think about programming in a different way. It is only with the hindsight of 20 years and a degree that I can see that "weirdness" was because it was functional.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    17. Re:The Basics. by Skrynesaver · · Score: 1

      I almost agree, right up to abandoning BASIC, at this point I would recommend splitting into three classes learning Pascal, Scheme and Smalltalk (or whatever they're teaching now). This would help the students to learn the pros and cons of each language type and give them a more complete set of programming mindsets from which to examine a problem.

      --
      "Linux is for noobs"-The new MS fud strategy
    18. Re:The Basics. by lekikui · · Score: 1

      That's why you teach scheme. The syntax is basically nonexistent, and can be introduced very slowly as it becomes needed. The whole focus can be on the ideas.

      --
      "Lisp ... made me aware that software could be close to executable mathematics." - L. Peter Deutsch
    19. Re:The Basics. by Anonymous Coward · · Score: 0

      BASIC is Turing-complete, and does all the things you mention. What is the problem?

    20. Re:The Basics. by zacronos · · Score: 1

      At my alma mater, there was a class called "Introduction to Programming for Engineering Students". This course was required by the College of Engineering for all non-CS majors, and at least 95% of the students taking that course had never programmed before. It is not appropriate to assume any student taking a college-level intro programming course already has some background.

      What if someone wants to be a CS minor? Should they be required to have existing programming knowledge? The course I mentioned above wouldn't have been entirely appropriate for them (in my opinion), as it was lighter on CS theory than the equivalent course for CS majors. What about intelligent students from poor, rural school systems? Should they be excluded from the possibility of being CS majors, merely because the "computer science" course at their high school focused Microsoft Word?

      Perhaps a better solution than assuming either "all students need to be taught the basics" or "all students who don't already know the basics can figure it out themselves while we move ahead" would be to have a small, 1-2 credit hour course called "Introduction to Programming" that goes over the basics. It could do so with both an imperative language (such as BASIC) and a functional language (such as Logo). This course would be optional, so that students who lack a programming background could catch up, while professors for the other courses could safely assume their students already know the basics.

    21. Re:The Basics. by Dolda2000 · · Score: 1

      In that case, I'd say that Python is the new BASIC. I, too, grew up with BASIC, but I see no reason I would be any worse a programmer today if I had used Python instead (if it had existed back then, of course).

      Python is just as simple as BASIC when it comes to syntax, I think. Possibly even more so, since you don't need to name variables after their data type, and the indentation stuff (for all of its flaws) is rather intuitive. It has the familiar print statement from BASIC (though one could argue that a similar input statement might not have hurt, rather than having to use sys.stdin).

      Furthermore, Python does actually support much more complex data structures than BASIC does. Of course, beginner courses shouldn't be delving too deeply into those things, but nevertheless, Python scales a lot better than BASIC, so that it actually can be used for real programs (performance issues aside).

      That being said, I wouldn't mind if beginner courses were held on microcomputers with no operating system, in assembler. One cannot become a good programmer without knowing what a computer really is, and starting from the beginning might not be a horribly bad idea. After all, assembler never was hard, just impractical.

    22. Re:The Basics. by KeithIrwin · · Score: 2, Insightful

      I cut my teeth on BASIC as well, but really, it's a pretty terrible language for a beginner. The syntax is decent, in theory, but in practice, it's most of the older BASICs had weird little picky things involving spacing and stuff like that. And when you do mess up the syntax, you would only get "SYNTAX ERROR" without any explanation of what was wrong or how to fix it.

      Variables don't have to be declared before use, so small typos in variable names cripple programs rather than resulting in compiler errors. This makes it much tougher for new users to debug their own programs.

      The syntax also doesn't allow you to separate your code into blocks, so things like IF statements are a pain since they require using a GOTO if you want to do more than one statement. This makes the code harder to read and understand. Spaghetti code is a necessity in most BASICs.

      Beyond that, being able to build functions or procedures or subroutines or some form of reusable code is fundamental to teaching intro programming. The GOSUB command exists in BASIC, but it doesn't make sense in any simple way. If you understand already what a subroutine is, then GOSUB makes sense, but otherwise, it's just confusing. Named function/procedure calls are much cleaner and easier for starting students to understand.

      Obviously these issues could be solved by using a more modern BASIC, but then you lose most of the easier syntax because they've complicated it in order to add the new language features.

      For starting students, I think what you really want is a language where they don't have to worry about syntax at all, where they can just get used to putting programs together. Languages like Scratch or Alice I think are very nice first languages for students to learn. Unfortunately, Scratch lacks procedures and it's difficult to build completely new projects in Alice because you have to understand things like where to place the lights and the camera in a 3-d world.

      Alternately, a language like Logo which has fairly light-weight, but consistent syntax is also useful.

      Right now, I'm working on modifying Scratch to meet my needs for teaching introductory programming. Specifically, I'm seeking to add user-defined functions/procedures and to be able to make projects for students to complete where they have a goal to accomplish and have a limited set of statements available to complete it.

      In teaching Intro to Computer Science using Logo, I've found that a few students will want to just use Forward, Left, Right, Pen Up, and Pen Down to accomplish everything, even situations where they really should be using Repeat statements or building procedures. I want to add in a mechanism such that they'll need to use those tools to solve the problem. So if their task is to draw a square and they only have two "Forward" statements and two "Right" statements available, but they have a "Repeat" which they can use, then they'll learn to use the Repeat by necessity.

      Plus, by limiting the search space, they're more likely to be able to find an answer by trial-and-error at first. In the long run, you don't want people programming by trial-and-error, but that's how most all of us learned to begin with.

    23. Re:The Basics. by Massacrifice · · Score: 1

      Plenty. Which is the point, of course.

      --
      -- Home is where you eat your heart out.
    24. Re:The Basics. by sleigher · · Score: 1

      I think your post demonstrates why we need CS type classes at the junior and high school levels.

      --
      All points of time and space are connected.
    25. Re:The Basics. by b1t+r0t · · Score: 1

      Assembly Language. Hell, make 'em enter the hex code themselves.

      I'm only half serious here. I'm old enough to have gotten my start on a TRS-80, and it was only a few months (and a Z-80 Quick Reference Card) before I was disassembling BASIC and learning good assembly language coding from none other than Bill Gates himself. But then I guess I was just born to program.

      --

      --
      "Open source is good." - Steve Jobs
      "Open source is evil." - Microsoft
    26. Re:The Basics. by Alpha830RulZ · · Score: 1

      What if someone wants to be a CS minor? Should they be required to have existing programming knowledge?

      I don't know about 'should', but I suspect that most of the students will have some background. I have a CS Minor (economics degree). When I entered university, I already knew two variants of Basic and fortran. It's a little surprising to me that anyone entering a course program on CS wouldn't already have some exposure. That said, I think the schools could handle this with a lab section on programming basics. If someone is going to be successful in a CS program, major or minor, they should be able to pick up something like C, Python or Basic in a few hours. If they can't, that's kind of a clue to pick another major, IMO.

      --
      I was taught to respect my elders. The trouble is, it's getting harder and harder to find some.
    27. Re:The Basics. by maxwell+demon · · Score: 1

      Unlambda

      --
      The Tao of math: The numbers you can count are not the real numbers.
    28. Re:The Basics. by DuckDodgers · · Score: 2, Insightful
      and most of those students will drop out of the class and/or change their major by the end of the semester. so why waste the time/tuition money of the students who have demonstrated initiative in their own academic career?

      You're out of your mind.
      • Some high schools don't offer software development courses at all.
      • Some high schools offer software development courses taught by people who know nothing of the discipline and who will pass on false information or bad habits that need to be unlearned.
      • Being self taught is good, but maybe the first teaching websites or development books or mentors you found were likewise very poor choices.
      • A lot of the best senior developers in the industry night now are self taught because the CS teaching as we know it did not exist when they were younger.

      At that stage in the game, the budding student doesn't even understand what he doesn't understand, so he has no ground for knowing whether his previous self-taught, website, book, mentor, or school-provided education is gold or garbage.

      A good professor will take people from ground zero on day one and move at a blistering pace that still lets the hard workers keep up. I started a college CS program not knowing anything of the discipline, with two good friends that basically slept through the first two semesters and got better grades. I graduated from the program, and they did not.

      Your elitism is misplaced.

    29. Re:The Basics. by liquidsgi · · Score: 1

      I would tend to agree. There is far too much focus on elements of the programming envionment, such as Eclipse for Java or Visual Studio for Visual Basic. When the focus is off the actual structure of statements and how to get a statement printed to the screen, much is lost. Viva BASIC!

    30. Re:The Basics. by TerranFury · · Score: 2, Interesting

      functional languages are very different

      I think you should start with imperative languages before doing functional programming. It's not hard to understand a loop, but kids take a long time to "get" recursion, and that's what functional programming depends on.

      So, teach BASIC. Then C. Then Scheme.

      You see a progression from GOTO in BASIC (easy to understand as an idea; a terrible way to program), to imperative programming with functions including recursion in C, to pure functional programming in Scheme. I think the progression of ideas makes sense.

      After that, you can worry about object orientation if you want. But you should have made inroads with that by now with C (structs and functions) and Scheme (classes, polymorphism). So Java should come with a snap of the fingers.

    31. Re:The Basics. by odysseus_complex · · Score: 1

      Ah, scheme! Good memories. Scheme was the first language that I was taught in college and I liked it because it was so weird, many of the students dropped out. That's what the first class of any major should do: weed out the people that aren't interested or aren't competent and not willing to learn in the primary area.

      Another thing to think about: is this a first course for a Computer Programming degree or a Computer Science degree? These two areas of study should never be confused.

    32. Re:The Basics. by smallfries · · Score: 1

      That's true. I knew quite a few imperative languages (C, asm, java, C++, basic etc) before I was introduced to Haskell. It was mind-bending. But I'm not convinced that it is actually harder - I think some of it is conditioning. Teaching a functional language to somebody without any experience of imperative constructs may turn out to be easier.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    33. Re:The Basics. by Anonymous Coward · · Score: 0

      I remember logo. It seems more or less functional (I first learned to code in Logo.)

      It's the tool I would seriously recommend for anyone wanting to learn to code, as a first introduction. It's simple, but it is fairly powerful within it's environment.

    34. Re:The Basics. by jadavis · · Score: 1

      Teaching a functional language to somebody without any experience of imperative constructs may turn out to be easier.

      That may be true. However, I suspect that it's still better to learn an imperative language first.

      You go through the experience of imperative programming, and seeing a variety of OOP languages. Right when you think you know everything, then you get hit with a functional language.

      I think that process may be better than learning functional programming first, and then realizing that most professional (and amateur) programming is imperative. In that case, you're likely to be disillusioned with functional programming, and forget it.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
    35. Re:The Basics. by TrekkieGod · · Score: 1

      It is sad that BASIC has fallen out of favor now. Complaints of bad code, lack of power, and old age have tarnished its good reputation with little real reason. Most of the complaints I hear stem from seeing BASIC code in environments where it simply doesn't make sense. As an educational tool, it's the perfect introduction.

      I did my first programming in BASIC myself, and to tell you the truth, it's not that good as an education tool. You could do worse (like C...wonderful language to program in, horrible language to teach with), but it's not that great.

      As a "perfect educational tool" I would go with Pascal. It was actually created for that purpose and it shows: the structure really encourages good programming practices.

      --

      Warning: Opinions known to be heavily biased.

    36. Re:The Basics. by The+Spoonman · · Score: 1

      if you're a CS major you should already have played around in some turing complete programming language

      How 'bout: Someone from a lower-income area who never had access to their own computer, or went to a public school that didn't have a computer lab (they do still exist, I'm told)? Someone from another, possibly third-world, country who never had access to running water let alone something to program? Or, someone who intelligently starts college with no pre-conceived notions of their major and takes a variety of courses to get an idea of what they might like to do? Are you suggesting that only those "elite" who had access to computers in their younger years should be allowed to take CS later on?

      As others have mentioned, when I was in college for CS, I thought CS was something else. The focus was on programming, rather than system design and administration which is what I wanted to do. The initial programming course was in Scheme which, despite having had experience with BASIC since I was 9, Pascal, Assembler and even a bit of FORTRAN at that point I still didn't get. Starting with such an obscure and wacky language doesn't exclude people who don't have the "temperament" or ability to stick it out, it forces out people who don't have the temperament or ability to learn Scheme.

      --
      Which is more painful? Going to work or gouging your eye out with a spoon? Find out!
      http://www.workorspoon.com
  2. SIMPLE by symbolset · · Score: 1

    Simplified Imaginary Machine Programming Language for Everyone

    --
    Help stamp out iliturcy.
    1. Re:SIMPLE by Anonymous Coward · · Score: 0

      hey....that's not a real programming language...oO

    2. Re:SIMPLE by Z00L00K · · Score: 1, Informative

      There are several programming languages around, but one of the classics for learning good methods is actually Pascal. It's readable and structured. And the step from Pascal to C or Java isn't bad enough to cause trouble.

      But as with any programming language you can make a mess out of it.

      For an introduction it's not necessary to start with something object-oriented. It may just be disorienting.

      Then it's worth to realize that in today's world it may be a good idea to already from the beginning think of languages that are suitable for parallel execution. Erlang is one such language. It is of course always possible to program for parallel architectures in languages like C++ and Java, but it's also easy to make a mess out of it in those languages.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    3. Re:SIMPLE by theaveng · · Score: 1

      Commodore 64* Assembly language. Start with the basics and save the advanced languages for sophomore year.

      *
      * An Apple II, Atari 800, or 8088 IBM PC may be substituted, although the C=64 is the most common machine available (30 million units manufactured) and thus easier to obtain.

      --
      FOX NEWS.com should be BANNED from television and internet. Have the Congress take it over and give us Truespeak.
    4. Re:SIMPLE by Anonymous Coward · · Score: 0

      C++ is not a parallel architecture. It doesn't even have threading yet.

    5. Re:SIMPLE by po134 · · Score: 1

      Java all the way. Get some high-end lego kits programmable using java that will inspire the kids of all ages.

      I learned java as primary language throughout my education and am very happy because in the industry many people don't seem to be able to "think" object (especially when linked to an object database or an ORM) and once you know OO, structured programming is really and I can't emphasis enough on the REALLY part.

      At the university they still introduce graphical interface and OO practices in the third semesters and that is why I am on the comitee to change all that ...

    6. Re:SIMPLE by po134 · · Score: 1

      should have read "really easy" :P

  3. Weakest Precondition Calculus by Anonymous Coward · · Score: 2, Interesting

    Easy: follow the Gries book.

    1. Re:Weakest Precondition Calculus by El+Cabri · · Score: 5, Informative

      +1 for that.

      I love functional programming but let's face it, computers are state machines and you cannot really program them without understanding how programs modify their state. Hoare. Dijkstra. Read them. Embrace them. Feel the pain of bending your mind around them.

    2. Re:Weakest Precondition Calculus by Anonymous Coward · · Score: 0

      That's what I had at the University of Buenos Aires as the first programming course for bachelor in CS. Great stuff. Pretty ugly but very important. WPC concepts like pre/post conditions and invariants are fundamental. In hindsight I'm glad I was taught that first, before being exposed to particular languages and their little quirks and vices.

      Easy: follow the Gries book.

    3. Re:Weakest Precondition Calculus by Anonymous Coward · · Score: 2, Interesting

      functional programming is a reducible state machine. However, we're surrounded by iterative programing (eg, recipes, directions for assembling chairs, map directions, etc.), so that often seems more natural.

    4. Re:Weakest Precondition Calculus by racicop · · Score: 1

      If you pay attention to the last few paragraphs in Dijkstra's "On the cruelty of really teaching computer science" he outlines an introductory programming course which starts with training the students in the algebraic manipulation of formulas. I think functional programming can really help you with this, and I haven't tried the logic paradigm yet so I can't tell if it's any better. It can also help students focus on correctness, and since some of them have probably tried some imperative language already, starting over with a functional language will level the whole class.

    5. Re:Weakest Precondition Calculus by jadavis · · Score: 2, Insightful

      Strange that you say that, because I've always considered most human directions to be far more declarative than imperative.

      For instance, "go to the store and buy milk". If you were to try to reduce that to imperative instructions, it would be a nightmare. In fact, nobody has done it, because it's so hard to describe in terms of the myriad possible states and branches.

      Along the way, you do all kinds of optimization, too. If there's traffic on the main street, you might take side streets. If one checkout line is longer, you might choose the shorter one. If one brand is on sale, you might buy that one.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
    6. Re:Weakest Precondition Calculus by trinhcity · · Score: 1

      M. Sipser's book is great tool to understand state machines. Check out Knuth's Art of Programming, if you want to really hit the ground running. BTW, this reply reminds me of an intro. professor who was glad that Hoare named his sorting algorithm quicksort instead of Hoare-Sort, I couldn't stop laughing. At the time, I didn't know CS professors had a sense of humor.

  4. Some combination? by mathgeek13 · · Score: 1

    I know that you said it should be language-independant, but some sort of language like Python might be good. With Python you can do object-oriented programming or not. Something with that sort of flexibility might be a good language to teach with.

    1. Re:Some combination? by ryszard99 · · Score: 2, Funny

      perl

      --
      -- $_='ab-bc ratvarre';tr"'a-z'"'n-za-m'";print
    2. Re:Some combination? by bi$hop · · Score: 0, Redundant

      perl

    3. Re:Some combination? by Anonymous Coward · · Score: 0

      If you are going to do that, then you should go with something like Oz and the CTM book, http://www.info.ucl.ac.be/~pvr/book.html.

    4. Re:Some combination? by Anonymous Coward · · Score: 0

      With Perl, you don't do OO programming, Perl's OO programming does you.

    5. Re:Some combination? by Hurricane78 · · Score: 1

      You can even do functional programming or not. That's why Python is my favorite scripting language.
      For full-blown programs I mainly use OCaml and Haskell. OCaml is really great for games, because it's faster than C++, allows interpretation (scripts), compilation to byte-code, and to the cpu, and allows functional, object oriented, imperative and declarative programming with strict typing like Haskell. OpenGL, SDL and everything is available.

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
  5. mathematica by Anonymous Coward · · Score: 0

    the best tool for programming by far.

    1. Re:mathematica by Anonymous Coward · · Score: 2, Funny

      I know I'd love to sign up for an intro to programming course whose basic software cost only four figures.

  6. All of them. by Tokerat · · Score: 4, Insightful

    If you go on to do anything comp sci related, you're going to need a good background in all of these methods of programming, their advantages and disadvantages. You'll need to know when it's appropriate to use each one, and why.

    --
    CAn'T CompreHend SARcaSm?
    1. Re:All of them. by dcollins · · Score: 5, Insightful

      Unfortunately, they can't all be first.

      --
      We know where leadership by an anti-intellectual "strongman" who scapegoats minorities and likes boisterous rallies goes
    2. Re:All of them. by mbrubeck · · Score: 5, Insightful

      Unfortunately, they can't all be first.

      But you can still do several in a first programming course. That's exactly what my intro CS course did. We worked with a functional language, an object-oriented language, a low-level assembly language, a logic programming language, and also theoretical constructs like finite automata.

    3. Re:All of them. by DerekJ212 · · Score: 5, Insightful

      That explains why so many kids drop out of CS. I was greatly interested in the subject, but if my CS101 class had tried to throw all that at me and expect me to really grok it all in a single class, I would have been looking for a different major/school.

    4. Re:All of them. by i.of.the.storm · · Score: 5, Interesting

      That's similar to what my first college CS course has been like. We used SICP and it was a really interesting semester. We did functional, OO, client/server, and logic programming (or well those were the 4 paradigms that the prof considered the main ones) and it was pretty interesting. Since most people came in with OO experience only, doing functional programming through people for a loop at first. Of course, we did it all in Scheme, which is a cool language, too.

      --
      All your base are belong to Wii.
    5. Re:All of them. by martijnd · · Score: 4, Insightful

      a logic programming language, and also theoretical constructs like finite automata.

      Sounds like a great course -- however in most schools the professors will have long given in to the whining "this is not real world" crowd that sadly makes up most entry level computer classes.

    6. Re:All of them. by Anonymous Coward · · Score: 5, Funny

      doing functional programming through people for a loop at first.

      Wow, that sounds pretty advanced. Functional programming, with loops, through people. I've never even heard of that new paradigm.

    7. Re:All of them. by Kingrames · · Score: 1

      Yes they can.

      You're forgetting there's more than one student.
      We actually prefer that there be variety among programmers. it's best to have all different kinds.

      --
      If you can read this, I forgot to post anonymously.
    8. Re:All of them. by Tablizer · · Score: 1

      [all are needed for comp-sci]

      Unfortunately, they can't all be first.

      I keep trying to tell that to my boss when there's lots of projects. I asked her to rank the priority of them, and she puts them *all* at the top level. It must be the same kind of mentality that melted our banking system.
             

    9. Re:All of them. by mkbc · · Score: 3, Interesting

      Concepts of Programming Languages was a third year course at my University in which we discussed and formed a decent background in a variety of languages. I think you're skipping ahead. I got my kids learning with Scratch. When I was little there was Logos. But if we're talking CS programs, learning Pascal first has serverd me well - although I admit I have never encountered it outside of my University. All my first year courses that involved programming were done in Pascal. Its a procedural language that is easy to grasp - its for beginners and encourages good habits. Second year we did assignments in Pascal, Smalltalk and Prolog. It wasn't until my third year that I was expected to use C and C++. I think my University did it right in progressing to C and C++. C and C++ are for people who already know how to program so they are not good starting points.

    10. Re:All of them. by mnkyby · · Score: 1

      if you're talking about the berkeley course, I concur. I know some people hated scheme but I loved how the course just focused on programming paradigms and when (and when not) to use each one instead of how to find segfaults (not that that's not important).

      i think that for a first programming course the language is irrelevant and the order in which the different paradigms are taught is mostly irrelevant. But I think it's hugely important that students are exposed to as many different paradigms as possible in the first semester or quarter of cs, so they can see that one paradigm does not (and should not be made to) fit all.

    11. Re:All of them. by brilinux · · Score: 2, Interesting

      Wow, that sounds pretty advanced. Functional programming, with loops, through people. I've never even heard of that new paradigm.

      To be fair, the loops were really tail recursive calls.

      Seriously, though, I do believe that SICP is a fantastic way to learn programming; it really is very thorough, and Scheme is a great language for learning - it is small and simple, yet supports every programming paradigm you could want to teach. While I am partial to SICP, another good one is How to Design Programs, which is designed to fit in more generally in a liberal arts curriculum, so its focus is more on problem solving.

      I also believe that a, perhaps basic, introduction to logic and discreet math (how to do induction proofs, what graphs are, and things like that) are also important, and should be taught before or concurrently with an intro programming class.

    12. Re:All of them. by lekikui · · Score: 1

      Databases and typesetting systems, respectively. Whaddya mean, those don't have real world applications?

      --
      "Lisp ... made me aware that software could be close to executable mathematics." - L. Peter Deutsch
    13. Re:All of them. by suggsjc · · Score: 1, Insightful

      That explains why so many kids drop out of CS.

      Separate the men from the boys (or some other non-sexists cliché). Granted, we don't want to "scare" people away, but CS isn't/shouldn't be easy, so why slow down from the get go?

      --
      When I have a kid, I want to put him in one of those strollers for twins and then run around the mall looking frantic.
    14. Re:All of them. by Anonymous Coward · · Score: 0

      technically it should have "thrown people through *recursion* at first"

    15. Re:All of them. by Anonymous Coward · · Score: 0

      If I was a professor and anyone was whining to me that logic is not "real world", I'd ask them for a proof.

    16. Re:All of them. by cyco/mico · · Score: 1

      I really liked my introductory courses at TU Berlin back in the mid-nineties (has unfortunately been javaified since...)

      The two first year mandatory courses would start more or less from zero with two different paradigms: functional programming and assembler, based on a mini-cpu we'd more or less wire up from scratch.

      The rationale for the functional part was:

      • Give everybody the same starting point (assuming nobody was familiar with functional)
      • Present programming as a manipulation of uniterpreted formal expressions (see the Dykstra article from Dec. 2nd, a very good read!)
      • Introduce students to formal signatures and program verification

      The rationale worked out surprisingly well (for me at least). Although not everybody was happy with that choice, the people with the most problems were those who ran into real trouble with the whole subject later on...

      The "hardware" based assembler course gave some insight into down-to-the-metal imperative machine programming, and the mode of operation of a real processor. Could have been more dense, but was interesting nonetheless.

      A 2nd year course with all 4 major paradigms (basically 3 programming assignments in all 4 paradigms, with subsequent analysis and comparison) was a very valuable conclusion of the "Introduction into Programming".

      If I were facing the choice, I'd choose functional programming as the "best paradigm" for a first year (university) programming course.

    17. Re:All of them. by dcollins · · Score: 1

      "Since most people came in with OO experience only, doing functional programming through [sic] people for a loop at first..."

      So, you're not really talking about people's first programming course here, are you?

      --
      We know where leadership by an anti-intellectual "strongman" who scapegoats minorities and likes boisterous rallies goes
    18. Re:All of them. by Anonymous Coward · · Score: 0

      ... if my CS101 class had tried to throw all that at me and expect me to really grok it all in a single class, I would have been looking for a different major/school.

      you're not very smart, are you?

    19. Re:All of them. by po134 · · Score: 1

      Because algorithmy is already difficult on its own and not everybody has the same capacity to learn new language that easily, that doesn't mean they won't be good in the work if they don't need that versatility.

      I don't think teaching Functionnal programming at first is a good idea, let that for the programming languages course as this is a whole new area of thinking and just learning the basic for/while/do/vectors/matrices/types will be hard enough for most. Although 1 course for each paradigm to serve as an introduction and could be interresting as long as they don't have to learn it right away

    20. Re:All of them. by Anonymous Coward · · Score: 0

      OO isn't a programming paradigm, it's a code organization paradigm. It's most frequently applied to imperative programming, but it can be applied to other types as well.

      Client/server is a software architecture concept not a programming paradigm.

    21. Re:All of them. by Anonymous Coward · · Score: 0

      Since most people came in with OO experience only,

      So, not the first CS course... I've taught courses that do this, but I really can't imagine doing this with a room of students who have never programmed a single line before. There is some paradigm that actually comes _first_, and it really can color how the other paradigms are perceived.

      The really unfortunate thing is that this debate has been raging in the CS education community for some time, but it is subtly being taken out of our hands. There are an increasing number of high schools that have some kind of programming course, and we are also starting to see more students who started to teach themselves programming from the Internet. The problem we face in CS1 is thus one of trying to get everyone on the same page, which involves teaching some students from scratch and trying to break all the bad habits in the other students.

      I would love us to get to the point where broad overview courses like this were practical, but it is going to require getting high school courses in CS to the same level as Math, Bio, Chem,. Physics, etc. [this, of course, still doesn't answer which paradigm comes first...]

    22. Re:All of them. by Anonymous Coward · · Score: 0

      There's nothing wrong with that crowd. Until schools start offering Software Engineering majors, people that see themselves as programmers will invariably end up in CS majors, wondering how any of their classes are going to help them code a game, or design a piece of enterprise software.

      Math majors learn math. Then they get jobs where they apply that math. Computer Science majors learn computer science...then they get jobs programming, using almost none of their CS skills. It doesn't make any sense.

    23. Re:All of them. by PitaBred · · Score: 1

      And yet they throw genetics, chemistry, physiology and all kinds of other things at introductory biology students. Then they get to the specialized classes as they go further. The same thing should happen with CS.

    24. Re:All of them. by magisterx · · Score: 1

      I agree that a good computer scientist needs to have an understanding of all of them, but you have to start somewhere.

      For my two cents, I would start with imperative programming. It tends to be the simplest to understand conceptually for most people (I tell the computer to do something, it does it...). Once you have a decent grasp of imperative programming, then OO and functional will make more sense (for that matter, I have a LOT to learn when it comes to functional programming myself).

    25. Re:All of them. by julesh · · Score: 1

      But you can still do several in a first programming course. That's exactly what my intro CS course did. We worked with a functional language, an object-oriented language, a low-level assembly language, a logic programming language, and also theoretical constructs like finite automata.

      That's a lot of topics to cover in a single course. How many hours of lectures did you do on this course? What proportion of the assessment for the year was based on it?

    26. Re:All of them. by DerekJ212 · · Score: 1

      Great example. I had a genetics class, a chemistry series, a biology series, etc. They were NOT a single class. To me that makes the difference. My school operated on 10 week quarters, and trying to throw genetics, chemistry and physiology in a single class is not a smart idea.

    27. Re:All of them. by i.of.the.storm · · Score: 1

      Yeah, I am talking about CS61A, some people couldn't get past not having loops I guess, and things looking funny compared to C-likes. Plus I guess not everyone has a good handle on recursion by the time they get to college.

      --
      All your base are belong to Wii.
    28. Re:All of them. by i.of.the.storm · · Score: 1

      Well, when people start college these days it's likely that they've already had previous programming experience, whether from an AP class in high school in the US or just from self-teaching. But I think that's still important for a first course, don't need to be so pedantic about whether it's actually their first experience with programming. As long as it's their first college experience it should have a good impact.

      --
      All your base are belong to Wii.
    29. Re:All of them. by Junior+J.+Junior+III · · Score: 1

      If I had it to do over again, I'd find an overview of language families, a little history about the evolution of the design philosophies that created them, and so on, would go a long way.

      Then take some very useful language and go in depth with it in the next class.

      --
      You see? You see? Your stupid minds! Stupid! Stupid!
    30. Re:All of them. by Anonymous Coward · · Score: 0

      really grok?

      pace of learning for the student is decided by the course objectives. Not by individual's interest. (to be precise: not by a rookie's enthusiasm).

      But course objectives are often described in very high level language. This is where you should follow the teacher (as in religion).

      So a good teacher means better experience; else it is a disaster.

      It is same as what everyone knows already. If your manager is good, you are happy even in a shitty company. If your parents are good, you are happy with your upbringing despite other conditions. Same goes for married life & children.

      So, the resonance matters. If, by instinct or otherwise, one can not identify what suits to him/herself, s/he is doomed anyway.

      That's why history speaks about great men's rare mistakes. Compare that to all glory or all worse.

      Love,
      me.

    31. Re:All of them. by DragonWriter · · Score: 1

      That's exactly what my intro CS course did. We worked with a functional language, an object-oriented language, a low-level assembly language, a logic programming language, and also theoretical constructs like finite automata.

      There are several languages that can do functional, OO, and structured imperative programming naturally using subsets of the same language, without being forced (Scheme, for instance; Oz does all that plus logic programming, though I personally think that Scheme's Lispy syntax would be easier for beginners.) I'm not sure throwing a bunch of different languages at students in a first course is a good idea, both because there is cognitive overhead for each language and because it reinforces the idea that choice of programming paradigm is directed by choice of language.

    32. Re:All of them. by slickrockpete · · Score: 1

      My first introduction to programming (aside from a couple hours of messing with flow charts in high school) was a the programming for CS majors class in pascal. I have worked professionally in lisp, Dylan, C and java in significant amounts. All of them is a nice answer in theory, but you do need to solve some problems hard enough so that there's not enough time in a survey class to do a relatively hard programming project in more than one or maybe 2 languages and really get something out of it. My favorite idea is to bottom up and top down driven by state machines. By bottom up I mean assembly language, or even some sort of micro-code or simple hardware design given some components. At the same time spend some time on something very far from the hardware like functional programming or logic programming. The key here is how they meet. How does this functional program reflect this state machine, and how would this function be compiled? In the interest of instant gratification some scripting languages that can make pretty animations should be thrown in. Unfortunately this won't allow any time for your english requirements, which are very important to geeks.

    33. Re:All of them. by kumanopuusan · · Score: 1

      If you're going to separate the men from the boys, do it the way Knuth intended. ;-) Actually, that algorithm ought to pretty good at weeding out the faint of heart in a CS classroom, too.

      --
      Use of the words "good", "bad" or "evil" is almost invariably the result of oversimplification.
    34. Re:All of them. by Fyzzler · · Score: 1

      To be fair, the loops were really tail recursive calls.

      To be honest, I didn't get anywhere near as much tail recursive calls as I would have liked in college.

      --
      I have one question. If the Japanese Ministry of Agriculture is not in charge of Gundam, then who is?
    35. Re:All of them. by jadavis · · Score: 1

      Until schools start offering Software Engineering majors, people that see themselves as programmers will invariably end up in CS majors, wondering how any of their classes are going to help them code a game, or design a piece of enterprise software.

      Those people are looking for vocational school, and end up at a university.

      The reason is mostly due to social status. Graduating from a university carries a higher social status than graduating from a vocational school. But is that any reason to turn a university into a vocational school and keep calling it a university?

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
    36. Re:All of them. by Grey+Haired+Luser · · Score: 1

      And nothing of value would have been lost?

    37. Re:All of them. by Jakeva · · Score: 1

      I'm just finishing up my Chemical Engineering degree but I wish I had gone into computer science. Think a combination of those two degrees would be profitable?

      --
      but if God created circular logic...
    38. Re:All of them. by Anonymous Coward · · Score: 0

      The stupid thing here is picking languages which are so heavily bound to one paradigm. Pick something like C++ and you can use procedural/imperative, OO, generic/generative, functional (google the Functional library before you whinge), as well as some of the Aspect-Oriented concepts (via templates, even if there's little automation of the "injection" process). Then you can start with one paradigm and introduce others as they're applicable to modeling parts of a problem, without students having to relearn everything else at once.

  7. Functional by Anonymous Coward · · Score: 3, Insightful

    Definitely functional programming. OOP is an extension of this. The methods within an object are, of course, functional. I feel it's like trying to teach someone to drive with a manual transmission, in a city. It's better to let them learn the basics, and THEN learn the more complicated (and better) way to do things. Building upon the prior knowledge.

    I am speaking as someone who learned functional first and then OOP, and who is now a (self-described) expert in OOP. Also, as someone who learned on an auto tranny first, and who is now a (self-described) expert at stick.

    It's all about steps.

    1. Re:Functional by Anonymous Coward · · Score: 4, Insightful

      The methods within an object are, of course, functional.

      Despite omnipresent side effects?

    2. Re:Functional by El+Cabri · · Score: 5, Interesting

      There are no two things more opposite to each other than OOP and functional programming. Functional programming is about FUNCTIONS, which are those that return a value that is completely determined by their arguments, not depending on, or modifying, any state. OOP is all about calling METHODS, which have values that are determined by both the arguments and the state of the object they're called on, and often are meant to modify that state.

    3. Re:Functional by Firehed · · Score: 0

      I'm not sure I'd quite agree with that statement. At least some amount of OOP tends to be just well-organized functional programming. Yes, methods will generally modify the state of an object, but static methods especially will often just return some value based off the parameter they're called with. Granted, they may often be some sort of pseudo-constructors that return an instance of their parent class, but you can do that just as easily with a function as a static method.

      Yes, by and large they're two totally different ways of doing things, but you can't pretend that there's no overlap between them.

      --
      How are sites slashdotted when nobody reads TFAs?
    4. Re:Functional by TuaAmin13 · · Score: 1

      I didn't have an ounce of programming until I hit college. I took MATLAB presuming I'd be an engineer, but then I decided to go for CS. I just finished my first semester of Java (Final was today)

      Honestly I think learning MATLAB first helped, since I was vaguely familiar with the concepts of conditionals, loops, arrays and whatnot, before I moved into OOP. For me it was just a matter of learning the fundamentals of OO and applying them to what I already knew. It worked for me, though it may not work for anyone else.

    5. Re:Functional by Eli+Gottlieb · · Score: 3, Interesting

      And yet in an impure functional language a set of closures closing over the same variables are equivalent to an object with those functions implemented as methods.

    6. Re:Functional by Anonymous Coward · · Score: 0

      At their base level, they are still functions.

      Functions which take part in a greater whole, but within the braces, they are still functions.

      If you don't know how to write a function, then you are fucked either way.

    7. Re:Functional by johnsonav · · Score: 5, Insightful

      Definitely functional programming.

      I don't think functional programming is the place to start for the majority of students. A procedural language has a much more direct relationship to the underlying machine code. If you don't want to start in assembler (and I don't advocate assembler for a first language for a lot of reasons), a language like C, which is high-level enough to not get bogged down in irrelevant details while teaching basic algorithms, yet is close enough to the metal to give the students a taste of the underlying hardware, is a good compromise. Functional programming, while closer to the underlying math, is so different from the instructions the machine actually executes that students may finish the class and still not have a clear idea how what they wrote directs the machine.

      That said, my first development environment was HyperCard and most of what I have done since has been OOP. When thinking about a problem, my first instinct is to objectify it. But, I think OOP involves learning too much at once to be the ideal teaching paradigm. Think of how many lines of OO exist in a Java Hello World program. And think how much of that is meaningless to the student when they're still trying to learn the basics of println.

      --
      ... and that's when the C.H.U.D.'s came at me.
    8. Re:Functional by Anonymous Coward · · Score: 0

      There are no two things more opposite to each other than OOP and functional programming.

      I have to disagree here a little bit. People usually learn (and use) OOP with imperative style methods, which directly modify object state, but it doesn't need to be that way.

      A method can certainly take an immutable object as its argument and return a transformed copy in the functional style. I don't know if that's very common practice (I don't really have much practical functional programming experience), but SML does provide data hiding and encapsulation mechanisms.

      --Justin

    9. Re:Functional by PsychosisBoy · · Score: 3, Insightful

      Remember, we are talking about people who have NEVER programmed before. And teaching them how to do it.

      I believe it is easier for someone to first understand how to program with functions, and then, after they are comfortable, to put these functions into a greater "whole", as part of an object.

      It really is all about building upon the fundamentals. Functional programming is a fundamental. OOP is building upon that knowledge.

      It's just my opinion, though =)

    10. Re:Functional by The_Wilschon · · Score: 1
      --
      SIGSEGV caught, terminating

      wait... not that kind of sig.
    11. Re:Functional by aiht · · Score: 5, Insightful

      "Functional programming" != "Program with functions in it"

    12. Re:Functional by Anonymous Coward · · Score: 0

      +1 Captain obvious?

    13. Re:Functional by gandhi_2 · · Score: 1
      I think you just confused functional with procedural. Or you don't know the difference.

      See also, imperative programming.

    14. Re:Functional by gandhi_2 · · Score: 3, Insightful

      someone called you captain obvious...but he/she is captain doesn'tknowthedifference.

      functional programming (ocaml, et al) is quite a different thing than procedural. Procedural is imperative with procedures, which are often called functions, which almost sounds like functional programming, which often confuses the fucktard on /. that confused you for cpt. obvious.

    15. Re:Functional by Anonymous Coward · · Score: 0

      Sorry champ but it looks like you, and lots of other people in the thread, don't know the difference between procedural and functional programming languages.

      REDO FROM START

    16. Re:Functional by Anonymous Coward · · Score: 0

      by the description you provided, I am convinced you still don't know either.

    17. Re:Functional by Arkhan · · Score: 1
      El Cabri: There are no two things more opposite to each other than OOP and functional programming.

      Really?

      Ebony and ivory?
      Ghandi and Stalin?
      Darth Vader and a rodeo clown?
      Matter and antimatter?

    18. Re:Functional by johanatan · · Score: 1

      The methods within an object are, of course, not functional (unless they are static and do not return void or rely on any static data). Pure FP has no side effects and does not rely on state such as instance variables or static [global] variables.

    19. Re:Functional by Anonymous Coward · · Score: 1, Insightful

      Apparently it isn't obvious at all. Most of the people in this thread don't know the difference between procedural and functional languages.

    20. Re:Functional by johanatan · · Score: 1

      OOP is simply a prescribed way to manage state (reduce coupling, etc). FP is the extermination of state [which I suppose could be considered a very extreme form of managing it].

    21. Re:Functional by johanatan · · Score: 1

      And yet in an impure object-oriented language, a set of free functions all taking ptrs to the same type of data structure with a vtable pointer is ... well, the way you'd do it if you didn't have O-O (say in C).

      Point is: impurity only muddies the waters. If we're going to talk about paradigms, at least stick to 'pure' ones.

    22. Re:Functional by mrchaotica · · Score: 1

      Functional programming, while closer to the underlying math, is so different from the instructions the machine actually executes that students may finish the class and still not have a clear idea how what they wrote directs the machine.

      But that's okay, because they can take a computer architecture class (with C!) later.

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    23. Re:Functional by AmberBlackCat · · Score: 1

      How would you go about saving a file, or changing the position of a robot's arm, if all you can do is make calculations and return the result?

    24. Re:Functional by Anonymous Coward · · Score: 0

      But, I think OOP involves learning too much at once to be the ideal teaching paradigm. Think of how many lines of OO exist in a Java Hello World program.

      Blame that on Java and the C legacy in it, not on OOP. Modern OO languages like Ruby are much more concise. But Ruby isn't good as a conceptual language for beginners because it's very impure, it wants to blend many paradigms and couldn't even resist to absorb some nasty perlisms.
      The ideal language for a beginner's course should be a theoretical language that is built to be clear, not efficient. 20 years ago that would have been Modula. No idea about now. Maybe make up a basic conceptual language and develop it with your students. The important thing is that they should learn how languages work, not how to program, which is the second step.

    25. Re:Functional by Anonymous Coward · · Score: 0

      I completely agree with you. While my first language was procedural or imperative (VB6), it was rather easy for me to move on to object-oriented languages. When I got to my first and only functional programming course, my brain hit a wall. I simply could not wrap my head around it. For sh!ts and giggles, I attended Luca Bolognese's "Intro to F#" at PDC 2008 and I started having Vietnam-era style flashbacks (I'm only 23 btw). Maybe my professor just sucked that bad or I don't know, but it was traumatic. I would definately not recommend functional programming as a starting point unless you really want to weed out the non-committed.

    26. Re:Functional by Anonymous Coward · · Score: 0

      Well, static members should've been eliminated from OO languages a long time ago.
      Attempting to compare Java (and especially C#) to pure functional languages are a dead end anyway as they both have adopted some functional elements.

      You should look at gbeta (http://www.daimi.au.dk/~eernst/gbeta/) to see what a pure OO language should look like.

    27. Re:Functional by EdelFactor19 · · Score: 1

      if they take a computer architecture class they won't be doing it in C... they'll be doing it in something like Y86, intel x86, name your assembly language of choice. C can't really tell you jack about the architecture.. which should be relatively obvious when you consider the fact that for nearly every known platform there is a C compiler.

      Is it lower level than Java? yeah, is it the lowest level among the most commonly used languages? probably/arguably. But does even it even really tell you what the Machine is executing? Not so much.

      --
      "Jazz isn't dead, it just smells funny" ~Frank Zappa
      EdelFactor
    28. Re:Functional by johnsonav · · Score: 1

      Modern OO languages like Ruby are much more concise.

      I don't have any Ruby experience, but it really couldn't be much worse than C++ or Java in that regard. When you try to introduce programming through Java, its: "ignore this", "we'll get to that later", or "don't worry what 'public class Foo' means".

      The ideal language for a beginner's course should be a theoretical language that is built to be clear, not efficient.

      Amen. I would imagine that a fair number of us here picked up programming outside of our formal educations, they learned whatever language they could use on their home computers, Basic, HyperTalk, or even Excel's macro language. For me that meant a lot of trial and error, trips to the library, and looking at other's code. It wasn't the most efficient way to learn a language. But, by the time I got to college, I already had the basic concepts down pat. (Although, when exposed to the "right" way to do things, I was shocked and horrified at how awful, inefficient, and stupid most of my design decisions, up to that point, were.)

      A lot of the people in a CS101 class have never had, or never took advantage of, that opportunity. This will be their first introduction to programming. There are so many concepts I take for granted which aren't necessarily obvious: the plodding step-by-step explicit nature of computers, and how to think about a problem in the terms a computer would understand. I think some sort of imperative language is closer to how most people normally think about a problem, as opposed to a functional language (or Prolog for that matter). I could be wrong.

      The perfect teaching language, for me, would be one where the student could progress through the course, writing more and more advanced programs and taking advantage of more and more features of the language, without ever having to type anything he doesn't completely understand. For example, if I was teaching Java, I would have to gloss over the "class" and "static" keywords just to get the student going on a Hello World program (not to mention "System.out.println"). I don't want to have to simplify those definitions to the student's level, and have that simplification be what sticks in his mind. Unfortunately, I don't know of an imperative language that does this.

      --
      ... and that's when the C.H.U.D.'s came at me.
    29. Re:Functional by Anonymous Coward · · Score: 0

      IMO it's all the same. Methods = functions + variables, maybe all wrapped up neatly, but still the same.

    30. Re:Functional by El+Cabri · · Score: 1

      I agree about Darth Vader vs a Rodeo clown. By the way, who would win a fight ?

    31. Re:Functional by johnsonav · · Score: 1

      But does even it even really tell you what the Machine is executing? Not so much.

      No, you're looking at it at a lower level than what I meant. C, being the lowest of the "high" level languages, still is much too high level to really give a detailed understanding of what the computer is doing. But, its in the same ballpark: list of instructions, branching, conditionals, and use of memory. They follow the same basic rules. What I'm saying is, both C and assembler are just lists of instructions. If you can read a C program, you can probably follow one written in assembler; they're both just lists of instructions: do this, then this, then this...

      Functional languages differ in that fundamental way.

      --
      ... and that's when the C.H.U.D.'s came at me.
    32. Re:Functional by atraintocry · · Score: 1

      Several people have pointed this out already, but it's important to repeat, especially with a lot of IT-types on this site (like myself), who do some scripting but aren't necessarily coders.

      Named blocks of code are usually called "functions", even in procedural programming. It seems based on the content of the post, that you are talking about procedures, not functions in the sense of a functional language.

      As to the original question: this is why Python is great: you can start with procedural programming, work up to OOP and even do some things that resemble functional languages.

      However, it does prevent you from teaching about compiling and linking, etc. But then, Java shields students from a good chunk of that as well.

    33. Re:Functional by El+Cabri · · Score: 1

      Yes functional languages are very much at odds with many things, that's why their acceptance is limited, despite many obvious advantages, which revolve the fact that's it's extremely difficult to write bugs with them. On the other hands they are well suited to other domains, such as compilers, document processing (XSLT for example), and all sorts of data processing, i.e. in the financial engineering sector.

      Their shortcomings are addressed in different ways : introducing state in them and transforming them into hybrid languages, for example. This bastardization process is exemplified by Microsoft's F# project.

      On the other hands, languages like Haskell try to deal with state in a clean, more theoretical, by incorporating side effects into the typing system.

    34. Re:Functional by atraintocry · · Score: 1

      I thought that if a method isn't expected to return anything then it's a statement, not a function.

      In any case, even though the word function is used in procedural programming, once the discussion turns to OOP vs. functional vs. procedural, etc, we have to be extremely careful with the word function, since "functional" has a specific meaning in that context.

    35. Re:Functional by Anonymous Coward · · Score: 0

      I am glad you don't call yourself an expert in functional programming. OOP is mainly about state manipulation, pure functional programming languages avoid states completely. Hence they are very different.

    36. Re:Functional by shutdown+-p+now · · Score: 1

      Despite omnipresent side effects?

      It all depends on how exactly you do OOP. The traditional message-passing style is indeed centered about objects having their state and mutating them on request. However, you can absolutely do OOP with immutable objects - see Objective Caml for a language that provides a good framework for that (or F# if you don't mind being stuck in .NET). Of course, this is quite different from stock OOP, but you still get the OO benefits of encapsulation and polymorphism, and still get to use inheritance to enable code reuse (note though that OCaml in particular separates inheritance and subtyping).

    37. Re:Functional by shutdown+-p+now · · Score: 1

      There are no two things more opposite to each other than OOP and functional programming. Functional programming is about FUNCTIONS, which are those that return a value that is completely determined by their arguments, not depending on, or modifying, any state. OOP is all about calling METHODS, which have values that are determined by both the arguments and the state of the object they're called on, and often are meant to modify that state.

      Methods can still be pure functions, so long as object state is immutable. For a simple example, java.lang.String is immutable, and all its methods are pure functions. The benefits that methods give in this case is polymorphism via virtual methods, and encapsulation (not that those can't be done via other means, but OO approach is often the easiest, even if it's not as flexible as e.g. Haskell type classes and existential types).

    38. Re:Functional by cgenman · · Score: 1

      Might I suggest that we begin teaching students Javascript or Flash in High School? It's not harder than calculus, it's a lot more useful, and all of the good programmers I've met started on their own by High School at the latest. Might I suggest an HTML -> Client-side scripting -> PHP series?

      Besides, there are definitely wide swaths of knowledge that professors take for granted in new students. My first programming course in college lost more than 70% of the students. The professor was trying to teach good fundamental Object Oriented Programming, and the students were struggling with parsing proper usage of control loops and variable allocations.

      Quite frankly, finding the "best paradigm for a first programming course" seems like a thinly-veiled way of asking which genre of programming language will dominate the students' ways of thinking for the next few years. Why limit the first programming course to one paradigm? Why would the first course be so important, as they really should have functional knowledge of three or four languages by the time they exit the first year?

    39. Re:Functional by Anonymous Coward · · Score: 0

      There are no two things more opposite to each other than OOP and functional programming. Functional programming is about FUNCTIONS, which are those that return a value that is completely determined by their arguments, not depending on, or modifying, any state. OOP is all about calling METHODS, which have values that are determined by both the arguments and the state of the object they're called on, and often are meant to modify that state.

      No two _things_ are more opposite? Not even, say,
      - the north pole and the south pole?
      - Paula Abdul and Shirley Temple? (particularly proud of that one ;-))

      Seriously though, without knowing anything about functional programming, from your description it sounds like state has to (a) be maintained by 'some other entity' (and lets not kid ourselves, most software development involves state at some point or another) and (b) has to be passed in and out to the 'functions'.

      Doesn't sound that different than OOP to me, just who takes care of state.

      btw. I'm pretty sure that I'm not alone in calling some of my OOP functions, well, FUNCTIONS. I didn't realize they should have been called METHODS.

    40. Re:Functional by dkf · · Score: 3, Informative

      There are no two things more opposite to each other than OOP and functional programming. Functional programming is about FUNCTIONS, which are those that return a value that is completely determined by their arguments, not depending on, or modifying, any state. OOP is all about calling METHODS, which have values that are determined by both the arguments and the state of the object they're called on, and often are meant to modify that state.

      Not at all. I have used a pure functional OO language in the past (the name of which I forget) and what it did when you did an operation that would "modify the state" is return the new state as the result of the method. The same would be true for any language where all objects are immutable and variables are immutable.

      "Functional" means that the answer to an operation is determined entirely by the arguments to the operation and the nature of the operation itself, and that the operation does not change the state. (Functional languages are usually written in pseudo-mathematical notation, but not always.) "Object-oriented" means that your values (often structured values) know exactly what operations can be performed upon them that don't just see the object as an abstract token, that they encapsulate that notion, and that the language is written in "subject verb" form, not "verb subject". (That last point is just syntactic, but important.) Those two are entirely orthogonal properties.

      Obviously, you've mixed up "OO" and "Imperative OO"; imperative systems are all about state modification.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    41. Re:Functional by Znork · · Score: 1

      I don't think functional programming is the place to start

      I have to agree. But mostly because procedural languages have much more direct relationships with reality. Reality has state and side-effects are commonplace.

      I've seen the functional-as-first approach, and sure, it levels the playingfield a little bit, but mainly due to most people fighting with the constraints of the language. I can see the appeal for certain math-geeks, but the connection between programming and math has been vastly overstated as it is.

      That's not to say that functional paradigms shouldn't be used; a first course could include requirements for recursive solutions for some problems to get people used to the mindset. And in real world programming it certainly has it's place; as a supplement for certain problem spaces where it's actually appropriate (I really like multi-paradigm languages :).

    42. Re:Functional by nacturation · · Score: 0

      Also, as someone who learned on an auto tranny first, and who is now a (self-described) expert at stick.

      Just to clear things up: when you mention having learned on a tranny and now being an expert at stick... you are talking about vehicles, correct?

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    43. Re:Functional by ufoot · · Score: 0

      In low-level imperative programming (C language for instance) what you say is perfectly true but a more advanced programming language which features, for instance, closures (any functional language such as Lisp, but Perl and others can fit too), allows you to manipulate statefull functions. You get to work on a function which is bound to a given set of data. This is, I admit, different from the usual OO model: a set of data with functions^Wmethods bounds to it. But I wouldn't claim those models are absolute opposites ;)

    44. Re:Functional by angel'o'sphere · · Score: 1

      There are no two things more opposite to each other than OOP and functional programming.
      That is not completely true. In fact the 2 concepts are at least in so far similar that you easy can program functional in OO languages. E.g. you can overload

      operator () { }

      in classes in C++ and can mimic a lot functional stuff with this (by making your objects "look like" functions).

      Modern C++ libraries and even the STL uses this concept.

      This also is very misleading (albeit strictly speaking it is true):

      Functional programming is about FUNCTIONS, which are those that return a value that is completely determined by their arguments, not depending on, or modifying, any state. OOP is all about calling METHODS

      Programming paradigms are about, what are the building blocks (or in other words your "concepts") of your programs.

      In imperative programming languages your building blocks are simple instructions (basically assembler op codes) and simple data "words". Even higher level languages like Pascal, Ada Cobol etc. only provide more expressiveness. A Pascal RECORD is only a grouping of data words. A Pascal PROCEDURE is only a grouping of instructions / statements.

      In a functional language the basic building block of your language is a FUNCTION. In other words, a function can have parameters of type "function" and can return functions, your data are "functions" that can be composed and evaluated.

      Pure functional languages don't want you to "keep state" so they invented something similar to classes in OO languages called monades (simply speaking).

      In an object oriented language your building blocks are objects (or classes or meta classes). The fact that most OO languages have or support methods is only a side note ... most functional languages have some kind of "record" also ... but it is not important to talk about the difference ;D

      Modern languages like Scala and OCaml are functional and object oriented. (But not pure functional as they heavy rely on modifying state of objects). Languages like Groovy that have good support for closures, can mimic most of the functional stuff functional languages offer.

      Languages like OCaml have "type interference" and "pattern matching". In other words if you have a simple class SC with a double attribute and a string attribute on one side and a list containing a double and a string on the other side, pattern matching can "figure" that this a "kind of" SC and can allow method calls on that list or can assign the list to an object of type SC (simply speaking).

      Regards,

      angel'o'sphere

      P.S. To answer the articles question: I would start with a functional language. Functional programming is very hard to grasp when you are already tainted by imperative programming (same for OO basically but to a lesser extend)

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    45. Re:Functional by angel'o'sphere · · Score: 1

      Well, you are not talking about functional programming but about imperative programming here ;D
      Functional programming is something completely different ... and certainly not fundamental .... see my other post above.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    46. Re:Functional by hey! · · Score: 1

      Well, the thing about functional programming is that it shows the power of containing complexity in self contained, independent units of code.

      Object oriented programming, on the other hand, is less so. Sure, details are encapsulated, but classes are really only understandable in the context of patterns. The idea that you can write a program by a kind of straightforward mapping of concepts in the problem domain to classes is extremely naive. Of course you do do that, but that's the easy stuff. Sure, it's more natural to do this in OO programming than any other paradigm, but since shallow modeling is easy to being with, it doesn't represent a huge productivity gain for the paradigm. The hard stuff in OO is what has to come out of your imagination.

      That's the link between programming and computer science. Skillful programming involves difficult, non-obvious transformations of requirements into novel abstractions; abstractions that are in a sense arbitrary, but still well defined and clear in the context of the design. Functional programming is a very pure form of this. If you can grasp that, then real object oriented programming isn't going to be so hard. On the other hand, you can get a very thorough primer in all the object oriented programming principles and still not be any good at it.

      My first reaction to the article title was: make the course fun -- that is fun for people who ought to be in the field. My first attempts at difficult programming problems were done in a largely functional programming style. It was fun, because the rules of the game were simple, and although they restricted how you could do things, they didn't restrict what you can do. I wonder whether people who don't enjoy such a challenge really ought to be programmers.

      These days, when I do almost all my work in object orientation, I still largely follow mental habits acquired in the functional style. One of those habits is to have a function (or in the case of OO a method) do one simple, irreducible thing. Following that habit on object oriented designs naturally leads to clean refactoring of classes. Most of the OO code I've seen has suffered from an attempt to prematurely twist the code into some preconceived pattern like MVC, whereas trying to make each method as self-contained and simple as possible leads to the same end in a more organic way.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    47. Re:Functional by Dan+Ost · · Score: 1

      A method that doesn't return anything is a procedure.
      A method that returns something is a function.

      At least that's what I was taught in my undergrad programming languages course. Oracle also seems to treat it this way (stored procedures vs stored functions).

      --

      *sigh* back to work...
    48. Re:Functional by MadKeithV · · Score: 3, Funny

      I prefer non-functional programming. It's all the rage at Microsoft. ;-)

    49. Re:Functional by genner · · Score: 1

      I agree about Darth Vader vs a Rodeo clown.

      I don't, it's a commonly excepted fact that all the Darths had to freelance as Rodeo clowns to complete their training.

    50. Re:Functional by julesh · · Score: 1

      "Object-oriented" means that your values (often structured values) know exactly what operations can be performed upon them that don't just see the object as an abstract token, that they encapsulate that notion, and that the language is written in "subject verb" form, not "verb subject". (That last point is just syntactic, but important.) Those two are entirely orthogonal properties.

      Disagree. Ada95 is clearly an object-oriented language, but is verb-subject. In fact, I'd say it's more object-oriented than most (e.g. Java) because of the fact that it supports dispatching a method call to an appropriate function based on the run-time type of more than a single argument.

    51. Re:Functional by Anonymous Coward · · Score: 0

      Chuck Norris

    52. Re:Functional by jafac · · Score: 1

      At the end of the day, the basics of OOP come from Discrete Math. Discrete Math is not a concept for beginning programmers.

      I don't think there's really an easy "single language" solution to getting people familiar and comfortable with the basic ideas of variables, flow control, and hell, file systems, interpreters, etc. It's a LOT to swallow at first to tell someone about state machines, abstract data types (let alone data types), inheritance, etc.

      I somewhat agree that the traditional progression is probably not an idea solution, but the best practical one: LOGO or BASIC -> C -> assembler -> perl or javascript or ruby or python -> java or c++ - but in parallel, they've got to be learning about their Discrete Math, set theory, state machines, data structures, hardware architecture, networking, distributed systems, relational theory and databases, etc.

      In short, there's no shortcut to swallowing all of Computer Science. I think that the reason so many different languages exist in the first place is each addresses a different subset of needs.

      While it's compelling to want to not have to learn all these tools, that's like an auto mechanic wanting to do everything with a screwdriver, and never wanting to learn how to use a ratchet wrench, sockets, torque wrench, torx, volt meter, ODB, vacuum meter, (etc).

      It's really complicated stuff for most people, and takes a lot of time to learn.

      --

      These are my friends, See how they glisten. See this one shine, how he smiles in the light.
    53. Re:Functional by grrrl · · Score: 1

      I don't think functional programming is the place to start for the majority of students. A procedural language has a much more direct relationship to the underlying machine code.

      I agree - the first language we were taught in CS 101 was gofer - it was easy, but it really gave you very little insight into how programming actually worked (as opposed to just getting it working). I would have much preferred to learn C straight up. I still think it is the best starting point there is (though I wouldn't dedicate the entire year to it - first year should expose you to a couple different ideas).

      Gofer would have been easy to teach in a non-procedural unit as an aside. But really I've never used it again (yes yes I'm sure there are valid applications out there) and feel like it was a waste of precious first year brain-still-a-ready-sponge opportunity.

    54. Re:Functional by iluvcapra · · Score: 1

      I'm pretty sure you can remove the word "impure" from the GP and the statement will still hold. You can see a discussion here.

      --
      Don't blame me, I voted for Baltar.
    55. Re:Functional by Anonymous Coward · · Score: 0

      A procedural language has a much more direct relationship to the underlying machine code.

      Which is exactly why it shouldn't be learnt first. Probably the most significant skill in programming is separating what you're trying to do from how you're doing it. They'll inevitably see how the underlying machine model relates to their code simply by programming for a while, so I definitely feel it's best to start them off with the separation as clear as possible. Hopefully we can instill in them from the outset that code is for humans, not for machines.

    56. Re:Functional by johanatan · · Score: 1

      I think that purity with respect to functional languages denotes absence of mutable state hence no objects (as they are simply the concatenation of state and function).

      I did read that page and it was quite interesting, but I wonder if the set! operator/function and closures which modify state are 'pure'. Also, it should be noted that this 'simulation' of o-o only gets you part of the way there--polymorphism is apparently pretty hard [read verbose] to simulate and you can forget about heap [dynamic] allocations as everything is on the stack.

    57. Re:Functional by Anonymous Coward · · Score: 0

      OOP methods are just functions with an extra argument. There is no spoon.

  8. Both by nog_lorp · · Score: 2, Insightful

    At my institution, the '101' and '102' courses are taught in C and Java respectively. The class I'm taking right now is these two classes combined, so my 'intro course' is taught in C and then Java. Several projects require writing the same program in each language.

    1. Re:Both by Xiroth · · Score: 2, Insightful

      When I went to university, the first course was in C - which was basically just preparation for the second course, which was in Assembly (specifically, MIPS). I'd say that was the most important part - a good grasp of the fundamentals of computing is really the best thing that you can take away from university. From there, all of the languages (and even paradigms - we covered the main three) were quite a bit simpler to grasp, as you could look a little deeper into them and ask "What are we really doing here?". Stripping away the mystery of compilers and interpreters simplifies understanding dramatically.

    2. Re:Both by lorenlal · · Score: 1

      In my case, I was first taught functional programming, even though it was in C++. It appeared that this was to get us used to taking a problem, and finding a way to solve it using a series of commands (and for getting us to rely on certain basic libraries and where to find them). This was very helpful in figuring out how to read and get a feel for what code was doing, oh and yelling at us constantly to comment our code.

      The second course took that functional programming and applied it to OOP. What is each method? It's a function that applies to a specific object. You have an object that you need to work with, and you need it to do certain things, so make a function for each of them and call them methods. This was also in C++.

      Later, we delved into C, assembler, and Java. But the emphasis was thinking in terms of problem analysis, design of a solution, and attacking it appropriately in later years. I found it to be very good in my case since OO vs functional is really a matter of what you do.

      You don't need a calculator object to write a basic calculator program... But you can write one if you plan on doing things with that calculator object like interact with multiple instances of them.

    3. Re:Both by mrchaotica · · Score: 2, Insightful

      ...C and then Java. Several projects require writing the same program in each language.

      Wow, how fucking useless can you get?! I'll bet half the students wrap their C code in a class and think they're done.

      Now, if they had to write their programs in LISP and Java (or LISP and C), then they'd be getting somewhere!

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    4. Re:Both by Anonymous Coward · · Score: 0

      I think you're mixing up imperative/procedural programming and functional programming.

    5. Re:Both by fishbowl · · Score: 1

      >I'll bet half the students wrap their C code in a class and think they're done.

      I agree, until they fail the first few assignments. They learn. I've witnessed it time and time again, tutoring C and Java students. My school definitely teaches object design semantics with Java, making quite sure that the student learns and applies OO methodologies and can justify their work. We also teach C from a Unix system software point of view, and assembly from a chip architecture point of view, and then a somewhat academic, comparative approach to logic, functional, and domain specific languages. Language electives are offered, which vary. Students do not graduate from this program with any confusion about how different paradigms are applied for different kinds of problems.

      That said, the first semester has a pre-major introductory course using Java. It is designed to teach good habits, to expose the student to the environment of the department, to offer a fun project that requires the student to design and build something independently, and frankly, to weed out those who are unlikely to survive what is a pretty challenging and very competitive CS program. Basically, you have to do no worse than a "B" in any math or computing course in your first year, or you won't be in the program.

      --
      -fb Everything not expressly forbidden is now mandatory.
    6. Re:Both by mrchaotica · · Score: 1

      In my case, I was first taught functional programming, even though it was in C++. It appeared that this was to get us used to taking a problem, and finding a way to solve it using a series of commands...

      If you think functional programming involves a series of commands, you have no fucking clue what you're talking about whatsoever.

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    7. Re:Both by nog_lorp · · Score: 1

      Early assignments were like that, but later assignments in Java required implementing certain interfaces, writing proper clone and equals methods, etc. that was alien to C. Certainly the algorithms were easily ported, but that is always the case.

    8. Re:Both by xristoph · · Score: 1

      I have to concur - both. Both paradigms are useful and widely used, and need to be understood by Computer Scientists.
      At my university, first semester was learning Scheme (a LISP dialect), the idea being that it is something that nobody already knows, and also that it is a "purer" functional language, with no pointers to confuse (but lots of brackets instead). Anybody's opinion on that?
      Second semester they started teaching C++, which was a good idea, except for the fact that the guy who was teaching it was an ADA expert and didn't know much about C++.
      That was later changed to teach two semesters of Java, which I think was a bad idea.

    9. Re:Both by gnud · · Score: 1

      This can, of course be debated.
      Personally, I would like a curriculum like yours. But at the university I attend, the focus is more on design and modeling, with object-oriented coding (a C course is also mandatory). And I can't say that it's all bad.

      PS: Currently the OOP is in java. Some years ago it was in Simula =)

    10. Re:Both by xouumalperxe · · Score: 1

      From there, all of the languages (and even paradigms - we covered the main three) were quite a bit simpler to grasp, as you could look a little deeper into them and ask "What are we really doing here?". Stripping away the mystery of compilers and interpreters simplifies understanding dramatically.

      Wrong. Assembler and imperative/procedural languages are based on the mathematical concept of a Turing Machine. Functional Programming is based on the concept of lambda calculus (which is why Lisp and Python use the keyword 'lambda' for pure anonymous functions). That Turing Machines and Lambda Calculus are equivalent is a reasonably deep mathematical result, and the associated thought processes are no different.

    11. Re:Both by Jane_Dozey · · Score: 1

      We did it the other way around and learned Java and C++ before Scheme. The point of doing it that way was to make us productive enough to be able to learn about other things that required programming to do in practice (distributed systems, writing a file system, learning about data structures, etc). Then we could do the functional languages thing while being able to continue with other parts of our education. For the record, I have a love-hate relationship with brackets now :)

      --
      Silly rabbit
    12. Re:Both by blitzkrieg3 · · Score: 1

      In my case, I was first taught functional programming, even though it was in C++.

      Then you weren't taught functional programming. Perhaps you meant procedural?

  9. Functional languages are phenomenal. by HFXPro · · Score: 4, Insightful

    Procedural is most like instruction list people are used to doing. However, it often leads to bad practices and sloppy coding. Object oriented can be good, but few people use object oriented beyond procedural wrapped in a class. It also is often hard to represent a good object system on paper. Functional languages to vary degrees are very nice if you didn't learn procedural before hand and can think of problems as smaller problems. People usually have trouble with them because they have learned Basic, C, etc. Logic languages are extremely powerful in that you only describe what you want, not how it should go about being computed. That isn't quite true, but think of them as more of set theory and logic. However, they can be somewhat awkward to teach.

    --
    Reserved Word.
    1. Re:Functional languages are phenomenal. by HFXPro · · Score: 2, Insightful

      I should mention anyone who is trying to peddle python against java against c are all barking up the wrong tree. Those are really all the same class of languages and offer no benefits over the other in terms of good practice, smart thinking, and great design.

      --
      Reserved Word.
    2. Re:Functional languages are phenomenal. by calmofthestorm · · Score: 3, Informative

      I'm not sure of that, actually. C is not at all functional, and Java is only to a limited degree. In Python, all functions are first-class values. This means you can mix paradigms in a program. You have fully functional closures and capture.

      I grew up on asm and C, now I write Python that looks more like Lisp or Haskell. In the end, I'd say either procedural programming or functional for introduction to programming. OOP is kind of verbose and clunky for an intro class, and while it certainly has its uses in large scale projects, when we were taught it in school I just saw a bunch of cruft obscuring the (simple) tasks that were assigned.

      --
      93rd rule of Slashdot: No matter how obvious my sarcasm is, my comment will be taken seriously by someone.
    3. Re:Functional languages are phenomenal. by bondsbw · · Score: 1

      You're right, but you're also wrong. While they are all imperative in style (particularly if you argue that object-oriented languages like Java and Python follow the imperative style of state and iteration instead of the functional style of passing values and recursion), they have differences.

      One key difference is memory management. C (and C++) allow direct access to pointers; the other languages only use references.

      You can't overlook the power of object-oriented design, as you said, "in terms of good practice, smart thinking, and great design." OOD doesn't force you to write better programs, but it allows you to do so. Reuse is a big deal when talking about design, and C comes nowhere close to modern OO languages. Isolation is also key; the more that your code is broken into distinct, isolated components, the more maintainable it tends to be. OO helps this.

      The arguments here deal with how effective the language is at promoting good design, not about whether you can make horrible designs in Java or beautiful designs in C... of course you can.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    4. Re:Functional languages are phenomenal. by francium+de+neobie · · Score: 4, Informative
      Really? Last time I checked...
      1. There's no need to wrap a closure in a "function class" in Python. And I don't have to cast everything down to Object every so often. So while, theoretically, you can do functional programming in both Java and Python, in practice it is much easier in Python.
      2. There's no need to wrap the "main()" function in a class in Python - in fact, I can go without writing the main(). Looks like a minor point but it saves a good portion of your time for trivial programs. Also, I don't need to compile it.
      3. I have list and dictionary literals; I don't have to care what is the "type" of the list and dictionary when I create it - type of elements can be examined by duck typing or isinstance() if I need to - but usually it isn't needed; list comprehension is a really good time saver, makes the code easier to read as well.
      4. I have an interactive command line for doing experiments. I can even read manuals in the command line via the help() function.
      5. I have exec() in Python. It isn't as useful or as dynamic as eval() in Lisp, but that's something Java definitely cannot do on a language level. Sure, you can write a library that calls the Java compiler real time to emulate that... but I'm talking about the language itself.

      Doesn't look very "same class" to me. At least when I'm considering which language to use for solving which problem.

    5. Re:Functional languages are phenomenal. by jonaskoelker · · Score: 3, Informative

      [C, java, python] are really all the same class of languages

      Really? For three "identical" things, I think they're quite far apart.

      C doesn't have native support for object-oriented programming. If you want to teach the students that, you need to embed pointers to vtables everywhere, you need parent-objects-as-members and you need massive hacks.

      Java doesn't have higher-order functions; you have to put your function pointer arguments inside classes. [C at least has function pointers]. By insisting that everything is put inside an object, procedural programming "looks OO" and might distort the students' view of what "real OO" is.

      Python doesn't have static types. On the other hand, it lets you teach procedural and object-oriented each in their most natural ways. It also lets you teach ideas that will recur in functional languages, such as higher-order functions, closures and lazy lists.

      More importantly, python lets you teach things without having to introduce a lot of overhead: "Why must closed-over variables be final? Why is it smart to feed my own anonymous Function class to MapIterator--a for loop is much shorter? Higher order--but it doesn't take a function, it takes an object! ..."

      I'd advocate python first, because it allows you greater flexibility in the choice of what to teach. Also, it's good for teaching algorithms: http://www.ece.uci.edu/~chou/py02/python.html

      "The most encouraging part was that more than a few students wanted to implement the algorithms that were not assigned as homework problems. The students said they wanted to see the algorithms run and test their own understanding."

    6. Re:Functional languages are phenomenal. by sjames · · Score: 1

      Although Python is roughly in the same general class, it does offer a number of advantages including duck typing and a strong class/object protocol. Python willingly exposes it's own implementation details in Python and in C.

      If you also cover writing a simple Python module in C, you get to pull the curtain back and have a good look at the internals from a different perspective. It's a great opportunity to see how all of the pieces fit together behind the scenes.

      Another benefit to all of that is that they will get an in-depth of an object oriented program/language written in a procedural language.

      Later years can add assembly. Add in implementing a Turing machine and a functional language in Python and the student will have an excellent understanding from lowest level to highest and will have been exposed to good design and it's many benefits along the way.

      Honestly, once the hype is removed, Java is mostly 'Me too'.

    7. Re:Functional languages are phenomenal. by The_reformant · · Score: 1

      Much like when to use each paradigm answer is in the focus of the degree course as a whole. For an AI course functional programming cant be beat since it abstracts away depth first search into the language and many have higher order logic constructs built in. For software engineering OO is king as it facilitates reuse. For systems and embedding programming focus procedural is the way forward.

      --
      I have discovered a truly remarkable sig which this post is too small to contain.
    8. Re:Functional languages are phenomenal. by Blakey+Rat · · Score: 1

      You can do almost every type of programming in Javascript (it doesn't have true OO support, but you can simulate it pretty easily), and the students can see the results instantly in a web browser by just hitting refresh. In addition, it has a C-like syntax, meaning that they can translate their learning almost directly to C, C++, C#, Java, and others. That's what I'd recommend.

    9. Re:Functional languages are phenomenal. by julesh · · Score: 1

      There's no need to wrap a closure in a "function class" in Python.

      No. The compiler does it for you. The only difference is that the syntax is *much* more pleasant in Python. What's actually going on is little different, though.

      And I don't have to cast everything down to Object every so often.

      The lack of static type checking in Python would render this moot. Effectively, everything is always cast down to Object. Besides, it's been a very long time since I had to do this in Java. Java generics may be a hack, but they're one that works for 99% of everyday situations.

      So while, theoretically, you can do functional programming in both Java and Python, in practice it is much easier in Python.

      Yes, but I'd say there are really only two points of Python that make it easier, and you haven't really touched on them:
      * Generator functions
      * The fact that closures can refer to any variable, not only 'final' ones like in Java (because Java's equivalent to closures, i.e. anonymous classes, are a nasty hack).

      If you'd picked C# rather than Java, you wouldn't even have these two major differences to worry about. And C# is just Java with the language design flaws worked out, when you look at it. If only I didn't despise its standard library, it'd be the clear choice...

    10. Re:Functional languages are phenomenal. by jellomizer · · Score: 1

      Python is actually excellent for teaching.
      Lets not confuse Dumbing down and removing extra steps.
      Having begging CS students remember

      #include
      int main(char argc, char **argv) {

            return 0;
      }

      Just to run a simple code (yes you can probably make it a void main() {)
      Python lets you cut threw a lot of syntax and allow the learning programmer to focus on Computer Science not getting the thing to work. Or hunting for the missing ";". I have seen a lot of assignments handed in as final once they get a clean compile off of it because they focus all their time trying to get the app to work and less time focusing on what it should do.
      Next Python is flexible as both functional and procedural and object oriented so as you learn more you can bring them with concepts on the same language for each different concept without having them relearn syntax. Once the student gets good at understanding how to use programming to solve problems with logic then you can move on to different languages and show their strong and week points. But Python is a good balance for teaching.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    11. Re:Functional languages are phenomenal. by Anonymous Coward · · Score: 0

      Regarding #4 and #5, the Beanshell project has been providing an interactive command line and runtime evaluation of Java code since 2000.

    12. Re:Functional languages are phenomenal. by mbrod · · Score: 1

      but few people use object oriented beyond procedural wrapped in a class

      You say that like it is a bad thing. In the majority of cases I come across this is appropriate.

  10. well update them.... by powerspike · · Score: 2, Insightful

    just give the courses funky and updated names like
    "Whiplash and programming, what they have in common"
    "the 7 do's and don't of baning your head against a wall learning OOP for beginners"
    that should do the trick!

  11. Assembler... seriously by EmbeddedJanitor · · Score: 3, Interesting
    Give them a good understanding as to what is going on under the hood. It really helps them to connect the dots and really helps in the understanding of compiler/OS design, and basic concepts like "what's a stack?".

    Choose a simple 8-bit micro such as an AVR first, or an ARM. Something with a RISC architecture is nice and clean.

    Introduction to programming isn't what it used to be. Twenty or thirty years back that was often the first exposure a student had to programming. These days you'd be seriously concerned if a student showed up to a programming course and hadn't dabbled a bit at home.

    --
    Engineering is the art of compromise.
    1. Re:Assembler... seriously by sbilstein · · Score: 1

      My institution gives you a choice between C++ and python first semester. Second semester is Java in one course and something that goes from basic logic gates and binary to assembly.

    2. Re:Assembler... seriously by fuhrysteve · · Score: 2, Insightful

      I wonder if something more basic might be in order.. My degree is in Philosophy, so I had to take symbolic logic. There was a CS guy in my course though who actually went to the department and said, "this should be on the CS curriculum, because we really don't formally learn logic." Here's the guy who taught me @ John Carroll: http://www.jcu.edu/philosophy/gensler/lc/index.htm

    3. Re:Assembler... seriously by Average · · Score: 2, Informative

      I'm going to agree with that. I had programmed in an imperative to mildly GOSUBby way in various microcomputer BASICs, Pascals, and standard Cs since pre-Kindergarten. However, one of the best college classes I had was the one where we were given a 6800 (later classes it was an 68HC11) on a board, with a few external circuits, and we learned every single op-code. Then, I knew what a computer (and a compiler) was doing.

      They'll have plenty of time to learn paradigms. Make them appreciate what those paradigms actually accomplish.

    4. Re:Assembler... seriously by cong06 · · Score: 2, Insightful

      +1 to that.
      Seriously, assembly is great and all, but people are idiots. Assembly would just scare them away.
      While I would rather the field be smaller so that there's a higher chance of me being employed, I realize that I would probably not be interested in comp sci if I was thrown assembly the first day.

    5. Re:Assembler... seriously by fluffykitty1234 · · Score: 1

      I do agree that assembly is important, it wasn't until I learned assembly (6809 for me) that I understood what a pointer was, or how it worked.

      On the other hand, I think language is actually a really small part of comp sci. The language is just a mechanism for expressing the concepts you will learn. It's much much more important to learn and understand the conceptual things, like sorting, searching, trees, etc etc.

    6. Re:Assembler... seriously by Shikaku · · Score: 1

      http://en.wikipedia.org/wiki/Discrete_mathematics

      I thought that's what discrete math was for.

    7. Re:Assembler... seriously by forkazoo · · Score: 1

      Choose a simple 8-bit micro such as an AVR first, or an ARM. Something with a RISC architecture is nice and clean.

      I agree 100% with the ASM suggestion. Really, seriously. If I were picking the curriculum, it'd probably be S360 or MIPS, but anything would be great. Heck, even just use an emulator for the fictitious assembly language in Knuth's 'The Art of Computer Programming.'

      Teach the student what the computer does, then teach them various ways of expressing it like OO. If you try and teach Java as a first course, you force the student to accept too much magic without understanding any of it.

      Introduction to programming isn't what it used to be. Twenty or thirty years back that was often the first exposure a student had to programming. These days you'd be seriously concerned if a student showed up to a programming course and hadn't dabbled a bit at home.

      Heck, even ten years ago, most students probably had never programmed anything. Twenty years ago, every computer at least came with BASIC or something, so kids could play around. But, computers were still fairly uncommon in the home. Ten years ago, computers were much more common, but having dev tools installed on your computer was not a given. Now, Linux has become common enough that anybody who has never used it just isn't very interested in computers. gcc is available for Windows. Python is available, etc. It's only within the past ten years that it has once again become a given that your ordinary home computer can trivially be used to write programs again.

    8. Re:Assembler... seriously by WebManWalking · · Score: 1

      Assembly language = the language, assembler = the utility that turns it into machine language. If you can't be at least that precise in English, you can't handle assembly language.

      The biggest impediment to programming in general is that computers are notoriously unforgiving. To be a programmer requires patience, a love of figuring out puzzles and determination. But to be an assembly language coder requires a level of determination that borders on sadism.

      I once worked on a computer belonging to folks so paranoid, they didn't allow any compilers. You could pay them to use their computers, but only to do processing. And yet they had a bug in a magnetic tape reader and no one working for them smart enough to debug it. But they had a file editor that allowed binary edits... :-)

      I dumped the tape reader's object code, translated it into binary, disassembled it in my head into assembly language, saw that they had a coding error, composed the fix, mentally reassembled it into binary and figured out how to patch the object code to get past the error. When we stopped using that computer, I sent them a note giving them the file system address of a fixed version of the utility. (I'm sure that set off a frenzy of omigod, how did he do that?)

      How I did that is that I absolutely refuse to let a machine tell me what to do. I tell the machine what to do, and the machine had better be my bitch and do it.

      If you can't think like that, do not take the advice above. Do not try to learn assembly language. Machine language will leave you broken and doubting your intelligence for the first time as much as a freshman at the India Institute of Technology.

      That said, EmbeddedJanitor is right. If you truly need to make the computer obey your will, nothing else comes close to assembly language.

    9. Re:Assembler... seriously by Tablizer · · Score: 1

      Give them a good understanding as to what is going on under the hood [first].

      I'm not sure I entirely agree with that. It makes them think in terms of "how" instead of "what". In non-trivial software design, it's usually best to think about the general requirements or goals first instead of the mechanics of carrying out those requirements.

      Higher-level languages do this better by encouraging thinking of the big picture first and then refining it down into specifics. A bottom-up approach may over-encourage students to think about gears before goals. It's almost like learning how to fix a car engine before learning how to drive.
               

    10. Re:Assembler... seriously by WH44 · · Score: 1

      I'm not sure I entirely agree with that. It makes them think in terms of "how" instead of "what". In non-trivial software design, it's usually best to think about the general requirements or goals first instead of the mechanics of carrying out those requirements.

      I think it is a good thing that they learn about the "how" before they learn the "what". Too often I have seen programmers assuming infinite precision in their real numbers and similar errors that someone who has dealt with the reality of bits and bytes would never do.

      If you are learning about anything new, be it karate or knitting or playing guitar, you learn the basics first - the block, the pearl, the chord - before you advance to "non-trivial" things - combinations, designing a sweater, the riff. Why should it be any different in making good software?

    11. Re:Assembler... seriously by Anonymous Coward · · Score: 0

      I'm going to have to add an 'amen' to that!

      Even a small amount of assembler, such as linking in a pure 'asm' function to a C/C++ program can be massively enlightening in terms of what the compiler is doing, how all of those arguments actually make their way into your function and how results find their way back out.

    12. Re:Assembler... seriously by KDR_11k · · Score: 1

      In German the language itself is called assembler, people think the name was taken verbatim from English.

      I had little trouble understanding ASM but then again I learned VHDL before ASM which gave me an understanding of how the chip itself acts rather than what control codes it accepts.

      --
      Justice is the sheep getting arrested while an impartial judge declares the vote void.
    13. Re:Assembler... seriously by KDR_11k · · Score: 1

      If you want general understanding I guess you could be really evil and start with one of those model-to-code programs that work on UML diagrams (Rhapsody was the one we used here but it was 5th semester, not first).

      --
      Justice is the sheep getting arrested while an impartial judge declares the vote void.
    14. Re:Assembler... seriously by Acer500 · · Score: 1

      I wonder if something more basic might be in order.. My degree is in Philosophy, so I had to take symbolic logic. There was a CS guy in my course though who actually went to the department and said, "this should be on the CS curriculum, because we really don't formally learn logic."

      We do have logic (including symbolic logic) as one of the first courses in both public and private university CS curriculums over here (Uruguay).

      --
      There are three kinds of lies: lies, damned lies, and statistics.
    15. Re:Assembler... seriously by DCheesi · · Score: 1

      I agree that CS students need to learn the underlying hardware/CPU architecture at some point early on. I don't think I *really* understood C/C++ pointers until I studied Computer Architecture.

      However, I don't think CS 101 is the place to do that (beyond a basic overview), and certainly not by forcing students to write assembler. If nothing else, you'll scare away a lot of students who are on the fence regarding their major, and waste the time of others who just want to learn how to write a simple program for a webpage or script or whatever.

      Remember, this is not just the first course for committed CS majors, it's also the introductory course for the casually curious. You want to give them some basic skills with commonly used programming languages/paradigms so that even if they never take another CS course, they'll still have learned something useful. You also want to give them an overview of what CS majors and professional programmers actually do on a regular basis, and for most of us that's NOT assembler programming.

    16. Re:Assembler... seriously by Anonymous Coward · · Score: 0

      Assembly is only one abstraction level above the actual hardware. Nobody expects students to become proficient in assembly. That would indeed border on torture. But without a basic understanding of the way a computer processes information, how do you expect students to understand what a compiler is?

      I think that assembly is no harder than BASIC, if you use it for things which the hardware can do directly. It would be useless to teach students how to do floating point arithmetic in assembly language on a microcontroller.

      6502 assembly is what I learned as my second language because I found BASIC too slow and limiting. The two biggest headaches were the initial lack of a good assembler and that I programmed on the same machine which my code crashed in a microsecond. In contrast, assembly programming is trivially easy today. There is a free development environment for the 8-bit AVR microcontrollers, complete with emulator and in-system-debugger. You can step through the code and when you're confident enough to try it on real hardware, the code is executed on a separate system and doesn't crash your development environment. It's child's play.

      You could turn to an abstract machine language, but I expect that students would prefer to see their steep first steps lead to something tangible and actually usable.

    17. Re:Assembler... seriously by Tablizer · · Score: 1

      I think it is a good thing that they learn about the "how" before they learn the "what". Too often I have seen programmers assuming infinite precision in their real numbers and similar errors that someone who has dealt with the reality of bits and bytes would never do.

      Perhaps they dropped out after the intro class. That knowledge should still come, just not at the beginning. If they are willfully dumb during part A, then they will probably be dumb during part B also. I'm not suggesting an either-or choice, but just suggesting the ordering be changed.

      If you are learning about anything new, be it karate or knitting or playing guitar, you learn the basics first

      Some Karate classes *first* talk about when and why to use and not-use force. It depends on the instructor. And in piano classes they sometimes teach the basics of music theory first, such as what a chord is, what dissonance is, the "typical" layout of western music, etc.
           

    18. Re:Assembler... seriously by po134 · · Score: 1

      'If you try and teach Java as a first course, you force the student to accept too much magic without understanding any of it.'

      I have to disagree here. We had to program our own list/sorted list/vector/tree and only at the end of the first semester the teacher said "everything you did already exist in the java librairies" that was one heck of a moment :P

    19. Re:Assembler... seriously by beej · · Score: 1

      I realize that I would probably not be interested in comp sci if I was thrown assembly the first day.

      Can I ask, why is that? What about assembly would have made it uninteresting?

      Difficulty? Low-level-ness? Amount of work required to do basic tasks?

      (This is an honest and respectful question, for the record.)

    20. Re:Assembler... seriously by cong06 · · Score: 1

      Can I ask, why is that? What about assembly would have made it uninteresting?

      You answered your own question then.
      Think about it. Why do people get into computer science programming? Because they want to program a game!

      When I took Java, the cool thing was making Pacman, or some other nifty visual thing that was easy to do. Then I could say "sweet! I can make stuff that looks cool!" I didn't say, "Sweet! I can control the computer on the Byte level, and control pixels on my screen!"

      I say that now.

    21. Re:Assembler... seriously by beej · · Score: 1

      You answered your own question then.
      Think about it. Why do people get into computer science programming? Because they want to program a game!

      When I took Java, the cool thing was making Pacman, or some other nifty visual thing that was easy to do. Then I could say "sweet! I can make stuff that looks cool!" I didn't say, "Sweet! I can control the computer on the Byte level, and control pixels on my screen!"

      I say that now.

      I think you're right about this for a certain class of people. I was talking to my brother about programming years ago, and he wanted to make a Norton Commander clone or something. Basically his first reaction was, "I have to do all that shit just to put some text on the screen?" (This was in C, mind you!) "Forget it."

      Another class of people get into it to understand the workings of the system... I think those types of people tend to love assembly and the low-level stuff.

      I wonder what would happen if schools identified students' motivations up-front, and then put them in specifically tailored tracks that cater to their interests.

      First impressions do mean a lot--could some people be better off starting with Scheme, some with Java, and some with assembly?

    22. Re:Assembler... seriously by forkazoo · · Score: 1

      'If you try and teach Java as a first course, you force the student to accept too much magic without understanding any of it.'

      I have to disagree here. We had to program our own list/sorted list/vector/tree and only at the end of the first semester the teacher said "everything you did already exist in the java librairies" that was one heck of a moment :P

      Respectfully, you really haven't disproved my point. Stuff like garbage collection still happens automatically. You don't get to actually see a real memory address. You just have to accept a lot of stuff happening which you can't see or control when you develop in Java. Even if you try to minimise your use of the standard library.

      Though, it certainly sounds like you got your hands dirty as best as possible, and I do respect that. Java is a language that you learn and then feel powerful because you say, "I can make the machine do things." Assembly is a language that you learn and then feel powerful because you say, "I know what the machine is doing."

      After a first course in Java, you couldn't possibly write a Java compiler. After a first course in ASM, you could probably write a self hosting assembler. That's what I mean when I talk about having to accept magic that you don't understand in Java.

    23. Re:Assembler... seriously by po134 · · Score: 1

      I understand what you mean now, but we learned C/C++ the following semesters which dove into the whole memory allocation issue and doing everything yourself instead of using managed language.

      Personally I prefered seeing quick result in the beginning with a UI and not having to worry about pointer and investigate how it was done later. It's personnal preferences and I know I might have been even more discourage to pursue my degreeS in CS if we had pass the whole first year with C or C++, those things can wait.

    24. Re:Assembler... seriously by po134 · · Score: 1

      your point is excellent. it is not only a course for people who want to pursue a career in CS, it is a window into the world of programming for all discipline and should therefor not include complicated thing such as memory allocation and all.

    25. Re:Assembler... seriously by Anonymous Coward · · Score: 0

      It is about programming, not crippling the mind. And SW-crisis tells us: Tackling the real hard problems like how to abstract and combine in a structured manner is hard.
      Nowadays learning assembler is like learning Latin to speak French and Spanish later. It may help but learn French and Spanish directly!
      But who am I? I started with MIX.

    26. Re:Assembler... seriously by Estanislao+Mart�nez · · Score: 1

      Choose a simple 8-bit micro such as an AVR first, or an ARM. Something with a RISC architecture is nice and clean.

      Um, why pick a real processor at all? I think a much better choice would be to use very simple VMs tailored toward the task of teaching programming. The VMs can abstract away detail that only gets in the way, and provide a lot more debugging information for the students.

      What should such a VM provide? My suggestion would be the following:

      1. Stack based, no registers. Make all operations pop their arguments off the stack, and push their results into it. There would be two stacks: an explicit one for operands and results, and an implicit one for subroutines.
      2. Five primitive data types: character, int, float, memory pointer and instruction pointer.
      3. Heap memory allocation and deallocation. You'd have an instruction/syscall that would allocate a memory frame of the desired size for you, returning a pointer to the frame.
      4. All memory accesses would be based off a frame pointer plus an int offset into the frame. The VM implementation would catch when you tried to access memory outside the frame, and basically tell you that your program doesn't work. Beyond that, pointer arithmetic would not be allowed.
      5. The instruction set should allow the VM implementation to keep track of the type of the value at every stack and memory location. Unless it can be proven safe otherwise, every instruction would be coded for the types of the values that it uses or produces. This allows the VM to catch type errors.
      6. A garbage collector that can be turned on and off as a startup option. If you run the VM in GC mode, it can analyze the stack and memory to find all the pointers, and use that to automatically free frames that the program can no longer refer to.
      7. Flow control would be unconditional goto to an instruction pointer, conditional goto to an instruction pointer, and branch to subroutine at instruction pointer.
      8. Simple, instructive compilers from a simple high-level language into the VM. The obvious candidate: a Scheme compiler. (This is the whole reason for including optional GC into the VM!)

      Basically, a VM like this could be used as an introduction to the basics of machine code programming, and then later reused to teach compilers.

  12. Alice by adnd74 · · Score: 1, Informative
  13. Dumbest ask slashdot ever.. by LingNoi · · Score: 1, Insightful

    How about instead of asking this you just go read the article posted hours ago about the creator of c++ and his views on education?

    http://news.slashdot.org/article.pl?sid=08/12/09/2017242.

    1. Re:Dumbest ask slashdot ever.. by Anonymous Coward · · Score: 0

      Hey, what if he has read that and he still want to ask? Just because Bjarne Stroustrup had created a language doesn't mean he is right at everything you know.

    2. Re:Dumbest ask slashdot ever.. by Anonymous Coward · · Score: 0

      Don't listen to him, LingNoi is a known bitcher. He's still bitter his cunning plan to buy a cheaper copy of Spore in the Thai language and convert it to English didn't work out.

    3. Re:Dumbest ask slashdot ever.. by Anonymous Coward · · Score: 0

      Yes, and while you are reading the article by the creator of C++ pay special attention to which language he advocates. Big surprise, C++!!! And also, be sure to put on your calendars that he has a book coming out for an intro course.... December 2008, NOW!!!! I'm all for giving credit where it is due, but that article reads like a big ad for C++ and Bjarne's new book. Impeccable timing, I might say. So perhaps the poster wanted views from OTHER PEOPLE.

    4. Re:Dumbest ask slashdot ever.. by Anonymous Coward · · Score: 0

      Because the submitted wants to know what to do, not what not to do.

      The man made C++, that's ample reason to avoid listening to him right there.

    5. Re:Dumbest ask slashdot ever.. by ari_j · · Score: 1

      How about instead of asking this you just go read the article posted hours ago about the creator of c++ and his views on education?

      More than likely, this Ask Slashdot was submitted days ago, long before the Stroustrup article was posted. The real person to blame here is, of course, kdawson, who actually posted both articles on the main page within about 5 hours of each other. Just be glad that the substance isn't as bad as it could be.

    6. Re:Dumbest ask slashdot ever.. by PantherSE · · Score: 1

      I agree this does sound like an ad for Bjarnne's book and C++. However, he does make a good point about the importance of "know how...to read & write English." I think a first programming course that focuses more on write design documents (I know that's not a popular thing), instead of diving into a programming language; because in my personal experience the people who write awful code are just as bad at expressing themselves (forget language barrier), and those who write good code are also very good at expressing themselves (I know of one person who on a couple of occasion had to ask another person to translate what he's trying to say).

  14. FP FTW by Rodyland · · Score: 1

    My first year, first semester University CS-101 course was in functional programming. I think it was a good idea as it forced us to think in a completely new way - including those of us who had some previous brushes with programming (C64-basic anyone?). Second semester moved on to C, and the joys of pointers and memory management etc.

    1. Re:FP FTW by timeOday · · Score: 1

      I'll go against the grain here and suggest whatever procedural OO you prefer - Java, C++, C#, etc. Where I went to school we went in the approximate order: Pascal, Assembler, Scheme, predicate calculus - seemingly anything and everything *except* plain old common languages that let students write software resembling what they see and use every day. I think that's a mistake. It's motivating for students to feel like they're writing "real" programs. Sure, eventually you should be exposed to all of them, but start off with something that has obvious application.

  15. How about Turing? by rcpitt · · Score: 1, Interesting

    Back in 1979 my first formal course in programming started out with the Turing machine - and frankly I'm glad.
    IMHO today's junior programmers don't have nearly enough background in either formal program definition or the underlying hardware that eventually ends up executing whatever the high level language compiles or interprets to.

    --
    Been there, done that, paid for the T-shirt
    and didn't get it
    1. Re:How about Turing? by Anonymous Coward · · Score: 0

      A Turing Machine is too far from our current (Von Neumann) architectures. Turing machines cannot do random access, so simple things like adding n numbers take O(n^2) time, which is not the kind of knowledge you want students to absorb. A much better model is the RAM (random access machine).

    2. Re:How about Turing? by inKubus · · Score: 2, Funny

      That and the Von Neumann architecture. What is the point of a computer really? Add, Multiply, Divide. Talk about the fundamental basic instructions, not x86 but what is a mov (oh it moves something). Translate some C code into ASM to see how that works. I would really dive all the way in immediately. You're not going to get it as a first year, but you learn by repetition, and you need concepts like this drilled into your head. Build a linux box in class compiling all the packages. After about a week of that (and resolving dependencies), you'll understand about the real meat of programming, compiling. Guess what, most languages are pretty similar. It's the delivery that makes it hard. For instance, there are things in PHP you have to know but never have to know in C, because you're dealing with the web paradigm. Sessions? Non-existent in C (well, you know what I mean). But most PHP is never compiled, yet it runs! Why is this? Compare/Contrast. Berkeley is known for two things: LSD and Unix. This is not a coincidence. Etc.

      --
      Cool! Amazing Toys.
    3. Re:How about Turing? by jeremyp · · Score: 1

      You're not going to get it as a first year,

      So in your CS course, your students are going to spend a whole year not understanding what you are talking about. Have you any idea how soul destroying it is attending a course which you don't understand?

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    4. Re:How about Turing? by TerranFury · · Score: 1

      Build a linux box in class compiling all the packages. After about a week of that (and resolving dependencies), you'll understand about the real meat of programming, compiling.

      Sorry, but this is the worst advice I've ever heard. That's fun as a hobbyist/"hacker" sort of thing, but completely worthless as a tautological experience in computer science. What do kids learn? How to fight with other people's nasty code, while executing magical incantations on the bash prompt that they just copied from a help forum somewhere?

      It'd be like trying to learn fluid mechanics by cleaning toilets.

    5. Re:How about Turing? by inKubus · · Score: 1

      How to fight with other people's nasty code

      To wit: Life in the real world.

      --
      Cool! Amazing Toys.
  16. Assembler by Progman3K · · Score: 1

    Teaching assembler is the base.
    After that, all digital representation can be understood as a patter on ones and zeros.
    Higher-level languages can then be mastered faster.
    Start at the base.

    --
    I don't know the meaning of the word 'don't' - J
    1. Re:Assembler by An+Onerous+Coward · · Score: 1

      I say the exact opposite. Start them out with a simple, expressive, productive language with excellent library support. Give them a language that abstracts away a lot of the complexities, so they can start writing useful programs straight out of the gate.

      I'd go with Ruby or Python. That way, you can introduce new paradigms (OO vs functional vs imperative) at your own choosing. Consider how much trouble it is to pass a function as an argument in Java (never mind C++) as opposed to Python. Or the fact that writing a fibonacci() function is easy in C, but writing one that will give you answers that exceed the bounds of your largest datatype is a nightmare.

      One transition path to bare-metal might be to have students write something
      in Ruby with very poor performance, then create C bindings that speed it up tremendously. But the ASM-first crowd seems to be of the notion that their introduction to CompSci was an exercise in frustration, that all that frustration must therefore have had great value, therefore a route with a gentler learning curve is a disservice to students.

      --

      You want the truthiness? You can't handle the truthiness!

    2. Re:Assembler by An+Onerous+Coward · · Score: 1

      I think my advice is especially good for introductory courses that get a lot of crossover from other departments (business administration, sports medicine, etc.), whose students won't be making programming their career. Languages like Python and Ruby allow for a broader swath of concepts to be taught. Give them a C++ intro like I got*, and I guarantee they'll leave with two incorrect impressions:

      1) Programming is all about bit-twiddling, making sure you free your mallocs, and tracking down null pointers.

      2) It isn't worth the trouble for them to attempt to write truly useful programs.

      But if your thinking is more in tune with Joel Spolsky's, that the intro to CS should be hard, you can have all sorts of mind-blowing, recursive, data-to-code-and-back in your course. I encourage it. But letting arcane syntaxes and gibberish compilation errors toughen the course is the lazy instructor's way out. Difficult experiences should lead to profound enlightenment, not "oh, I guess I needed to write there instead of 'stdio.h'."

      * This may explain a lot about my eventual career path.

      --

      You want the truthiness? You can't handle the truthiness!

    3. Re:Assembler by Progman3K · · Score: 1

      It's not so much that I want it to be hard for beginners.

      It is rather because in assembler, you must truly understand all the bits. The internal (binary) representation of your data, how signed and unsigned numbers work (2's complement) and the like.

      If you can make them see that, then all other languages become clearer. They then have a greater understanding of automatic memory allocation, even garbage collection.

      That is how it felt to me.

      After assembler, C made a lot of sense because I could see an almost direct correspondence with the instructions in C and assembler.

      Later, C++ and finally Java were easier to 'get' for me because of it.

      The original article seemed to be saying that abstracting away too much is producing programmers that can't think and don't understand their tools.

      Start with the base, then everything else makes a lot more sense.

      --
      I don't know the meaning of the word 'don't' - J
    4. Re:Assembler by An+Onerous+Coward · · Score: 1

      I don't discount the value of being able to think at the level of machine code. A "bare-metal" language like ASM or C should be introduced in the first year of study. But there will be plenty of opportunities to get students thinking in 1's and 0's.

      No matter which language you decide to introduce first, it's going to be the hardest one the students ever learn. My purpose in suggesting Python is to make sure that teaching the mechanics of the chosen language isn't overwhelming, to the extent that it obscures the concepts.

      Starting with ASM has the following drawbacks:

      * It makes the introductory course almost useless to anyone who doesn't intend to carry forward in CS.

      * Showing students the frustration before showing them the power leads to high attrition. Some argue that high attrition just weeds out the weak. I would counter that it actually weeds out the atypical CS student, which is a different thing entirely.

      * You can't implement important concepts like recursion in a straightforward, easily graspable way. Even straightforward concepts like the "function" and the "loop" get difficult to teach, with the mathematical properties getting lost in clumsy implementation details.

      * It's hard to come up with assignments that apply to the real world in a meaningful way. What's the most complex, real-world project you could assign at the end of an ASM-based class? It's practically a guarantee that a Python-based project would hold more interest. The experience of building something very useful very early is critical, and I don't think ASM makes that likely. Python + pygame = "hey, I built a cool game!"

      * You're going to spend the first two weeks of the course simply teaching the students how to set up and use their ASM software. Python is a quick install on any machine, and Ruby doesn't need an install at all: http://tryruby.hobix.com/

      In the end, programming is about solving problems, breaking them down into simpler parts, and learning to reason about those problems. If you can bring that experience using real-world tasks, rather than assuming that moves and loads and stores are inherently interesting, you'll get a wider variety of students hooked on programming, which will eventually make for a healthier discipline. Trust me, there is plenty of time to teach students to think in 1's and 0's, once you've convinced them that it's worth their time to do so.

      --

      You want the truthiness? You can't handle the truthiness!

  17. SICP by Anonymous Coward · · Score: 2, Informative

    Structure and Interpretation of Computer Programs was my first CS text and it forever changed how thought about computers and programming. I can't recommend it strongly enough.

    1. Re:SICP by andreyvul · · Score: 1

      Aaaaaahh! Lisp! My eyes!

      --
      proud caffeine whore
    2. Re:SICP by i.of.the.storm · · Score: 1

      I agree, it's a pretty great introductory textbook, especially because most people (like myself) who learned to program before college learned imperative or object oriented programming, and SICP forces you to think functionally and really learn the concepts.

      --
      All your base are belong to Wii.
    3. Re:SICP by FranTaylor · · Score: 1

      Edit your LISP code in emacs and you will never make that complaint again.

      Better yet, actually LEARN LISP, and you will know that syntax is irrelevant.

      One of the classic LISP lessons is how to translate LISP-syntax programs into C-syntax programs and back again.

    4. Re:SICP by maxwell+demon · · Score: 1

      Of course, to be bussword compatible, you'll have to translate it into XML and back. Luckily that's quite easy: Just replace (foo bar baz) with <foo>bar baz</foo> .

      --
      The Tao of math: The numbers you can count are not the real numbers.
  18. Orthogonal by QuantumG · · Score: 1

    "imperative" and "object-oriented" are orthogonal concepts.

    --
    How we know is more important than what we know.
  19. Teach them All by Maple+Syrup · · Score: 4, Informative

    The classic text SCIP teaches multiple computing paradigms. A fluent computer scientist should know all of them.

    1. Re:Teach them All by Anonymous Coward · · Score: 0

      Exactly. SICP is the way to go. It saddens me greatly that MIT's revised EECS curriculum abandoned it last year. In 6.001 they taught us functional, imperative, object-oriented, and assembly language programming, (and more!) all in one class. It's always puzzled me how at other schools the intro class (apparently) only covers one paradigm; what do they do with the other 10 weeks of the semester?

    2. Re:Teach them All by KanshuShintai · · Score: 2, Interesting

      How to Design Programs is essentially a gentler SICP, and it accomplishes most of the same goals.

    3. Re:Teach them All by i.of.the.storm · · Score: 1

      They did? No way! We're still using it at Berkeley and I don't think it's going away anytime soon, the guy who teaches it most of the time is obsessed with Lisp, or something, and he probably has a lot of clout and seniority and whatnot.

      --
      All your base are belong to Wii.
    4. Re:Teach them All by Eli+Gottlieb · · Score: 2, Insightful

      Reading the paper on HtDP, and one of the funniest conclusions is that female students seem to prefer the HtDP approach over traditional SICP or "Welcome to Java" classes by a factor of 4.

      Maybe the lack of girls in Computer Science has just been because the teaching has sucked.

    5. Re:Teach them All by mnkyby · · Score: 1

      funny, i heard the exact opposite from a few of my profs. i heard they planned on switching in a few years since MIT already switched over.

    6. Re:Teach them All by Anonymous Coward · · Score: 0

      Yes but companies don't hire computer scientist much, they are just looking for any code monkey that can get the program to work from the end user's perspective.

      Performance, blah. Maintainable, blah. Scalable, blah. etc. etc.

    7. Re:Teach them All by i.of.the.storm · · Score: 1

      Oh, wtf. I don't know anything about what the profs think but I just feel like Harvey is very attached to this book. I watched some webcasts and it seems like he always mentions how SICP is the best book for CS in the first lecture.

      --
      All your base are belong to Wii.
  20. Linguistics by denissmith · · Score: 3, Interesting

    Ways that meaning are encapsulated in different human languages can be a useful way to demonstrate the structural underpinnings of programming languages. Linguistics is more interesting than reading Boole and gives you a way to think about larger structures without tying you to a particular paradigm. All computer languages have strengths, all are inadequate. But so are human languages. There is a Korean word that expresses this exactly, but it doeasn't translate directly into English. :-)

    --
    I have nothing to hide. So, why are you spying on me?
    1. Re:Linguistics by Anonymous Coward · · Score: 0

      Ways that meaning are encapsulated in different human languages can be a useful way to demonstrate the structural underpinnings of programming languages. Linguistics is more interesting than reading Boole and gives you a way to think about larger structures without tying you to a particular paradigm. All computer languages have strengths, all are inadequate. But so are human languages. There is a Korean word that expresses this exactly, but it doeasn't translate directly into English. :-)

      what is that korean word?

  21. Consider Python by Fished · · Score: 5, Informative

    First off, a disclaimer: I'm actually not (much) of a Python programmer--I much prefer Ruby.

    However, my Dad teaches Math & Physics at the high school level, and got tapped to teach an intro to programming class this year. On my advice, he bypassed C++ (which he kind of knew) and Java, and taught it in Python using this book:

    Python Programming: An Introduction to Computer Science (Paperback)

    He has been absolutely delighted with the book and with how well the students have done with Python as a first language. His comment has been that he wishes he had been exposed to Python instead of (many years ago) Fortran and (more recently) C++ -- he might have actually learned to program. ;) It seems that Python's a good choice--it's an easy language to learn, supports procedural, object-oriented, and functional programming, and has all the usual advantages of a dynamic language for programmer usability.

    Now if only they would do a version of that book in Ruby... :)

    --
    "He who would learn astronomy, and other recondite arts, let him go elsewhere. " -- John Calvin, commenting on Genesis 1
    1. Re:Consider Python by TromboonDotPy · · Score: 2, Informative

      This is one of those questions that make people tend to talk past each other because they start talking about their favorite language rather than educational purpose.

      I'm sure that the educational purposes that motivate professors of young adults who have declared themselves computer science majors are rather different than those for high school CS teachers such as myself. I'll talk briefly about teaching high school, and let higher ed folks talk about their educational purposes themselves.

      I've taught procedural, functional (Scheme), and OO to high school students ranging from very young 9th graders to very advanced 12th graders for 18 years. None of these have been an utter train wreck, and all have caused interesting and worthwhile conversations.

      Lately, I have been teaching Python to Non-AP CS-1 for a few years. It has been an almost uninterrupted joy.

      I am totally convinced that ordinary 10th graders benefit from non-oo, state machine programming and tacking on oo late in the day.

      This serves the purpose of reinforcing a high school student's algebra, planning and workplace skills, and a welter of logical thinking skills that I can't believe are merely computer programming, such as understanding the distinction between type and instance.

      Another purpose CS-1 is serving is as a not-really feeder course for APCS. By which I mean it is not a formal requirement, but gives only a few things I have to deal with differently when they become AP students (teaching manifest typing vs. duck typing, for instance. But that's a worthwhile conversation).

      I would strongly encourage secondary CS teachers to investigate Python and perhaps other python-like languages, with the warning that there's no curriculum you can take off the shelf, and will need to reauthor your course so Python works for you. I note in passing that it is also a terribly friendly language for a teacher improvising while students are watching-- it generally does what you think it ought to do.

    2. Re:Consider Python by Anonymous Coward · · Score: 0

      Python is an awesome language for the beginner; I can't believe intro classes are still using anything else.

      I just recently took an Intro to Programming course with Alice: http://www.alice.org/ -- what a joke!

    3. Re:Consider Python by Anonymous Coward · · Score: 0

      Now if only they would do a version of that book in Ruby... :)

      Actually, there is a book like that for Ruby.

      Chris Pine's "How to Program". Excellent intro text. Check it out:

      http://pine.fm/LearnToProgram/

  22. Structured programming by ishmalius · · Score: 2, Insightful

    I've always thought that Java as a first language was a mistake. Students are forced to learn two concepts, structured programming and object orientation, at the same time. They should master one, then the other. For object orientation being second, it is not just a programming style, it is also an essential facet of design.

    Functional programming can come third. I know that a lot of FP people would disagree. But I really don't think that the beginner student would have a clear grasp of scope, stack frames, or method references until they learn something easier first. But, hey, third semester is not so late.

    1. Re:Structured programming by mrchaotica · · Score: 1

      For object orientation being second, it is not just a programming style, it is also an essential facet of design.

      Object orientation is only an essential facet of design if your design is object-oriented.

      Yes, it sounds like a tautology, but it's not. Object orientation is not necessarily the best way to solve some problems. For example, I just wrote a structural analysis problem in non-object-oriented Matlab because the point of the thing was to compile all the data into some big matrices and then solve them. The design of the program came straight from the equations in the text book. Similarly, something like a compiler is perhaps best implemented in non-object-oriented LISP.

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  23. I like Lisp, Haskell, Erlang, etc. by rolfwind · · Score: 2, Interesting

    Maybe even scheme although it is sometimes too minimalistic. Some languages such as C naturally incline toward a specific structure like imperative, some don't. But avoid C unless they are expected to write low level code.

    Why? Because out in the "real world", you are usually assaulted with C or it's derivatives. Not because these are the best languages, but they were faster when developed and took a strong foothold over the thinking of the programming community. It's rather a self perpetuating cycle like Microsoft Windows and operating systems. Another reason is that C/C++ is low level language masquerading as a high level one, with libraries to cover some of it's more glaring defiencies.

    Yes, they'll eventually have to learn C/C++ or a descendant, but that is not the point: it is because they'll have to learn C/C++ that you should teach them something else. Otherwise once you teach them C, mental inertia takes over and they'll be stuck in the C mindset for the rest of their lives and cannot imagine anything else. They'll have time enough to learn C in sophomore or later levels.

    Also, I wouldn't worry too much about "paradigms". Learn to attack problems one by one, making a program that fits each one best. Throw a lot of small coding problems at them, actually, to scale them up to bigger tasks. Thinking about a problem is great, but no reason not to learn coding by coding. I remember Paul Graham writing he never had used Object Orientation his entire life, although it would have seemed that some problems were initially screaming out for such a solution on paper. IMO, paradigms are usually taught as a way to evolve or grow a program an ongoing problem, so you don't end up with sloppy, spaghetti code - but I think experience and getting to see the big picture is more important than rigid paradigms. Afterall, most paradigms grew up from an person's experiences with one or a set of closely related problems that may not closely relate to another random set of problems.

    Stuff like rabid prototyping, etc, are in view more common sense (and better coding methods) than an exact paradigm.

  24. It's easy by squidinkcalligraphy · · Score: 1

    LISP: http://xkcd.com/224/

    More seriously, it shouldn't matter too much; a good programmer will pick up a new paradigm when it's needed. Less good programmers will just keep going in whatever they've learnt.

    --
    "I think it would be a good idea" Gandhi, on Western Civilisation
    1. Re:It's easy by laejoh · · Score: 1

      Yeah, start with Perl!

  25. None of them. by Metasquares · · Score: 4, Insightful

    I've found that good students tend to do well with any paradigm you introduce them to, while bad students do poorly no matter the paradigm. Few seem to be in the middle. I would argue that the choice of starting language or paradigm is therefore not as important as people think it is.

    *I teach an introductory data structures & algorithms course. The school I teach at just switched from C++ to Java.

    1. Re:None of them. by Tablizer · · Score: 1

      I've found that good students tend to do well with any paradigm you introduce them to, while bad students do poorly no matter the paradigm. Few seem to be in the middle. I would argue that the choice of starting language or paradigm is therefore not as important as people think it is.

      Settled, so teach them Brainfuck.

      Or even the WhiteSpace Language, composed of nothing but tabs, spaces, and line-feeds. Here's an example:

           

    2. Re:None of them. by Anonymous Coward · · Score: 0

      I've found that good students tend to do well with any paradigm you introduce them to, while bad students do poorly no matter the paradigm. Few seem to be in the middle. I would argue that the choice of starting language or paradigm is therefore not as important as people think it is.

      *I teach an introductory data structures & algorithms course. The school I teach at just switched from C++ to Java.

      I agree with that in general. However, teaching only in Java will almost always result in students that have little or no ability to relate their code with the architecture it runs on.
      While CS should, in theory, not be concerned with this, anyone who goes into actual programming in the marketplace will have to deal with this much more than the overall design of software.

      Or to put it another way, it won't really make much difference to a software designer, but a lot of difference to a software engineer. (kind of like how architects should know a little bit about physical construction, or else their beautiful designs simply can't be built in real life)

  26. SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by mrchaotica · · Score: 4, Insightful

    My first language was not Scheme -- I learned bits of LOGO and [Q|Visual|Ti-calulator] Basic as a kid. However, my first course at University was taught in Scheme, and it was by far the best computer science class I've ever had. Since then, my school has tried teaching freshmen Python, Java, and Matlab and they've all sucked horribly in comparison.

    (LISP, ML, Haskell, etc. would probably be just fine too.)

    --

    "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    1. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by thesupraman · · Score: 1

      Eiffel ;)

    2. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by Anonymous Coward · · Score: 1, Insightful

      Scheme and so on are swell and functional programming is cool... ...but name one significant real world application made in such a language.

      Just one. Not some horribly obscure thing, but something you can walk into Best Buy and buy off the shelf. Something non-comp-sci dweebs have *heard of*.

      *waits*

      *crickets chirp*

      *birds tweet*

      I wager that about covers it.

      Don't teach them a functional language. Teach them something *useful*. For better or worse, that's C++ in the real world, or *maybe* java. I don't think C++ is a particularly good language by any means, but it IS a useful language. Other languages have specialized niche applications, but C++ can build pretty much anything fairly well, from low level systems stuff to commercial games.

    3. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by Anonymous Coward · · Score: 0

      Scheme is a horrible first language!!

      Seems to me a lot if not most first CS courses are taught at universities with large engineering programs. In these courses, CS students are by and large a minority. Most students are engineering majors who might take two programming courses, ever. Throwing Scheme at them to teach good coding practice in C or Java is like teaching someone to drive a semi by putting them on a scooter.

      Anyhow, it seems probable you went to the same university I did (a largish one in a southern city with a flying insect mascot, not to name names), in which case, the problem with starting the kids off on Python, Matlab, or Java had more to do with the department than the languages.

    4. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by fishbowl · · Score: 1

      I know a somewhat computer-illiterate choir director who uses Lilypond to set music for her church choir.

      And I know plenty of non-comp-sci dweebs who are power users of GIMP.

      Pixar is known to have used AL.

      There's three for you, and while none are the commercial/boxed consumer product you're looking for, they are all very much real world implementations.

      --
      -fb Everything not expressly forbidden is now mandatory.
    5. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by mrchaotica · · Score: 1

      Scheme and so on are swell and functional programming is cool... ...but name one significant real world application made in such a language.

      First of all, who the fuck cares?! If you want a vocational certification, go to DeVry or something!

      Second, just off the top of my head, AutoCAD is written in LISP. Counterexample, bitch! Eat it!

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    6. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by mrchaotica · · Score: 1

      Most students are engineering majors who might take two programming courses, ever. Throwing Scheme at them to teach good coding practice in C or Java is like teaching someone to drive a semi by putting them on a scooter.

      Oh yes, I completely agree. However, you're missing the point! Scheme -- or any "CS 101"-type class is not about teaching "good coding practice in C or Java!" It's about teaching people to think in algorithms. Not only does it take way more than two classes to learn "good programming practices" anyway, but your boss can teach you that when you have your first code review. But understanding the fundamentals of algorithms, including recursion and such, is much more fundamental.

      Besides, how would Python or Matlab teach good C or Java programming practices anyway?

      Anyhow, it seems probable you went to the same university I did (a largish one in a southern city with a flying insect mascot, not to name names), in which case, the problem with starting the kids off on Python, Matlab, or Java had more to do with the department than the languages.

      Good guess. However, I thought the department did perfectly well with Scheme, although I admit that a lot of non-CS students hated it. I still think they were better off for it.

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    7. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by FranTaylor · · Score: 1

      Did you actually learn Scheme? It is very easy to learn, IF it is taught correctly.

      You will find yourself programming very complex stuff within a few hours.

      Learning Scheme first will make you a better programmer in every other language. It matters not at all that Scheme is not used commercially.

      MIT teaches it as a first language and they seem to turn out quite a few successful software people.

    8. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by Pinckney · · Score: 1

      I thought the department did perfectly well with Scheme, although I admit that a lot of non-CS students hated it. I still think they were better off for it.

      It is my sense that almost all of the students in my first-year CS class hate Scheme, even though the class is targeted at future CS majors. I, on the other hand, will probably major in math, and enjoyed it quite a bit. YMMV

    9. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by xristoph · · Score: 1

      Just saw this one AFTER posting above... *sigh*
      I second that! Scheme is a very good first programming language to teach concepts of programming. Even though it is probably a bad language to do real-world coding in. Also, it is good for sieving out those who should not study CS in the first place *laughs diabolically*
      For *some deity*'s sake, DO NOT teach a scripting language like Python as a first programming language! It's nice to program in, no doubt, but only /after/ one has mastered OO or proper functional programming.

    10. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by K.+S.+Kyosuke · · Score: 1

      I am not sure what this "significant real world application" should be, but Digital Orrery, a tool that once pushed our knowledge about Solar System dynamics quite further, was written in Scheme, debugged and then "compiled" into hardware and built, if I remember correctly. A similar feat was building a Scheme processor by compiling it from Scheme into hardware. Try this with your C++. ;-)

      --
      Ezekiel 23:20
    11. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by dkf · · Score: 1

      Seems to me a lot if not most first CS courses are taught at universities with large engineering programs. In these courses, CS students are by and large a minority. Most students are engineering majors who might take two programming courses, ever. Throwing Scheme at them to teach good coding practice in C or Java is like teaching someone to drive a semi by putting them on a scooter.

      If they don't want to learn about CS, why are they taking a CS course at all? If they just need the credits, perhaps they should take something different.

      FWIW, I went to a place that used ML as the first programming language. Now I didn't do that course (I was a physical sciences student at the time) so when I switched to CS I had to catch up while on vacation. ML has the property of being possible to learn from a book by just doing the examples on paper without any access to a computer at all: a purely mathematical understanding is all that's needed. Ended up doing my final year project in ML. (I wouldn't use it for anything real, of course: too difficult to control object identity. OCaml is a bit better, but identity control remains an issue; sometimes you really are better off going to Java or C++.)

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    12. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by XDirtypunkX · · Score: 1

      Most of AutoCAD isn't written in LISP. That's just the way you interface with it.

    13. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by mnkyby · · Score: 1

      emacs

      GIMP

      Orbitz (they use Common Lisp for calculating airline fares)

    14. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by Anonymous Coward · · Score: 0

      +1 I also think scheme is a very good starting point. It got me really confortable with recursion (whereas before I would avoid it like the plague, even for easy programs), and as a starter class allows you to explore programming at a very high-level and to teach you another way to think about problems before you go all imperative and OOP.

    15. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by TerranFury · · Score: 1

      Try this with your C++. ;-)

      Interesting post; I didn't know that'd been done.

      You might be interested to know that there are products that do this with C as well though. E.g., "Catapult C," which takes in C code and spits out Verilog/VHDL. But designing hardware in C is a little like using a screwdriver to drive a nail, so it's not like I'd recommend these tools. I imagine that functional languages are somewhat better for this.

    16. Re:SCHEME, FOR THE LOVE OF GOD, SCHEME!!!!!!!!!! by DragonWriter · · Score: 1

      Scheme and so on are swell and functional programming is cool... ...but name one significant real world application made in such a language.

      Just one. Not some horribly obscure thing, but something you can walk into Best Buy and buy off the shelf.

      Final Fantasy: The Spirits Within. (Apparently, it was used as high-level glue.)

  27. Wrong question by SanityInAnarchy · · Score: 1

    More than that, there are other concepts, like functional programming, which are somewhat mutually-exclusive with imperative programming.

    And I would say, don't teach a paradigm at all. For your very first class, give them something like this introduction to Ruby. After they have a vague concept of how a program goes together, then you worry about teaching them other paradigms -- ideally, they should learn all of them eventually.

    Also, avoid starting them with something like COBOL, Visual Basic, or Java. These things may tend to rot their brains.

    --
    Don't thank God, thank a doctor!
    1. Re:Wrong question by i.of.the.storm · · Score: 1

      I think it depends more on how people are taught rather than the language they start in. I taught myself to program with Visual Basic and then later learned Java, and I had no problem picking up Lisp (Scheme) and excelling in CS so far. I don't think all the people who started out by learning BASIC had rotten brains, either.

      --
      All your base are belong to Wii.
    2. Re:Wrong question by SanityInAnarchy · · Score: 1

      Well, hey, I did start with QBASIC, but I didn't do very much.

      I did, however, have to un-learn most of what I learned in C++ and Java. So, "rotton brains" isn't maybe the right phrase, but you want to avoid learning bad habits -- easier to pick them up than to cure yourself of them.

      And you're absolutely right -- it does matter more how people are taught. That's another reason I linked to tryruby -- I find _why to be quirky and often irritating (I wanted a tutorial/reference, not a comic/collage!), but this is one thing he's gotten pretty much perfect.

      --
      Don't thank God, thank a doctor!
    3. Re:Wrong question by i.of.the.storm · · Score: 1

      Yeah, I can see how you could develop bad habits with VB but there are probably those kinds of things in every language. I think Basic type languages are good for getting your feet wet because you don't have to think too much and when you're not used to programming it might seem daunting to do C or Lisp or something, but Basic is more friendly. It's probably best to do the actual CS teaching in another language though, because at least for me with VB, after learning a real OO language trying to continue a project I had started in VB was just too painful.

      --
      All your base are belong to Wii.
    4. Re:Wrong question by SanityInAnarchy · · Score: 1

      I think Basic type languages are good for getting your feet wet because you don't have to think too much and when you're not used to programming it might seem daunting to do C or Lisp or something

      That's, again, why I recommend Ruby. Not too much you have to think about right away, but...

      after learning a real OO language trying to continue a project I had started in VB was just too painful.

      That doesn't really happen with Ruby.

      Sure, it's going to be painful because you know much more now than you did when you started the project -- but that's true regardless of the language.

      But you don't find yourself suddenly disgusted with the language after you learn more -- at least, that was my experience. And, equally important, you don't have to make that big a conceptual leap from your early days of picking up the language to realizing its full potential -- it's a natural evolution.

      And, again, less to unlearn -- compare to JavaScript. You can stay in the same language, but you'll have to unlearn the "with" command, avoid using implicit global variables, stop using document.write (ever!) or eval (almost never!), push everything into separate files (and not in in some onClick or onSubmit event in the HTML), at the same time as you're learning closures, OO, and prototypal inheritance.

      I love Javascript, but that's only after forgetting half of what I thought I knew about it.

      If you've got time to reply to me, spend 15 minutes instead and follow that link, type "help", and follow the tutorial. Both to learn a bit of Ruby, and to understand just how good an introduction to programming can be.

      --
      Don't thank God, thank a doctor!
    5. Re:Wrong question by xouumalperxe · · Score: 1

      I don't know how versatile ruby is in this regard, but if we're going to suggest languages rather than paradigms, like the OP asked for, I'd go with python. Which brings us to a long-winded answer to the OP, too: You can start off with the interactive shell to do small stuff, proceed to writing imperative style code as "batch shell" to "save" common interactive shell tasks, evolve into writing programs that are more complex than one-offs (which obviously can't be done as an interactive session) -- This is a very natural progression of ideas.

      I implicitly suggested that you should start with imperative, then procedural programming. Those are very natural ways to do things, they are very susceptible to the "cook book" metaphor. Simple recipes are almost purely imperative. More complex recipes are either huge imperative affairs, or much simpler to read and write procedurally, with sub recipes (you refer to the sauce recipe, the side dish recipe, etc). You can also use this metaphor to good effect to highlight a difference: reproducibility. Recipes that are done "sort of like this" yield results that are inconsistent. If you mass produce, say, cakes, you do things much more precisely and consistently (irrespectively of actual quality). Boost that hundredfold, and you have computer programs, which are completely unambiguous (actually, deterministic) from the machine's perspective.

      Once you got those concepts down, hopefully your students have had some calculus, and the notion of compound and higher-order functions won't be strange to them. That's when you move on to more functional aspects of python, like mapping anonymous functions to arrays, and other such ideas. Full-fledged functional support is somewhat lacking, so I'd suggest some Lisp dialect after on the second semester, to fully explore what you started before. The key issue here is that you want to rapidly highlight the advantages and disadvantages of functional vs imperative.

      Choice of language matters loads too, in my opinion: Mostly, I'd try to do as much as possible on top of one single language. You can hop along from language to language too, but I'd say that keeping to one language that supports all you're trying to teach serves a great purpose: it highlights what differences are a paradigm shift, rather than mixing in the confusion of the change in syntax. This implies you need a language that supports as many paradigms as possible in as unobtrusive a way as possible.

      I'd leave OOP for software engineering subjects. I'd say OOP is not so much a programming paradigm per se as it is explicit language support for a number of constructs and concepts that can be put in practice in mostly any language. More than providing more insight into how to express algorithms, it's a way to keep things tidy and avoiding excessively verbose code, so it's not an actual core CS subject.

    6. Re:Wrong question by xouumalperxe · · Score: 1

      Rereading the post, I think it became unclear that the whole "versatility" thing was aimed at python having decent functional capabilities and a rather unusual OOP implementation that really highlights some of the core aspects of OOP, rather than the interactive shell (which is much better than, say, perl's, though).

    7. Re:Wrong question by SanityInAnarchy · · Score: 1

      I'm not suggesting languages so much as _why's introduction to Ruby. Follow that link, and you get an interactive shell (in a web page!) with a 15-minute tutorial, which guides you through not only the language, but an introduction to programming in general.

      Yes, I use Ruby a lot, so I'm biased. But if _why had done that for Python, I'd be recommending that, too. I don't agree with everything he does, but this one is pretty amazing.

      --
      Don't thank God, thank a doctor!
    8. Re:Wrong question by i.of.the.storm · · Score: 1

      Cool, thanks, I probably will sometime. Yeah, I can see what you mean by unlearning stuff, although I don't think I picked anything bad up from VB, just that it was horrible limited pre .Net and .Net isn't really the same as VB6 so I might as well move on to a more capable language anyway.

      Ah, this brings back memories of about two weeks ago, when we had to write a logo interpreter for our CS project, just because we used the same characters for a prompt. Good times. This also seems somewhat reminicent of python, or at least the smidgen of Python that I know. I will definitely look into this more, as well as Python, because right now I feel a bit limited by Java when I just want to automate a short task. And Ruby and Python seem like they would be more fun to do web development in than PHP, although I don't really know PHP well, although I guess some would say that it's impossible to code PHP well.

      --
      All your base are belong to Wii.
    9. Re:Wrong question by SanityInAnarchy · · Score: 1

      I guess some would say that it's impossible to code PHP well.

      I thought so, too. Then I discovered Drupal.

      I am now convinced that it is possible to code any language well, but you'll spend much of your time re-implementing things that you get for free in other languages. Drupal was written before PHP started to (sort of, half-assedly) make itself object-oriented, so they built an object-like plugin system on top of it.

      I'd much rather work in a language which goes out of its way to make it easy to code well.

      --
      Don't thank God, thank a doctor!
    10. Re:Wrong question by Anonymous Coward · · Score: 0

      Wow, that was a pretty awesome tutorial. Are there any of those for other languages? I'm looking to really learn Python, since I sort of scraped together a site with it on Google AppEngine (it's a hackish way of doing a server browser for a small networked game I'm writing without actually having my own server) and I'd like to learn more about it. Ruby seems to have a bit in common with python. The ruby tutorial seemed geared towards non-programmrs, which is kind of cool. Is the { |foo| foo.blah} etc structure a lambda kind of thing? That's an interesting notation.

    11. Re:Wrong question by i.of.the.storm · · Score: 1

      I wouldn't really know about whether PHP makes it hard to code well, and I see a lot of sites/packages written in PHP that are very nice, like MediaWiki, Wordpress, Joomla, Drupal, etc. I never got into the object oriented portion of PHP, but I can imagine it must have been a pain to have to write one. Although I've personally never had any problems with PHP, I am hearing more and more about its limitations and defects so I'm looking into other languages for web development. Thanks to you, now I can speak Ruby and I'm also looking into Python, which is fun. The AC comment was from me, not sure why it's AC though.

      --
      All your base are belong to Wii.
  28. Two ways by bigmonachus · · Score: 1

    A very good read related to this is "The Perils of Javaschools" by Joel Spolsky. http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
    I think that paradigm choice is secondary compared to teaching in a way that will stretch the student's mind.
    C++ was the language I used when I started getting serious about programming. Before that I used Basic dialects. My experience learning to program in C++ wasn't very enlightening. There were just a lot of compile-time errors, and I spent a lot of time looking for them. If I'd had a teacher it would have been much easier.
    I think that if you're going to go imperative, the best choice is a bottom-up approach, in which you start out pretty close to the metal and go up from there, not focusing so much on computer science theory than on pointers.
    You don't really appreciate garbage collection unless you have had the pain of managing the memory manually.
    The approach that I think is best, is to start with a very high level language in which you can teach basic computer science without the language getting in your way. Preferably a functional language =)

  29. Everyone learns in different ways. by Anonymous Coward · · Score: 0

    I first learned programming by reverse-engineering binaries in a hex editor. Starting out, I edited data structures in the program to see the effects; later, I started working with interpreted bytecode and later assembly language. I was 16 at the time. A year earlier I had tried C and just couldn't comprehend how it worked -- but there's no way to learn how computers run that provides the same experience as ASM and hardware manipulation.

    I'll freely admit that OOP was a huge leap at first. My brain focused on efficiency in terms of cycles rather than programmer productivity. However, it took less than a year to become proficient in C++ and as a result just about any language that works in a similar way.

    Now I'm in college studying engineering. Were it not for learning programming two years ago, I would be nowhere -- probably some liberal arts major with no idea of where to go in life. I can't comprehend learning programming in any way other than this one, and yet I see online people saying, "don't learn assembly, it's too hard and not very useful." It took me a while to realize that different people learn in different ways, and they tend to recommend the way they learned most to others.

  30. Robots by dswt · · Score: 1

    They make a great context for learning, and are fun too, appealing to a broad community at various levels. A number of groups are exploring, researching and promoting robotics-based beginner programming classes. Gaming and multimedia provide other great contexts for learning.

    The paradigm is less important IMO -- as someone already said, you ideally need to understand many. Context is the more important factor.

  31. Logic is important by EmbeddedJanitor · · Score: 1

    It should definitely be in a CS curriculum, bit perhaps not in a first programming course.

    --
    Engineering is the art of compromise.
  32. Learn at least two paradigms WELL by _greg · · Score: 5, Interesting

    I recommend learning at least two languages representing significantly different paradigms during a programmer's formative period. In this instance I consider C, C++, Java, C# and the lot to be in the same paradigm - procedural.

    Haskell is a good language for exploring the functional paradigm. Smalltalk is good for object oriented. There are many good Prologs for learning logic relational programming. I recommend that a new programmer avoid multiparadigm languages until they have seriously explored programming in a more pure way in two or more paradigms.

    I used to recommend SICP, now I recommend CTM.

    Also important is to (1) enjoy the programming you are doing and (2) work on programs which do interesting things and get you feedback from others.

  33. Dijkstra's Method? by BobKagy · · Score: 1

    A couple of days ago Slashdot had Twenty Years of Dijkstra's Cruelty. In it, he proposed using a non-executable language to force the students to use formal methods to prove the correctness, rather than trial-and-error testing.

    I was quite disappointed to see the conversation devolve into Python -vs- C -vs- Java -vs- Haskell, all of which are not what was proposed.

    Has anyone gone to a University that does it the way Dijkstra proposed? (Does the University of Texas at Austin still do it this way? Any comments on it if they do?)

    I'd think if your aim is to be a programmer at a commercial house later coursework would need to emphasize the skills needed for making successful software, as Stroustrup emphasized. But would Dijkstra's course be a better starting point?

    1. Re:Dijkstra's Method? by vrmlguy · · Score: 1

      A couple of days ago Slashdot had Twenty Years of Dijkstra's Cruelty. In it, he proposed using a non-executable language to force the students to use formal methods to prove the correctness, rather than trial-and-error testing. [...] But would Dijkstra's course be a better starting point?

      Do you know how LISP was created? http://www-formal.stanford.edu/jmc/history/lisp/node3.html#SECTION00030000000000000000

      Another way to show that LISP was neater than Turing machines was to write a universal LISP function [...] Writing eval required inventing a notation representing LISP functions as LISP data, [...] S.R. Russell noticed that eval could serve as an interpreter for LISP, promptly hand coded it, and we now had a programming language with an interpreter.

      And that's the problem with Dijkstra's idea. As soon as the non-executable language is specified, some smart-alec's going to code an interpreter for it, and *poof* you're right back where you started.

      --
      Nothing for 6-digit uids?
    2. Re:Dijkstra's Method? by Eli+Gottlieb · · Score: 1

      Dijkstra's course is a horrible idea. It's like showing students formal languages as the basis of an introductory English Writing course. Teaching formal methods from the start just turns students off, because practical and non-trivial programs simply don't have formal proofs of correctness (halting problem and similar issues).

  34. OOP is imperative programming by SpinyNorman · · Score: 0, Redundant

    OOP isn't an alternative to imperative programmg - it's a form of it.

    OOP is contrasted with procedural design - also a type of imperative programming. The classic description of the difference between the two is that to implement a written specification, for OOP you implement the nouns (objects), else for procedural you implement the verbs (procedures).

  35. "excessive" reliance on libraries!?? by toby · · Score: 2, Insightful

    Re-inventing the wheel is the pathology.

    One of the most significant advantages of Java *is* the availability of mature libraries! They are there to be used.

    --
    you had me at #!
    1. Re:"excessive" reliance on libraries!?? by i.of.the.storm · · Score: 1

      I agree, although it makes it harder for me to move to other languages because I keep looking for stuff like the JDK documentation and being disappointed. I'm kind of able to write C but I don't know much more than the theory of memory management and I'm working on learning more because C runs on (almost) everything.

      --
      All your base are belong to Wii.
    2. Re:"excessive" reliance on libraries!?? by Megane · · Score: 1

      Re-inventing the wheel after you finish your education is pathology.

      Knowing how to re-invent the wheel, and how to do it properly, is what's important. Every CS graduate should be able to put an implementation of strcpy() on a white board in under five minutes. In elementary school, you need to learn how to add and subtract by yourself before you can go using calculators to do higher-level stuff.

      Otherwise you end up with yet another WTF.

      That's the difference between a craftsman and a random person standing in the day-labor crowd in front of Home Depot. One of them has a Yellow Pages listing because you can trust him to see the big picture, instead of nailing up a bunch of boards until someone (maybe) points out to him that he's installing everything upside-down.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  36. Separate ideas from the language implementation by dougwhitehead · · Score: 2, Interesting

    I was a CS major in 1979 at VT and we had a beginning course that taught principles in pseudo code and programming language and assignments in Labs. Each student was in one of four labs where they taught implementation of these techniques in: C, Pascal, PL1, or Fortran.

    This curriculum was way ahead of its time. I have always felt it gave me an amazing foundation. (Unfortunately it was abandoned as the department watered down the undergraduate program to expand the curriculum into grad school)

  37. The political paradigm by GaryOlson · · Score: 2, Interesting

    Take a little from every one. Then promise you can deliver in whatever language your prospective future employer wants.

    --
    Every mans' island needs an ocean; choose your ocean carefully.
  38. Teach students something they aren't familiar with by iteyoidar · · Score: 2, Informative

    I think the dude who invented Haskell had a pretty good insight in this interview where he was asked about teaching functional programming for a first programming class:

    I don't know - I don't actually have a very strong opinion on that. I think there are a lot of related factors, such as what the students will put up with! I think student motivation is very important, so teaching students a language they have heard of as their first language has a powerful motivational factor. On the other hand, since students come with such diverse experiences (some of them have done heaps of programming and some of them have done none) teaching them a language which all of them aren't familiar with can be a great leveler. So if I was in a university now I'd be arguing the case for teaching functional programming as a first year language, but I don't think itâ(TM)s a sort of unequivocal, "only an idiot would think anything else" kind of thing!

    Teach new students some sort of bizarro language so the ones who have been programming for years will be on the same level as everyone else.

    It was from this interview: http://www.computerworld.com.au/index.php/id;1974033854;fp;;fpid;;pf;1

  39. LISP by Anonymous Coward · · Score: 0

    programming in *any* language is better than talking about programming...

    1. Re:LISP by fishbowl · · Score: 1

      These days, I think I would propose not accepting students into the major who can't show, by the time they are a freshman in college, significant programming ability in at least two different computer languages.

      We don't take music majors who can't play an instrument, and we don't take math majors who are not at least ready for calculus. (We do take English majors who are barely literate but I think that's an accident :-)

      Seriously, if you waited until college to start learning to program computers, you've wasted half your life already, and are *far* behind your competition.

      Offer introductory courses for non-majors, or accept community college intro credits. But don't even offer a 'first year' course in programming for CS majors. There shouldn't be a CS major who needs any such thing. It's 2009, not 1979.

      --
      -fb Everything not expressly forbidden is now mandatory.
    2. Re:LISP by maxwell+demon · · Score: 1

      It's 2009, not 1979.

      I'm pretty sure it's still 2008.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    3. Re:LISP by fishbowl · · Score: 1

      If you are talking about starting college, it's a 2009 concern already. I realize that it's not January yet, but next week is dead weak for the Fall 08 semester, and we are deep into planning and budgeting for Spring 09.

      --
      -fb Everything not expressly forbidden is now mandatory.
  40. Stack of Pancakes by Anonymous Coward · · Score: 0

    Why do the CS teachers always draw the stack from top to bottom? When I get a stack of anything I start putting stuff on the bottom. If these types of paradigms are used its no wonder people don't get it.

  41. problem solving first, programming second. by blackcoot · · Score: 2, Insightful

    if it were up to me, i would teach a first course in computer science using only pencils (maybe pens for the foolhardy) and paper. i say that as someone who has t.a.'d a lot of programming classes.

    the issue, at least as far as i've observed, is that until a student has a solid ability to start decomposing a problem using top-down and bottom-up approaches, trying to teach them any kinds of programming language or algorithms is pointless. it's like having a carburetor and no car.

    i would suggest that c.s. instruction, especially at the early phases, should aim to make students spend a lot of time asking questions like: "what information do i need to solve this problem?", "what is the easiest useful thing i can do to help solve this problem?", "what's missing from my solution?", "is it easier to break this step down more or just do it right here?", "how can i join X and Y to do Z?", etc. once you get students asking those questions, picking up programming languages is a lot easier: they know what they want to do, all they need to focus on is how.

    1. Re:problem solving first, programming second. by jaxtherat · · Score: 1

      I strongly agree. I software shop I worked in previously suffered from dumbass graduate developers, who suffered not from lack of ability to write code, but from not being able to comprehend problems, think laterally, and come up with some sort of sane solutions.

      Anyone can memorise the syntax of a language. Not everyone can apply it logically.

      --
      http://www.zombieapocalypse.tv/
    2. Re:problem solving first, programming second. by laejoh · · Score: 1

      Excuse me? Real programmers use butterflies and an open window, not pencils and paper.

    3. Re:problem solving first, programming second. by maxwell+demon · · Score: 1

      You didn't read the title tag, did you? :-)

      --
      The Tao of math: The numbers you can count are not the real numbers.
    4. Re:problem solving first, programming second. by galia · · Score: 1

      I agree that sometimes the coding gets in the way of really understanding the problem and coming up with a good solution. However, from the 6 classes I've TAed I've noticed a lot of students are driven by the gratification of code that does something. I TAed a course where homework was done in two steps. First they turned in the pencil & paper part, and then for the 2nd part they coded it up. An intro class needs a balance of thinking about the problem and also gratification that comes with coding.

  42. Spare me the elitism, please. by Anonymous Coward · · Score: 0

    Oh my goodness. What you learned way back when, "when they did things right", or even recently, is not relevant. As someone without a background in programming, and no, not everyone has one, particularly outside of the Slashdot community, I would like to be informed in an introductory language that will be A) useful, B) relatively easy, and C) representative of the broader scope of programming languages.

    I don't think it's unreasonable to ask Slashdot for advice in this matter. I can't wrap my mind around this pervasive notion in the computer science/software engineering community that if you don't have knowledge of every language known to man from the get-go, you are a worthless cad.

    If someone could just state a language and a justification, I would be everlastingly grateful.

    1. Re:Spare me the elitism, please. by treeves · · Score: 1

      Several people *have* (including IIRC Scheme, LISP, Perl, Python, BASIC et al.) and others have pointed out in each case why it's also the wrong choice ;-) However, none of those comments answers the OP's question, which wasn't to suggest a particular language, but a paradigm - and there have been some answers to that too. Skip over the grumpy posts. Every Slashdot thread has them. Based on comments I've seen, I'd probably start trying to learn Scheme and/or Python... if I wanted to start anything at all.

      --
      ...the future crusty old bastards are already drinking the Kool-Aid.
  43. Your first paradigm won't do you much good by Anonymous Coward · · Score: 0

    Twenty cents doesn't go very far these days.

    *ducks*

  44. Paradigms by stdion · · Score: 1

    I'd start with the way CPUs process code which is typically imperative, covering Python, assembly then C. Python so they can get the high-level concepts if they are new to programming as a whole. Assembly so they can see how instructions are truly carried out on a machine and issues related to instruction sizes, etc. (mov, cmp, jmp, .. keep it simple). Then C, so they understand why imperative programming is structured the way it is. I'd then cover its perceived weaknesses (I love C but understand its shortcomings) and why C++/Java/others were invented around C. I'd then introduce them to Haskell, Erlang, Scheme/Lisp, etc. that completely break away from this model and why. Give a little history on their purpose and assign real-life examples to work through so they may have a warehouse of tools at their disposal rather than a hammer.

    That's the way I wish I would have learned it. If a student is passionate about programming, he'll find reasons to explore more languages and understand their niche regardless, but as I said, the discovery would have gone a lot faster if I had been taught it rather than wondering around without a guide, ie, being self-taught.

  45. Scheme by linuxhansl · · Score: 1
    I am forever grateful to my professor (at a German university) to have started all of us with Scheme to learn the basic principles of programming, complexity, computability, etc.

    She even taught object oriented programming using Scheme (yes, you can implement encapsulation and message passing using lambda calculus quite easily).
    Later we applied those principles to other languages (the most popular choices at that point were Modula-2, C, and of course C++).

    I have never used Scheme in a professional environment since, but the lessons learned then still stick with me almost 20 years later.

    1. Re: Scheme by icebrain · · Score: 1

      Georgia Tech, right?

      My take on Scheme:
      I came in fall 2002 as an aero engineering major. At that time, everyone took CS1321, which was the Scheme-based class. Lots of people struggled--and frankly, I think it was useless for anyone who was not a CS major; they never really grasped the language or anything about programming. Basic or Matlab would have been better for them.

      Thankfully (at least for those who followed me), the course was soon broken up. The non-technical majors got a Java and Python-based class with an emphasis on media stuff, the engineers got a Matlab course (laugh and get it out of your system; maybe it's not "real" programming but it's what the vast majority of us are actually going to be using later on), and I think CS went to Java.

      Incidentally, I wound up as the only non-CS person in the accelerated section of 1321--which was, well, different. But that's a story for another time.

      --
      The meek may inherit the earth, but the strong shall take the stars.
  46. Storytelling Alice by Simina+Branzei · · Score: 2, Informative

    What about this: "Storytelling Alice motivates middle school girls to learn computer programming". Kelleher, Pausch, Kiesler. CHI 2007. Seems a useful paradigm for girls.

  47. A language no one knows about by SkinnyKid63 · · Score: 1

    My first language at the university level was Meta. Technically, it was Scheme/Lisp. From there on out it has been all C/C++. I'm finishing a course in Assembly.

  48. Procedural, then object orentied, and lots more by poundjd · · Score: 1

    A computer is a turning machine, and people easily relate to procedure based programing at first. Object programing encapsulated procedures in side of objects methods for various good reasons. the concept of objects is just a little harder for students to grasp at first. once they have a decent handle on those then I'd introduce the concept of recursive programing, and then stack based programing. Once they had the basic concepts form these four approaches to programing then really start expanding their awareness of other types of programing models and exposure to many languages. On of the most educational classes I had in collage was comparative languages. In that class we solved the same 10 problems in 10 different programing languages. Really opened my mind to the fact that every problem is different and while there are approaches that allow the problem to be addressed in any given language, there were some problems that were obviously much simpler to some in some languages than in others. Any competent programmer today is a multi language programmer and picks up the next language quite easily and quickly. This is where the college would really excel at providing graduates that were really ready to enter industry as productive people. -jeff

    --
    -jeff Thank God that I am Vertical and Employeed!
  49. If you really want early drop outs ... sure by Pinky's+Brain · · Score: 1

    CS is not about programming I know ... but still, starting off with pure math without any applied courses is just a bad idea (at my uni advanced logic is a freshman course for CS BTW).

    1. Re:If you really want early drop outs ... sure by Acer500 · · Score: 1

      If you really want early drop outs... sure

      CS is not about programming I know ... but still, starting off with pure math without any applied courses is just a bad idea (at my uni advanced logic is a freshman course for CS BTW).

      That's kind of the goal in the public university over here (Uruguay)... since the budget only supports ~ 300 students and over 3000 enroll, they have to make the other 2700 drop out, they do that by teaching advanced calculus (multi-dimension integrals for example), advanced logic, physics, etc... all for a basic CS degree. Add bad teachers and frequent strikes, and you have a "winning" recipe

      I dropped out, and I considered myself a good student... I enrolled at a private university, and graduated with no trouble (though I can't do multi-dimension integrals, but I've never needed them so far and don't think I ever will).

      I do think teaching logic is a good idea (and I barely passed that course, as well as the physics courses, etc...)

      --
      There are three kinds of lies: lies, damned lies, and statistics.
    2. Re:If you really want early drop outs ... sure by story645 · · Score: 1

      CS 102 at my school is discrete math. And there's a whole lot of math built into the core. (3 calc courses, chemistry, physics, etc.) so I don't see how logic's that different. Plus it's a great way to weed out the kids who should really know this stuff for later courses.

      --
      open source modern art: laser taggi
  50. back in the old days... by micromuncher · · Score: 4, Informative

    I went to an unnamed university that did not teach languages specifically. First year was theory, basic architecture, and PDP11 assembler on a simulator. There was one introduction to structured programming with Pascal.

    Year two saw more theory including algorithms and data structures. The language chosen was modula-2 and we were expected to pick it up on our own. There was another low level course on hybrid 6502/68000 machines writing low level I/O in assembly. Again, we had to pick it up ourselves.

    Year three got fun with hardware; async circuits, build your own 68000 based computer, OS (multitasking) and database concepts. We also had our new software engineering courses learning all about CMM and such.

    Fourth year was simulation, HCI, write a compiler, and special projects. It was assumed we'd picked up C/C++ by that point on our own.

    There were three streams at our U; hardware, computer graphics, or knowledge sciences. There was a lot of math - that I didn't appreciate until after I left. But one I learned is why and how things work at a low level. It was a computer science degree.

    Programs like this don't seem to exist anymore; at least if they do they're more in engineering than compsci. This is really too bad. Because as one post already noted; the problem is one of problem solving vs. skills to get a job.

    I still use state machines, optimization, algorithms, data structures knowledge in everything I do. Most of the people I work with have no idea why I care about such things, but usually they're impressed that my stuff just works more better.

    IAE my advice to you is learn as many languages as you can because no one specific language or paradigm encompases computer science. Go do some lisp, smalltalk, java, and assembly programming... you'll see what I mean.

    --
    /\/\icro/\/\uncher
    1. Re:back in the old days... by Anonymous Coward · · Score: 0

      I still use state machines, optimization, algorithms, data structures knowledge in everything I do. Most of the people I work with have no idea why I care about such things

      I want to see their algorithm and data structure free code!

    2. Re:back in the old days... by RockWolf · · Score: 1

      impressed that my stuff just works more better.

      Just like that awesome grammar checker you're using? ;)

      --
      February 9th, 2009 8:55pm: Slashdot becomes self-aware.
    3. Re:back in the old days... by fonduesatdawn · · Score: 1

      I am doing an MEng in microelectronics and software engineering and so we are split across the school of electronic engineering and the school of computing science. What this means is that I have had to use C/C++, Java, Haskell, x86, PIC and 68000 assembly, and various modelling/scripting languages as appropriate. The school of comp sci is predominantly Java based courses, but they say this is only so that the language is known by everyone and so more advanced techniques can be introduced without everyone starting from scratch with a new language. The school of engineering on the other hand use whatever language they happen to prefer for a given module (granted it is sometimes predetermined by hardware etc) and as a result there is much head scratching at practical sessions over the most basic points such as how to even use a given development environment etc. However I strongly agree with one of the above posters in that good students will thrive on this challenge, and adapt to whatever programming languages are put in front of them, whilst bad ones will not. The school of computer science remedy this by forcing one language strongly down everyones throats (and this is just one of their many methods of hand holding including attendance registers etc) whereas the engineering dept just let you fail miserably (unless you take it into your own hands ask for help!). I much prefer the latter, by university everyone should be taking their education into their own hands.

    4. Re:back in the old days... by andot · · Score: 1

      I wrote my first program in ALGOL. Then came BASIC and then Pascal. In university we used mostly PASCAL in introduction course. I really gave us some good habits. I'm pretty sure first language should be imperative language. At least as long as our computers use pure imperative instruction set inside. After all programmer should have at least some kind of view what would his code look like after compilation. Assembler is too hard for beginner. C and Basic are good for cultivating bad habits. OO languages are too far from basics of programming for beginning. Forth's real bitch to learn. Functional languages are mostly theoretical implementations which emulate functional programming on imperative machines. So my vote goes to Pascal.

    5. Re:back in the old days... by micromuncher · · Score: 1

      Or its a reference to pirates of the caribbean. Checkers are for wimps.

      --
      /\/\icro/\/\uncher
    6. Re:back in the old days... by Anonymous Coward · · Score: 0

      "an unnamed university".

      Please, when, what university and in which country?

      Looks like a parallel universe or something like that.

  51. C in intro to programming? Yikes! by Spazmania · · Score: 3, Informative

    I like C. I'm a C maven. But I'm *really* glad I didn't learn C first. My first programming courses were taught in Pascal. The good habits I learned there have saved me from writing really poor code when I graduated to more flexible languages like C.

    --
    Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
    1. Re:C in intro to programming? Yikes! by hudsucker · · Score: 1

      I agree -- C is too low level for an introductory class, and OOP is too high level.

      My first language (after Basic) was Pascal, and I did most of the college courses in Modula-2.

      Of course we also learned FORTRAN, Forth, COBOL, Algol, SNOBOL, PDP assembler (with no operating system), APL, Ada, Prolog and COMPASS.

      But no C!

    2. Re:C in intro to programming? Yikes! by Anonymous Coward · · Score: 0

      WTF guys. Pascal and C are the same, except for some cosmetic differences:

      := <-> =
      = <-> ==
      begin <-> {
      end <-> }
      n: integer <-> int n
      ...

      C has some extra operators (i++, ++i, ...), but you don't have to use them.

    3. Re:C in intro to programming? Yikes! by SoulRider · · Score: 1

      I definately agree, I also started with Pascal but the school I went to switched to Modula-2 right after it was released (I actually like Moduala-2). There are many good teaching languages (scheme, pascal/modula-2, Ada, lisp and many, many more), just make sure the language uses strictly applied rules, for example strong typing and/or modularization rules.

      I am a firm believer that C should not be taught until much later, after the students have had proper coding practices beaten into them. When I was in school we werent even allowed to use C until our senior year. C is a good practical language for getting real work done, but without a proper foundation in coding best practices C/C++ becomes downright scary. C is sort of the fire of programming languages, its very useful if you know what you are doing but extremely dangerous if you dont, Perl falls into this same category.

    4. Re:C in intro to programming? Yikes! by maxwell+demon · · Score: 1

      Pascal has several differences which make it much better for learning than C:

      • Pascal does much stronger type checking.
      • Pascal dynamic allocation/deallocation is typed (like C++'s new) rather than untyped (like C's malloc)
      • Pascal has a built-in set type (no fiddling with bit operators necessary; indeed, in Standard Pascal that's not even possible).
      • (Standard) Pascal doesn't have explicit typecasts (which is good for learning).
      • Pascal has far fewer implicit type conversions.
      • Pascal has a separate boolean type (no integer-as-boolean).
      • Pascal doesn't have unsigned types with unexpected semantics (in C, "n
      • Pascal distinguishes between real division (/) and integer division (div). Which C beginner wasn't caught by the fact that "1/2" gives 0? In Pascal is gives a 0.5 as expected.
      • Pascal has pointers, but no pointer arithmetic. Moreover, pointers cannot point to global or stack variables, so if it points to something, you can deallocate it (but Pascal does have uninitialized and dangling pointers, just like C).
      • Pascal has index checking (although compilers allow to disable that). An out of bounds index terminates your program instead of causing undefined behaviour.
      • Pascal assignments are statements, not expressions. Thus you cannot by accident put an assignment into an if (BTW, even if you could, it would usually be caught because if needs a boolean expression, and most assignments are not of boolean variables; there's no implicit conversion to boolean either)

      Now, whether Pascal is the best learning language is another question. But in comparison to C, it's a clear winner.

      --
      The Tao of math: The numbers you can count are not the real numbers.
  52. Math by spydabyte · · Score: 3, Interesting

    The basics of all computing, why we started building circuits, was mathematics. Algorithms was originally "dirty math" but now contains some of the most elegant mathematical proofs ever, due to the expansion of computing.

    An era ago computing majors were unheard of, they were applied mathematics majors.

    1. Re:Math by spydabyte · · Score: 1

      Although my first official schooling of computers was C++ and the hanoi towers paradigm. Recursion brought out some beauty concepts. It wasn't until several years later that I learned about OS and language designs.

    2. Re:Math by FranTaylor · · Score: 1

      If you learned C++ first, I bet you learned a lot about memory allocation and pointers before you learned about the Towers of Hanoi.

  53. Well, that's your problem then ... by gordguide · · Score: 2, Insightful

    " ... I'm interested in language-independent opinions that Slashdotters might have on this matter. ..."

    Slashdotters don't have any language-independent opinions. Sorry.

  54. Our U. has the same problem by d3ckard · · Score: 1

    The university where I work on IT Staff tries to thread the needle on this. I am taking a beginning programming class for the first time in 20 years. While I did some BASIC and Pascal (I even just rediscovered Logo from my prepubescent days!), I had long gotten away from programming, turning into a hardware geek. But I went back to pick up some new skills ... the school uses Java for most of its classes, including the first two intro classes. Later, for the majors there is some C, Python and Assembly. But the instructor I had this semester tried to teach code first, emphasis on getting things working, before picking up classes and objects late in the semester. Contrast that with other instructors teaching different sections of the same course that go all out for the OO approach. Still, the focus of the major is that a student should be able to step out into the real world and adapt to any number of languages within about a week;s time.

  55. Not sure about others, pleased with Python by KingAlanI · · Score: 3, Insightful

    In my senior year of high school, my senior project was essentially an independent-study intro to programming.
    My advisor suggested Python (version 2.4 at the time), and thought that C/C++ was a bad idea for an intro language (C++ had been my initial suggestion)

    I was pleased with the result; I felt that Python's straightforward English-like syntax, lack of funky punctuation as a structural construct, as well as not having to start scripts with declarations or somesuch, meant that I didn't get bogged down in arcane language features as I was trying to practice basic concepts.

    (I came into that with no code-writing experience beyond simple HTML/CSS/JavaScript)

    --
    I listen to both RIAA and non-RIAA stuff if I like the music, tangential business/politics nonwithstanding.
    1. Re:Not sure about others, pleased with Python by jonaskoelker · · Score: 1

      as well as not having to start scripts with declarations or somesuch

      #!/usr/bin/python
      from sys import stdin, stdout, stderr

  56. Using Gamemaker to teach OOP by CalcuttaWala · · Score: 1

    I teach information system to a bunch of folks in a Business School where it is infra dig to be viewed as a programmer !!! Being a programmer myself I find this ludicrous but have discovered that by using Gamemaker -- a visual development environment for arcade style games -- i can get across the basics of Object Oriented Programming with much less effort. Many of my students do not realise that they are actually writing programs but get a good idea of objects, attributes, methods and instances !!! Gamemaker is available free of cost but it is not open source.

    --
    Insight into much, Influence over nothing !
  57. Any simple language by sentientbrendan · · Score: 0

    What makes C a good introductory language is that it is simple syntactically. The core language can be picked up quickly, and then work can be done.

    That is is imperative/functional/low level/high level doesn't really matter. A good course will cover roughly the same algorithms material.

    The important thing about a first programming language is that the language should get out of the way.

    Good educational languages:
    1. C
    2. scheme

    Languages that shouldn't be used for intro courses:
    1. Python
    2. Java
    3. C++
    4. small talk
    5. SML

    These are all excellent languages (except java) but they all have something in common. They implement polymorphism (either runtime via vtables or compile time via generics/templates). Think about that for a second, how do you teach polymorphism to someone who doesn't know what a loop is? You don't. That stuff comes later.

    In addition, the "for each" loop which most of these languages have (now even C++), hides the details of iteration and recursion; which are important concepts you want to teach.

    Finally, the fact that the underlying language already implements all the data structure and algorithms that you are trying to teach undermines the course, because the question always comes up "why are we learning this when it is already written?".

    1. Re:Any simple language by Anonymous Coward · · Score: 0

      What makes C a good introductory language is that it is simple syntactically. The core language can be picked up quickly, and then work can be done.

      Then scheme would make a very good intro language. Its syntax consists of strings and parenthesis.

    2. Re:Any simple language by julesh · · Score: 1

      They implement polymorphism (either runtime via vtables or compile time via generics/templates). Think about that for a second, how do you teach polymorphism to someone who doesn't know what a loop is? You don't. That stuff comes later.

      "This is an object. An object is like a small program running inside the computer that can send and receive messages to other objects. When it receives a message, it performs a sequence of actions that have been associated with that message. Different objects can have different actions associated with the same message."

      Very simple. The heart of OOP and polymorphism, encapsulated in four sentences that almost anyone capable of learning to program can understand.

      Polymorphism can be confusing. But only to those of us approaching it from a procedural programming standpoint and asking "how the hell does that work?". When Alan Kay invented smalltalk, he used it to teach programming to kids. Most of them grokked the idea of objects and polymorphism very quickly. It was simply a case of presenting it the right way.

  58. Hmm by m6ack · · Score: 1

    #include <stdio.h>
    void def_msg(const char *carp) { printf("Goodbye Cruel %s!!!\n", carp); }
    void alt_msg(const char *carp) { printf("Hello %s!!!\n", carp); }
    struct statement {
            void (*msg)(const char *);
            char *who;
    };
    int main(int argc, const char *argv[])
    {
            struct statement say = { def_msg, "World" };
            if (argc > 1) {
                    say.msg = alt_msg;
                    say.who = argv[1];
            }
            say.msg(say.who);
    }

    1. Re:Hmm by Anonymous Coward · · Score: 0

      You just made me vomit in my own mouth.

  59. From an educator's standpoint..... by fractalboy · · Score: 1

    Up until a few years ago, I taught programming languages at a few different summer computer camps, to kids basically ranging about 9-17 years old, for a total of about nine or ten summers. And for what it's worth, I also currently work full-time in a science/tech program for middle school and high school students in an urban area.

    For the not-yet-(anywhere near-)college age groups, I have found that C++ is by far and wide the best teaching language, mainly due to its flexibility. That is, you can cover OOP if you want, but you don't have to. You can cover interaction with actual computer memory, but you don't have to. Etc. I think that is a much more important premise than narrowing the root of programming excellence down to one singular paradigm.

    The actual discipline of computer science, like virtually all academic fields, is not actually laid out in a nice, neat, linear, easy-to-teach, and trivially-defined path. C++ gives new learners of CS many different avenues to branch out to without the rigors of learning multiple languages as an initiation ritual. Say what you want about the language in general (or for any other specific purposes) but it is an absolutely fantastic teaching language because it has the potential to cover many important paradigms.

  60. Teach your students... by nathan.fulton · · Score: 0, Flamebait

    As a high school students, one of the most mind-numbingly annoying things about our school's programming courses is that they are taught to the lowest possible denominator... in Java. To the point at which we can complete an entire semester of assignments in the first week or two of the course.

    If you're going to teach, teach. Some of your students are not complete idiots, and are capable of going in depth on data structures, basic algorithms, etc.. The other ones can spend a semester teaching themselves how to make a hello world program without understanding what's going on. Or fuck it and just fail them.

    I guess what I'm trying to say is, some of us students aren't taking computer programming so we can blow it off and get a bullshit A. And courses that aren't doing it right turn us off to the entire field.

    1. Re:Teach your students... by gandhi_2 · · Score: 1

      You Sir, are exactly the kind of young man that gives me hope in this world.

    2. Re:Teach your students... by An+Onerous+Coward · · Score: 1

      Unfortunately, you are in high school. This means that you're going to have to work around the fact that A) the teacher may not have a full grasp of the material he's trying to teach, and B) the students are going to have a wide variety of prior experience and motivation. Don't begrudge the n00bs their need for help.

      But by all means, talk to the teacher, ask for more challenging material, extra assignments, etc. Offer to prepare a lecture and teach a concept that you feel the class should include. Ask if you can write an assignment in a different language (or two, or three). If you're really up for a challenge, you could work on an auto-grading system that compiles programs, runs them, verifies the conformance of their output, and gives handy explanations.

      Above all, don't give up on CompSci until you've gotten a few college courses under your belt. They're not perfect, but they'll be far above what you're getting now.

      --

      You want the truthiness? You can't handle the truthiness!

  61. perl by DaveAtFraud · · Score: 0

    I'd say perl since they're going to end up cranking out garbage code anyway once they get hired. They may as well get used to the world's first "write only" programming language.

    On a serious note, I vote for C as the first programming language. It has the ability to express high level abstractions while also letting the students do things like arithmetic on characters. It's critical for a first course that students at least begin to understand both extremes. They need to understand that computers work on bits and they need to understand how a program can still present an abstraction.

    Languages that hide too many of the underlying details leave students with the impression that the computer is doing some of the thinking for them. They don't understand that everything the computer does boils down to pushing bits around. At the other extreme, assemblers mean the students spend way too much time mastering arcane syntax while learning very little of what a computer can do. The students understand the bits but then switch to a petroleum engineering major that pays well and they can understand why it's important.

    Besides, we need a new crop of kernel hackers.

    Cheers,
    Dave

    --
    They that can give up essential liberty to obtain a little temporary safety deserve neither safety nor liberty.
    Ben
    1. Re:perl by not-my-real-name · · Score: 1

      I'd say perl since they're going to end up cranking out garbage code anyway once they get hired. They may as well get used to the world's first "write only" programming language.

      I take it you've never heard of APL?

      --
      un-ALTERED reproduction and dissimination of this IMPORTANT information is ENCOURAGED
    2. Re:perl by julesh · · Score: 1

      perl [...] the world's first "write only" programming language.

      Actually, that honour goes to APL.

    3. Re:perl by DaveAtFraud · · Score: 1

      Replying to both comments regarding APL. Actually I used APL briefly during my days as a math grad student. It kind of got lost back with all the other things I've forgotten from thirty years ago. Once you jogged my memory at least a few bits and pieces came back like "domino A" (where A is a square matrix) was how to get the inverse of A. What isn't intuitive about that?

      Oh yeah, I was using APL on an IBM 5100 desktop computer. Never used it for anything more than a big calculator when my abstract algebra class was delving deeper into linear algebra and doing things like getting eigenvalues. It definitely made the computations a lot easier instead of doing that sort of stuff by hand.

      Cheers,
      Dave

      --
      They that can give up essential liberty to obtain a little temporary safety deserve neither safety nor liberty.
      Ben
  62. GW basic by blueseraph · · Score: 1

    My first programing language was GW basic. I believe the first thing you should learn is the logic behind programing before you learn how to implement it.

    This is my list for the order programs should be taught in. FTR
    GW basic -> WTF is programing
    Visual Basic -> Lets Go OO
    Visual C++ -> Where the real programing begins
    PHP -> In a server far far away
    Cold Fusion -> now we're just effing with you

  63. How come no one has mentioned BASIC? by JeremyMorgan · · Score: 1

    In all seriousness, I started out in middle school tooling around with BASIC, but my real programming career started out with functional C. It's very basic, and simple enough to learn, and I have found that even to this day every new language I learn always seems familiar... like C. I definitely see the value in Java, mostly for teaching OOP, and I think its a great second step. If they start out with C and get their feet wet with it and move on to OOP, it seems like a solid foundation to build on.

  64. Something easy and powerful by sleepypsycho · · Score: 1

    Since it is a first programming course start simple but get them doing something that is interesting. A powerful declaritive language that can do some cool thing will help motivate the student. They will get a glimpse at the possibilies and power in what they are doing. Maybe an interpretted lanquage with its own environment would be a good choice, such as something akin to Matlab. At the end of the course you can start to introduce the other concepts like OOP and functional languages. Give them problems that are difficult to solve and then show them how these problems are address in other languages. That can't learn it all in an introductory course. Give them a taste and they can go where their interests take them.

  65. yet another attempted plug at upping functional pr by Locutus · · Score: 2, Insightful

    I started reading the story intro and wondered if it wasn't another ploy to get a discussion going on functional programming since I've seen these quite a number of times in the last month. Sure enough, there was the plug and look at all the functional fan boyz talking it up.

    Earlier it was multi-core programming, now this 'best paradigm for a 1st prog course'. What next, best compiler or maybe best OS for running functional programming applications?

    FYI, the answer is OOP.

    LoB

    --
    "Anyone who stands out in the middle of a road looks like roadkill to me." --Linus
  66. No excessive reliance or libraries? by Meor · · Score: 1

    It sounds like you already have your mind made up so I'd just go with that.

    Libraries are what make or break languages. Libraries are the cornerstone of modern programming. No libraries? You need to start learning digital logic and buy a breadboard.

  67. Basic by fireheadca · · Score: 1

    If you can understand BASIC then you can understand ASM. Well, that was my order and it worked out well for me. BASIC teaches you underlying routing and design. ASM teaches you wtf is going on. Everything else becomes, well, basic.

  68. how about Processing? by SemperUbi · · Score: 1

    What do people think about Processing as a good first programming language? I'm learning it, after not having done any programming since the 80's (BASIC and APL), and it's very easy to learn. It was intended as a way to teach graphic designers and artists how to program. This might be good in a course for non-CS majors.

  69. Forth by Animats · · Score: 0

    There's some liberal-arts school that teaches Forth as a first programming language. The idea is that it's close enough to the machine to make it clear what's really going on, but abstract enough that you can get reasonable amounts of work done with modest amounts of code. It's like the MIT approach of teaching Scheme; nobody writes much production code in Scheme, but it's a straightforward language with a clear underlying model.

    (I'm not recommending writing anything real in Forth at this late date. Twenty years ago I used it for some robotics work, but only because there wasn't a C compiler for the 68HC11 at the time.)

    1. Re:Forth by Baldrson · · Score: 1

      You beat me to it. Forth is very good pedagogy as an introduction to computation. If Forth weren't available, I'd almost suggest assembler simply because you get a real feel for what a computer is actually doing when you tell it to do something. Almost because there is no good interactive assembler shell to let you easily do I/O to my knowledge -- something you'd need to avoid overwhelming the student. You also get an appreciation for how much work the other languages do for you.

  70. How to teach recursion by Normal_Deviate · · Score: 1
    For homework the prof made us solve the "Towers of Hanoi" problem in Pascal. With our skills, it took about 300 lines and a long, long weekend.

    Next class, the professor explained recursion. He demonstrated its power by solving the Towers of Hanoi recursively in four (4) lines of Pascal.

    Zing. 25 years later I remember that moment crisply.

    The difficult and crucial part of teaching is motivation.

  71. take it old school by Tumbleweed · · Score: 2, Funny

    Start with LOGO. Turtle graphics all the way!

    Then you choose your platform, and go with whatever version of BASIC runs on the 8-bit platform of choice: Apple ][, C64, Atari 800, TRS-80 or Coco, whatever.

    Once you've mastered that, just jump to the future and go with 64-bit asm and contribute to Menuet OS .

  72. It does not matter by FranTaylor · · Score: 1

    It does not matter that Scheme is not commercially successful.

    Scheme is a very simple language to understand and learn, yet it contains EVERY tool necessary to write the most sophisticated programs. It is the perfect language to learn how to program.

    This is like your six year old saying, "Name me one Tour De France rider who uses training wheels".

    MIT turns out a lot of great software people, Scheme is what is taught in their introductory class.

    1. Re:It does not matter by mnkyby · · Score: 1

      not anymore. they use python now.

  73. Your best answer is implicit by our answers.... by gandhi_2 · · Score: 2, Insightful
    ...not explicit.

    About half of the posts thusfar, on /. of all places, display a lack of understanding of the programming paradigm-sphere.

    How many posts here just extolled (or decried) the virtues (or problems) of "functional" programming languages like C and C++? Functional is not Procedural. Functional != just programming with functions.

    Even here, among the (arguably) nerdiest nerds on to ever move mice... many people don't really know. So maybe you need to start there...a sampler course with various paradigms and languages so people will actually know how all these things fit together. Some functional OCaml, some imperative::procedural C, and some imperative::OO Java. Mix it up.

  74. BASIC is TERRIBLE! by FranTaylor · · Score: 1

    BASIC is a terrible introductory language. It is very limited and it will forever stilt your understanding of how computers work and what you can do with them.

    1. Re:BASIC is TERRIBLE! by narcc · · Score: 1

      Are you being serious? Basic was designed to be an introductory language. What makes it 'terrible'?

      I'm not sure what you mean by "it is very limited". Even the unstructured basic on the C64 is Turing complete.

      As to your assertion: "forever stilt your understanding of how computers work" I'm sure that there are millions of 30-somethings that learned basic on their 80's home computers who would beg to differ. I'd be interested to know how learning anything (let alone a programming language) would forever hamper your ability to learn something else.

      Better yet, I'd love to hear your answer taken a step further to your "and what you can do with them". Can you image what such a person would be like? Some one who was perpetually inhibited from conceiving of new computer applications? "I learned Basic on my BBC Micro and now I can't even understand what a spell checker is." Give me a break.

      On the topic, I think a Basic with an interactive mode (like Python has) would make an excellent introductory language. (Logo would also be a good choice for the same, painfully obvious, reasons.)

    2. Re:BASIC is TERRIBLE! by LWATCDR · · Score: 1

      Basic was a terrible first programming language and yes I was one of the C64 generation.
      Why was it terrible.
      1. No long variable names.
      2. No local variables.
      3. No Recursion.
      4. GOSUB instead of true procedure calls.
      5. No structures.
      I could go on but it really was terrible.
      TrueBasic solves most of those problems as does VB I think but I never learned VB.
      Today you have many better choices then Basic as a first language.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    3. Re:BASIC is TERRIBLE! by narcc · · Score: 1

      You didn't bother to explain how learning basic can cripple someones mind. That's what I was really interested in.

      Anyhow, I address your specific objections below. None of which apply to modern versions of the language.

      1. No long variable names.
      The C64 allowed variables of any length, but only considered the first two characters to be significant (the rest were ignored). GW-Basic (1983) allowed 40 character variable names (where all the characters were significant)

      2. No local variables.
      That's not entirely true.
      For example, the following program:

      DEF FNSQR(X) = X*X
      LET X=5
      PRINT FNSQR(10), X

      Outputs: 100 5

      Of course, that's just for unstructured versions of basic. Every structured basic I've seen has proper scope rules. (FYI, structured basic has been around longer than the personal computer.)

      3. No Recursion.
      A valid objection, though modern versions of basic don't suffer this limitation. It should also be noted that it's trivial to convert a recursive function to one using iteration. (Example) It's often a good idea.

      4. GOSUB instead of true procedure calls.
      Break out the old assembly book and check out CALL/RET! Seriously, it's obviously not an issue an any structured basic (which necessarily has "true" procedure calls).

      5. No structures.
      It has all the coolest control structures, if that's what you mean.
      Do you mean records? (example in c: struct x {int a; char b[5]; float b;}; )
      Explain yourself!

      It still doesn't explain why basic is a poor choice for a first language. It was the first language of millions of first-rate programmers (that is to say, their minds were not permanently injured!). What about basic makes it such a poor choice? Is it the name that bugs you?

    4. Re:BASIC is TERRIBLE! by LWATCDR · · Score: 1

      I meant data structures.
      I don't think that basic will cripple anybody. It just doesn't teach good methods from the start. Basic was my second language and I actually enjoyed it.
      I did mention that TrueBasic fixed most of the problems with Basic.
      The thing is that today you have so many good free options that are better than Basic and multi platform that I see no good reason teaching basic as a first language.
      Cripple you for life? Not really. Teach bad habits? Yes it did.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
  75. Good lord, not C++!!! by FranTaylor · · Score: 1

    You really do not want to spend your introductory programming experience learning about memory allocation and why the computer does funny things when you run past the end of an array.

    1. Re:Good lord, not C++!!! by Anonymous Coward · · Score: 0

      While you try to understand the practices and purpose behind OOP, no less.

  76. Theory is foundation to build upon, Lang come & by jackspenn · · Score: 1

    I learned on C, LISP, ML and JAVA, back in mid-90s. But the interesting thing is that I haven't really used any of those languages post college. I have instead used vbscript, bash, powershell, python and occasionally C#. Do I think my studies were a waste, not at all, I learned the core theoretical concepts behind programming. In fact I would argue my college (University of Pennsylvania) Profs had the following view (if we were going to teach you want was in now, it would likely be out by the time you graduate) so instead we are going to teach the theory so that when you "get out" you can focus on the "in" language you need to succeed. They gave me the fundamentals and I merely needed to learn the symantics of whatever language I meeded for a project. It has worked and when I find people who haven't had the theory and I try to explain something or witness their confusion, it is just so clear they are missing huge conceptual parts. That said, I think python is a good language to teach with because it is so simple to build useful apps that in JAVA or C would take many many more lines of code. As for when to introduce objects, that is a hard one, some books dive right in, others delay. I think objects are to big to get your head around at first, new programmers may think you understand, but there is a lot there. I think it is best to go over core fundamentals, variables, assignment statements, if statements, loops, etc. first and then bring in objects. I think you then need to teach and reteach objects in various ways so you can make sure they are understood. For me I thought I understood objects from the beginning, but looking back there was some fuzziness, which is hard to explain now that it is been clear for awhile now. I think explaining object oriented programming concepts repeatedly, but using different teaching methods, examples, etc. helps to make sure students eventually have that point where it "clicks". As a disclaimer I am paid to be a network admin, who uses scripts to make my life easier (Should make sense now why I use the languages I do). Only reason I avoid PERL is that I like to build scripts that are readable by others.

    --
    Respect the Constitution
  77. FORTRAN by Joce640k · · Score: 1

    A good programmer should be able to write FORTRAN code in any language.

    --
    No sig today...
    1. Re:FORTRAN by xristoph · · Score: 1

      That will need a lot of #define s :)

    2. Re:FORTRAN by maxwell+demon · · Score: 1

      That will need a lot of #define s :)

      Not at all:

      typedef int FORTRAN;
      FORTRAN code;

      --
      The Tao of math: The numbers you can count are not the real numbers.
    3. Re:FORTRAN by mog007 · · Score: 1

      A good programmer should be able to use butterflies

    4. Re:FORTRAN by xristoph · · Score: 1

      typedef? what are we now? sissy programmers who don't know what a pre-processor is? :D

      Should be sth more like that (though then it'll end up being FORTRAN77:

      #define INTEGER int
      #define REAL double
      ...
      #define FUNCTION double
      #define FORTRAN void
      #define code main

      etc. :)

    5. Re:FORTRAN by maxwell+demon · · Score: 1

      But with your defines, if you write "FORTRAN code", you'll end up with "void main", which is illegal in C (although many compilers accept it anyway). In C, main always has to return int.
      Also, even ignoring that, with your defines you won't be able to just write "FORTRAN code" (even with a semicolon after it), because that would result in invalid code. And the other defines are completely irrelevant to that.

      But then, my goal was to show that you don't need a single #define to write FORTRAN code. Now, if you additionally want to omit the semicolon, you'll need one #define, but that's already enough.

      OK, strictly speaking, you don't need any #define at all, thanks to the -D option of the compiler :-)

      --
      The Tao of math: The numbers you can count are not the real numbers.
  78. All, but procedural first by GrouchoMarx · · Score: 2, Interesting

    As others have said, expose students to all three methodologies (procedural, OOP, and functional) as early as possible. A language that supports all of the above can be good for that, or else pick languages with reasonably similar syntaxes (eg, they all use curly braces for code blocks) to reduce the mental overhead.

    That said, I would do procedural first. It's the closest to what the computer actually does: Execute one instruction after another in order. It is also, therefore, the one with the least mental overhead. It's easier to explain a conditional or a loop in a procedural structure than a functional structure, I'd argue. (And in that case OOP is a superset of procedural, as the code within methods is still behaving procedurally.) So the 101 course should be in a procedural language, or using procedural style in a procedural/OO language.

    I did OO next, but in hindsight I'd probably suggest functional second. It's the most "mathematically pure", and the one that forces you to think about what you're doing at a conceptual level the most. It's also the one they're least likely to use in practice out in industry, but what students learn about good design in a functional language (atomic functions, no side effects, logical thinking, etc.) will serve them in very good stead later on in their careers. I only had about a quarter of one class in which we covered functional languages and I just didn't get it at the time. Years later I finally figured out what functional programming was all about and even though I don't write functional code I've found my coding style drifting to be more functional-ish, and as a result much less bug-prone and, for me at least, easier to read.

    Then put it together with good OOP. You then have the procedural stuff down pat, and the good practice of how to treat functions as discrete behaviors. An object, then, is just a larger chunk of discrete behavior bundled together. It introduces the complications of state, but the idea of each method as an atomic little bundle of behavior within that larger bundle should be a smooth transition from functions as an atomic little bundle of behavior.

    All three are equally expressive, but knowing all three will give students a better understanding of *how to think about the problem at hand*, which is what school is all about. Even if you're not coding in one of those paradigms, you can still implement many of the same concepts in another paradigm where appropriate. (No-side-effects from functional, polymorphism and delegation from OO, and "how does the computer think" from procedural are all applicable in all paradigms, if you're coding properly.)

    --

    --GrouchoMarx
    Card-carrying member of the EFF, FSF, and ACLU. Are you?

  79. Assembly language by Anonymous Coward · · Score: 0

    After assembly language everything is piece of cake.

    Why not use Donald's Knuth MMIX language?

  80. C, definitely by jandersen · · Score: 1

    Teaching Java to beginners is bold - but not a good idea, in my opinion. It is the old argument about learning to walk before you start running.

    The merit of C is not just that it is a very simple language to learn, if not to master; the real merit is that C is almost as close to assembler as you can get without it being assembler. This is a good thing, because in order to handle computers well, you have to understand how they work at the lowest level, and that includes machine language. It may well be that a mediocre C programmer is not as productive as as mediocre Java programmer, but we are talking about beginners here - they are about to learn the basics, in principle from scratch.

    Object oriented languages start at the other end - the finished SW product, the user interface and just about as far from the actual computer as you can get without ditching it altogether. Of course if your aim is only to produce programmers that can make software without knowing what lies beneath, Java is not a bad choice even for a beginner; however, if that is all you can do, you will end up writing a lot of fluffy interfaces and possibly even some very good ones, but what are they going to look like inside?

    As far as I can see, it is a lot better to start from the bottom as they do in most other areas - on the other hand, it is necessary that students can see results of what they are doing in a fairly tangible way; which is why you should start with C - it is still the best compromise between low-level understanding and high-level productivity.

  81. Mod parent WAY up! by FranTaylor · · Score: 1

    After SICP, every computer language becomes very easy to learn, and you see how they are mostly all the same underneath.

  82. My choice is... by Anonymous Coward · · Score: 0

    If I am going to teach a first year programming in a local college, I will use Smalltalk(Squeak).

  83. Dumbest ask slashdot answer ever.. by FranTaylor · · Score: 1

    Learning C++ as an introductory language is like learning to ride a bicycle by climbing l'Alpe d'Huez.

    1. Re:Dumbest ask slashdot answer ever.. by dronkert · · Score: 2, Interesting

      How about: it's like learning to ride a bike by descending Alpe d'Huez. Talk about a crash course!

    2. Re:Dumbest ask slashdot answer ever.. by FranTaylor · · Score: 1

      Ha ha. I do like that better.

  84. how about functional or logical? by A12m0v · · Score: 1

    languages like Haskell, Scheme, Lisp or Prolog?

    easier to learn, if you ask me.

    --
    GENERATION 25: The first time you see this, copy it into your sig on any forum and add 1 to the generation.
  85. Amen, brother by istartedi · · Score: 3, Insightful

    Although, maybe, just maybe you should start them with BASIC. In other words, mirror the history of exposure that my generation got--slow BASIC, assembly to make it faster, high level procedural languages like Pascal, object oriented dreams, object oriented nightmares, and then that wierd thing called functional.

    Yes, I know functional came before 8-bit micros; but for a lot of us the history I've outlined above is how it all progressed. I know I'll get flamed for this, but for many years you could come out of school without knowing anything about functional programming and do just fine. It seems like that's changed in the past few years; but we'll have to see if it really sticks. The recession might help it, since the complaint about not being able to find employees comfortable with functional programming will be mitigated by all the tech layoffs...

    The bottom line though, is that underneath all that stuff you have a machine. Assembly gets you as close to that machine as possible. Everything else is just a cute wrapper for the machine. Too many CS grads have no feel for that "foundation". What if architects learned nothing about foundations?

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    1. Re:Amen, brother by po134 · · Score: 1

      "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." Edsger Dijkstra

      and I have to agree with him ...

    2. Re:Amen, brother by istartedi · · Score: 1

      I said start with BASIC, not dwell on it. If a potential programmer becomes so ingrained with the shortcoming of *any* language, it's a fault in the programmer not the language. The quote is from 1975, wherein he also suggested that Projects promoting programming in "natural language" are intrinsically doomed to fail. . I think Larry Wall would disagree, and whether you like Perl or not... you're soaking in it here on Slashdot.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  86. Re: "Both" by mrchaotica · · Score: 0

    You know, I just realized: The fact that you answered "both" (referring to imperative and OO) when asked what programming paradigm to start with perfectly illustrates why you're wrong!

    All CS students are going to learn imperative and OO anyway. But if they don't learn functional programming first, then they have no clue what a huge chunk of computer science they're missing!

    --

    "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  87. NO, NO, NO!!! by FranTaylor · · Score: 1

    You want to spend your introductory computing experience learning about data structures, algorithms, objects, etc.

    You do not want to waste time learning about the difference between pointers and arrays.

    You do not want to know why the computer cannot tell that you have indexed past the end of an array.

    You do not want to learn about memory allocation and why the computer cannot do it for you.

    These things can come later when you are comfortable with the concept of telling a computer what to do.

    1. Re:NO, NO, NO!!! by jandersen · · Score: 1

      How do you know what I want?

      As far I know - and I think I am in a better position to know - those are the very things I would like to learn about first. I started with things like Pascal, BASIC, FORTRAN, COBOL, and later C++, and looking back I can see that it would have helped me a good deal to know those things intimately.

      If your only ambition is to let young people "get comfortable with the idea of telling computers what to do", let them learn a simple, but complete scripting language initially and then let them move on to C. It is silly to talk about "wasting time on learning the difference between pointers and arrays", when that difference is entirely artificial, created by your intended use of the pointer.

      If we always try to "protect" young people from the reality of what they are working with, we make the task of educating them unnecessarily cumbersome. Look at it another way - a person who has learned that the HW and OS don't protect them from silly mistakes, may well appreciate the facilities of eg. C++ or Java, because they know the dangers; but somebody who has started in a nanny-environment, where all that is taken care of for them, will have a hard time understanding why it doesn't always work that way. What kind of system programmers does that produce?

  88. Not low level enough? by mveloso · · Score: 1

    I always thought that CS was more about theory, which means that a low level language should be the first. How low depends on the faculty, I suppose.

    If you really want to understand what's happening, assembly and the various ABIs are really the only way to go. What are the downsides of various ways to implement C++? What are the tradeoffs between different CPU architectures? Why use a register vs a stack-based model? What kinds of problems are better modeled in certain languages than others?

    Most of these questions can't be answered by learning Java. Heck, I doubt anyone these days even reads java bytecodes and notices how crappy the optimization is (hello, has anyone even heard of CSE?). Have you thought about how OO causes code bloat because you can't strip dead code?

    If you care about the language, then you should be looking at why certain things are in the language. It doesn't really matter what the language is. Why doesn't Java do MI? What are the issues with MI vs mixins?

    98% of computer work today is basically gluing libraries together. It's probably more like 99.999%, but I'm being kind. Most coding is bugfixing, or working around decisions made years ago by someone without enough time. That's not CS, that's plumbing.

    First language to learn? It should be z80, 6502, or 68k. They're nice, expressive, and relatively simple. x86 should be next because it's so common, then RISC, either SPARC or PPC. Maybe a VLIW would be nice. Not sure the custom chips (cray, thinking machines) matter so much - include them if you have time. Then branch out into subsystems (the storage hierarchy), I/O, etc.

  89. Re: "Both" by nog_lorp · · Score: 1

    That is kind of contrary to the point it seems. A huge chunk of computer science indeed, but almost useless in industry (perhaps the ideas are usefull, but how many jobs are there in functional languages?).

  90. kornfused by the question by catmistake · · Score: 1

    I think the question you should ask yourself is:

    "Do I want to be a computer scientist, or do I want to be a programmer?"

  91. Compiler by Anonymous Coward · · Score: 0

    Teach them compiler!

    Dumbass.

    1. Re:Compiler by Anonymous Coward · · Score: 0

      Compiler is not a language, assembler is.

  92. Not at all by FranTaylor · · Score: 1

    Functional programming is where you tell the computer what you want, and you leave it up to the computer to figure out how to do it.

    SQL is the best known example of functional programming.

    1. Re:Not at all by XDirtypunkX · · Score: 2, Insightful

      That's "declarative" programming. Popular functional languages tend to be more declarative, but it doesn't have to be that way.

  93. Pascal, baby! by Tablizer · · Score: 1

    I agree, Pascal was an almost ideal teaching language. When one starts out, OOP and functional are usually too much to take on so early. Pascal is a well-structured procedural language that doesn't have the most of the pointer and "ram-memory" hang-ups that C does. Pascal is a very "clean" language (perhaps too clean for production code).

    In my opinion, there's not much that beats it for introductions still. The only drawback is that it's not really used in practice. If one starts out with C, at least they are learning a common production "resume" language, despite fussin' with all the pointer/RAM weirdness newbies will encounter with C.

    I don't know why they generally stopped using Pascal for teaching. Even back in it's heyday it wasn't a very common production language, so that can't be the reason.

    It also has some nice ideas that I wish newer languages would adopt, such as type and scope indicators being on the right side instead of the left; and nested functions (with nested scope). But it's one-pass compiling was a bit annoying because you had to order your function definitions just right. But that seems fixable without busting backward compatibility.
           

  94. Functional (not procedural) by melatonin · · Score: 1

    For me, learning functional programming in comp sci was the most eye opening. This was part of my programming languages course. We did functional programming in Lisp, but we had to use it purely -- we couldn't declare variables. That, combined with what my OS prof said once, something like "there is no useful program that doesn't take input and produce output," gave me proper insight to what a clean, purposeful software solution is.

    With functional programming, where you have no variables, everything you produce is a function of your input. Constants and the source code itself consist of the input. And of course your only goal is to produce output.

    You can make designs that achieve a lot of functionality with a small amount of code by following that idea. Lisp itself is proof of that.

    You can also create emacs. I'll stop here.

    --
    Moderators should have to take a reading comprehension test.
  95. Everything by SuperKendall · · Score: 1

    Scheme and so on are swell and functional programming is cool... ...but name one significant real world application made in such a language.

    Try all of them - because the concepts I learned and mastered in Scheme were invaluable in every programming language I used after (and there were many).

    Linked lists? Maps? The very concept of mapping over a set? The ideas that may not fit more naturally in other languages, fit very naturally into some problem domains and it's invaluable to know they exist even if sometimes the language you are in does not make them the easiest thing to do at times. There will be many things that come naturally to a language, that a language will be very good at - but if you can take a step outside whatever box you are playing in, then my friend you really have something.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  96. Take a cue from the French - teach in ML! by Koppology · · Score: 1

    I think we all could take a cue from the French, and start some of our programming classes in one of the ML families, like Caml Light, Standard ML, or my personal favorite Ocaml. These are fairly advanced languages, and support both imperative and functional features, so you can teach for loops AND recursion. Of course, you can do this with Lisp too, but honestly, the syntax of the ML families is a lot better than Lisp. Also you can do object-oriented programming with Ocaml.

    In addition, Yale also taught its intro CS class in Standard ML a while back, and I understand it was a big hit.

    Of course, it's the course content that matters the most, but why limit yourself? As already stated on Slashdot, FP is increasing in importance due to its ability to handle parallelism, so I think you can really have the best of both worlds with these impure functional languages.

  97. Start with assembly, move up from there by Anonymous Coward · · Score: 0

    I think the best way to start is with the absolute basics --- assembly language with a few simple instructions such as ADD, MUL, DIV, TEST, JMP, LOAD, STORE, and then add the notion of a stack and subroutines with SUBR and RET. Introduce Boolean logic with instructions such as AND, OR, XOR, NOT, and binary operations such as SHL and SHR. Then, once you fully understand the low-level mechanisms, you move to a higher level language, e.g. C, which still has intimate connections to assembly. Show how the higher level language translates simply to assembly. Introduce the ideas of a heap, processes, virtual memory, inter-process communication, threads, synchronization, files and I/O, etc. Then describe functional programming and object-oriented programming (e.g. LISP and C++). By this time the students are sipping from a fire hose, but once they understand the machine and the basic mechanisms that underpin all the higher level abstractions, then understanding all those higher level abstractions becomes much easier.

  98. SQL, Just because... by FranTaylor · · Score: 1

    Every other language has been suggested, I suggest learning SQL.

    SQL is functional programming. You tell the computer what you want. You don't know or care how it does it.

    SQL is clearly not a general purpose programming language. That's not the point.

    When you are learning, you need to take small bites of knowledge and chew them well. SQL will teach you to have patience with the computer.

    SQL will teach you how to organize your data. This is a lot more important than you might realize. Getting the data structures right can turn hard problems into easy ones.

    Don't bother with that JOIN stuff until you are comfortable.

    Then move on to another language. Keep coming back to SQL as you learn the other language.

    This will get you a good theoretical foundation and you will also have a great marketable skill.

    1. Re:SQL, Just because... by Tablizer · · Score: 1

      SQL will teach you how to organize your data.

      Please clarify. Do you mean database design? SQL the language encourages *poor* organization in my opinion. You have to create one big giant run-on sentence, often with duplication, when you get beyond the non-trivial[1]. I've even created a draft alternative to SQL, called SMEQL, that makes it easier to break queries into mentally digestible chunks and also for easier linguistical duplication factoring. (Being functional, the computer does not have to processes it in such chunks under the hood if it finds a more efficient way.)

      [1] Perhaps this is not an issue in an intro course.
           

    2. Re:SQL, Just because... by FranTaylor · · Score: 1

      SQL is terrible for expressing algorithms. Absolutely. Again, that is NOT the point.

      You can think of a table as a CLASS. The columns are MEMBERS. The rows are INSTANCES.

      When you get to the point where you are "creating one big giant run-on sentence", that is your clue that you should put down the SQL book and pick up your other programming book.

      But you should still keep picking up that SQL book and referring to it as you learn that "real" language.

    3. Re:SQL, Just because... by Tablizer · · Score: 1

      When you get to the point where you are "creating one big giant run-on sentence", that is your clue that you should put down the SQL book and pick up your other programming book.

      But strangely I've seen a fair number of shops that try to do most of the processing via gimungous single queries. It may be a case of "if all you know is a hammer...". I got chewed out by them for suggesting they mix up their techniques a bit. "That's for wimps", they'd say. "Real men write giant SQL."
             

    4. Re:SQL, Just because... by FranTaylor · · Score: 1

      The one advantage of "giant SQL" is that a smart database will crawl all over that huge query and optimize the hell out of it.

      But of course we are way past the bounds of introductory programming at this point.

    5. Re:SQL, Just because... by Tablizer · · Score: 1

      Show mathematically how its NOT possible to do the same with SMEQL. As described nearby, it may actually be *easier* with SMEQL because it has a simpler linguistical foundation to its structure. It may make a better teaching language than SQL for that reason at least.

      By the way, Here's a quick intro to SMEQL:

      http://www.rosettacode.org/wiki/SMEQL
         

  99. Python by netux · · Score: 1

    Python has all three paradigms built in, for the order; functional programming should be taught first because it's so foreign to how we think naturally, any extra stuff in your brain beforehand will make it harder to learn. OO next, because it's the method of choice for most companies. Procedural next because it will be applicable to their next few courses (Data structures, assembley) Make sure you teach the Computer SCIENCE part during it all, not just "Here's list comprehensions and lambda functions and this is how you use them" They need to know wht they are for, how to get them to do something useful, and when it's really the worst tool for the job (It's really good to identify the best tool, but it's imperative to recognize when your using the worst) If the schools had more time for teching the programming part and didn't have requirements that suck up all of the CS time with exteranious bull, I'd say do LISP, Earlang, Prolog, C/C++, Java, Python,in that order.Get datastructures after they can program (second year) and assmebler. Work on the stuff that is uncomfortable first, otherwise they will want to stay with what they learned first. I taught myself Python first, and I love the language (I did BASIC back in the 80's). But I Taught mysef C next because I couldn't grock the functional languages, I can get them to do stuff, but I'll never reach for them first for anything because they aren't taught and they aren't something you can just apply to any problem at hand. Java and C# are painful for me, and I need a refrence next to me to do anything useful (Hell, I keep my Bjarn book handy so I can get strings to do what I want), but the libraries are huge, and not the first thing you want the students to work with. Datastructures should be taught concurrently with the OO languages, because the basic job of programming should be understood beforehand. They compliment nicely and you need both before you start on the design patterns stuff. That is just the oppinion of a humble self-taught 34 year old student at a fairly prestigious UofM (I'll leave the M as a guess) that is rather dissapointed with the curriculum at that school. More theory and branching out past what the job market is looking for is necassary for a well rounded education in CS. Networking is important, but not moreso than learning how to solve a problem in different ways and being able to come at a problem from a different angle when you get stuck.

  100. No no no by Evil+Pete · · Score: 1

    Before anyone posts comments about "functional programming" I hope they read a bit about what it actually is. Compared to C and C++ functional programming is like programming on LSD the first time you try it ... it works by magic. Essential to know this stuff, in fact I haven't touched it in a decade ... about time I picked some of it back up again, eg Erlang.

    What most people here seem to be calling "functional programming" is actually imperative.

    --
    Bitter and proud of it.
  101. Maybe I'm being too obscure.... by Joce640k · · Score: 2, Insightful
    --
    No sig today...
  102. teach them how to think by bugi · · Score: 1

    Teach thinking. Not a language, and not a paradigm.

    SICP lays good foundations. An intro course is basically a survey course -- intro to concepts with some basic practice thrown in to help cement the concepts with repetition. Remember, you're laying the foundations for Computer Science, not for programmer-tradesman.

    Unless you're teaching CS at a trade school of course, in which case go through some basic concepts with pencil and chalk, then use something like python and work your way from simple logic controls (if-then), to functions, to objects. The second course can teach Cobol -- I mean Java, or whatever it's called these days.

    Or the community college version: html to get the toes wet, followed by css and perhaps javascript for the "gifted" students.

  103. Ok by Greyfox · · Score: 1
    First off take anyone who uses "paradigm" conversationally out back and shoot them.

    I'm still of a mind that the first computer programming class should be with pencil and paper with a grid to sketch out what's happening in memory. Most of the programmers I meet (or interview) don't really have a solid idea of what's going on in memory, and the art suffers because of that. And don't even get me started on the number of C projects out there that don't use data structures simply because the language doesn't provide them.

    Don't let the student touch a computer until they're actively thinking about how the data they're working with is organized and how they want it to be organized. That would be a good start.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  104. "Paradigm" by koinu · · Score: 1

    You know that paradigms are independent on the programming laguage, you choose? It is perfectly possible to write object-oriented programs in C. It's the way you think during the programming process. A language can support a certain paradigm very well, but that's all it can do.

    I would still recommend C, because it's the most universal language. It has a trade-off between minimal and useful syntax.

    In the end it depends on the focus. If you are teaching some funky mathematicians, you better use something functional. When your students are interested in business jobs where you often have to orchestrate smaller process components, teach them BPEL or other process languages.

    Object-oriented programming is important, but it's difficult to teach and difficult to understand for someone who hasn't seen how to operate a computer before. The students often don't understand why you have rich syntax to define classes, objects and their relations and you have to spend a lot of time to teach them "the why" and not "the what".

  105. (addendum) by Tablizer · · Score: 1

    I forgot to point out that it *would* be possible to write more complex queries instead of mixing with an app language *if* they had a better query language. SQL does not scale in complexity very well unless you make lots of views. If you need one-off views, this is not practical. This is an area that SMEQL shines: it makes it easy to create temporary virtual views for the scope of the query only.
     

    1. Re:(addendum) by FranTaylor · · Score: 1

      Isn't that why they put subqueries in SQL? Efficiency suffers because it's hard to for the optimizer to dive into the subquery, but between subqueries and aggresive indentation, you can make even big SQL queries pretty readable by humans.

    2. Re:(addendum) by FranTaylor · · Score: 1

      SQL scales in complexity REALLY well if you know how the optimizer works and you can structure your tables and your queries to take advantage of the optimizer's tricks.

    3. Re:(addendum) by FranTaylor · · Score: 1

      You are wrong about views. Views are really bad for performance because many databases don't know how to optimize around them and will explicitly evaluate the view before applying it to the rest of the query.

    4. Re:(addendum) by Tablizer · · Score: 1

      I disagree with SQL only offering nested sub-queries. It tends to push the top bread far away from the bottom bread of the sandwich, making it harder to grok each statement as a unit. Dagwood sandwiches may be whimsical, but would suck to maintain.

      SMEQL allows one to (optionally) give a name to the embedded SELECT statement(s) (or its equivalent) so that you can work on it separately. And there are some cases where SQL forces you to repeat the same nested subquery because it only offers nesting. Naming allows one to define such once and only once but reference it twice.

      I agree that some of it may be a personal preference, but Dagwood-sandwich-style SQL sucks by my standards. I'd prefer named references as an option.

      Further, SMEQL is easier to extend (custom table operations) because it's based on a simple syntax. The SQL syntax tree is an ugly monster that could only make a COBOL mother happy.

    5. Re:(addendum) by Tablizer · · Score: 1

      SQL scales in complexity REALLY well if you know how the optimizer works and you can structure your tables and your queries to take advantage of the optimizer's tricks.

      In a big shop, one often doesn't have the luxury of controlling the table structure. Either someone else is in charge of that or those who designed the tables are long-gone. Also, you are talking about efficiency instead of having "nice" query code it seems. Coding to the optimizer is a vendor-specific thing. Ideally, the optimizer should figure out the best internal route anyhow. (If not, we might as well go back to imperative coding instead of declarative.) But, optimizers are not quite that smart yet.
           

    6. Re:(addendum) by Tablizer · · Score: 1

      You are wrong about views. Views are really bad for performance because many databases don't know how to optimize around them and will explicitly evaluate the view before applying it to the rest of the query.

      That is because the vendor failed to implement view-friendly optimization. We shouldn't design a query language around past lazy vendor habits if we want to replace SQL. A named reference and a nested query are essentially logically equivalent. Whether the optimizer cares to see it that way is another thing.

      Further, maybe if the optimizer was working with a structurally simpler language, like SMEQL, it would be easier to write the internal "math" of optimizer, similar to how its easier to write automated code analysis tools for Lisp than for COBOL. Think about it.
               

  106. Definitely not OOP by shutdown+-p+now · · Score: 1

    OOP is a good set of practices that, when applied correctly, can be used to increase code reuse and readability. However, this is not at all what matters at the initial stages of learning how to program. Before one learns how to write "good" (or rather, "maintainable") code, one has to learn how to write code in general. Most (all?) OOP-centric languages introduce too much extra scaffolding, which may be beneficial for real-world programs, but is simply noise for "hello world" stuff - and most things that are written when first learning to program are "hello world" stuff.

    FP is more interesting, and I'd say that it can be a good candidate for the first paradigm, but only if it is paired with a Math course of the appropriate level. In other words, it would work if you can just say, "remember how you've learned what recursion is in a Math class last week? well, let's see how we can use it here". Similarly, things like tuple types and declarative algebraic notation (Haskell-style) have straightforward counterparts that can be used to aid understanding. In this case it has obvious advantage of immediately reusing knowledge that is already obtained elsewhere.

    However, on its own, I do not think that FP is a good first paradigm to learn, especially if one learns early (e.g. in school). It abstracts away too much, and, without the necessary math background, can be very non-obvious and hard to explain. In this case, I'd say go for the good old procedural style, preferrably with some clean and readable language: Pascal is an old favorite (though you'd want to pick a dialect with pointers, such as Borland's, to deal with linked lists and such) and Python is a pretty good modern alternative (but not C, definitely not C!). Surprisingly, OCaml is also pretty good if you stick to the imperative subset of it - it has all the usual stuff such as "for" and "while" loops, single-branch conditionals, and so on, and can really be used in largely the same manner as Pascal; and pervasive type inference helps to explain the basic concepts first before even bothering with types.

    1. Re:Definitely not OOP by Tablizer · · Score: 1

      OOP is a good set of practices that, when applied correctly, can be used to increase code reuse and readability.

      I've never seen good evidence of this, except maybe in specific circumstances. Every paradigm/technique shines in specific circumstances. But to say that OOP used *everywhere* makes everything better is unproven. Further, "readability" can be highly subjective. Reading happens in the mind, not in the computer nor on paper.

    2. Re:Definitely not OOP by shutdown+-p+now · · Score: 1

      Says the guy with the nick "Tablizer". I've seen http://oop.ismad.com/ so I don't think I want to get into this argument with you :)

      That said, I'm not exlusively an OO dev - I actually started my programming career with FoxPro, and I know the FP ropes as well. Of course, OOP is by no means a universal tool, but I still find it an immensely useful one, from personal experience.

    3. Re:Definitely not OOP by Tablizer · · Score: 1

      I'd like to explore what you think is so so useful about it. Nobody seems able to describe it other than it "feels nice" to them. I've seen a few situations where OOP may help a little bit, but its hardly a panacea. I suspect it's a matter of personal psychology: different people just mentally fit different paradigms better. That's fine, but be careful not to extrapolate outside of your own mind.

      (PS. ismad.com doesn't work anymore because its gone fee-based. Google "OOP Criticism" to find the site now. Thanks.)
         

    4. Re:Definitely not OOP by shutdown+-p+now · · Score: 1

      Personally, I find that the main benefit of OOP is that it allows for very fine-grained granularity. This typically requires thinking ahead when you define your classes, and some languages make it harder by their badly chosen protection specifiers (such as Java, where "protected" is visible to the rest of the package - this isn't any improvement on e.g. Modula-2!). However, when done right, it allows to lock down the hierarchy and specific classes tightly, which in turn avoids "reuse misuse" - it's harder for others to use the code in ways it wasn't intended to be used when written (and run into their code breaking when you change yours). In other words, it makes it easier to enforce decoupling.

      In addition, OOP is specifically nicely suited for domains where clearly separated entities each with their own state and message-passing are inherently present, and extensibility over time is desired (which isn't surprising, as these domains are exactly what the paradigm was designed for, starting with Simula). Prime examples are games (this is fairly obvious, and something like UnrealScript can actually make a surprisingly good starting OOP language precisely for that reason), but also event-driven UI.

      Also, to clarify what I mean by OOP here. There are some things that are specifically not inherent to OOP, but specific to some of its implementations (and widely confused to be "what OOP is about"): classes and implementation inheritance. The only things that actually set OOP apart are: inherent referential object identity, and OO-style polymorphism (aka late binding). Encapsulation is typically highly desirable, but it's obviously not an OO-specific feature. Classes are merely one (and arguably not the best, even if popular) form of implementing the above. Implementation inheritance is an OO-specific form of code reuse that is considered to be a hack by many practitioners (for alternatives, see Sather and the likes of it).

    5. Re:Definitely not OOP by Tablizer · · Score: 1

      You seem to be "selling" OO's security-like features, not its ability to make software easier to create or manage. I agree there are niches where that is important, but will not comment on whether OO is the best at that without looking at a specific scenario. "OO better controls rogue programmers" is not a claim I encounter enough to have much to say on it at this point. But I would enjoy seeing a specific scenario and code sketch where other paradigms cannot compete no matter what.

  107. Ada by krischik · · Score: 1

    Ada has five paradigms build in: concurrent (rendezvous and monitor-like based), distributed, generic, imperative, object-oriented (class-based).

    The fact that you say "all three paradigms built in" shows that you have not yet arrived.

    1. Re:Ada by FranTaylor · · Score: 1

      My professor told us why Ada sucks.

      Ada is a superset of other programming languages.

      Older programmers familiar with other languages can keep writing code just the way they have been, but now they can do it in Ada.

      Ada makes for unmaintainable code because it allows everyone to write in their own style, it doesn't enforce anything.

      Working with someone else's Ada code is like picking up someone else's used Kleenex.

    2. Re:Ada by Anonymous Coward · · Score: 0

      I think you may be confusing Ada with C or something.

      Ada was designed to be readable by non-programers and to actually scale to some meaningful size.

      As Ada was for goverment applications (both military and civil) it is super strict. So many bugs can be caught at compile-time. Which could be considered useful. Plus bugs which can't be statically descovered are checked at run-time*. Alogrithmic errors are your own problem.

      Saying Ada is a superset of other languages validates nothing about why

      Ada Sucks

      . Most languages borrow ideas.

      My opinion of first languages are:
      -Scheme for first impact to help with lambda calculus and general understanding.

      -ASM (RISC, orthoganol and attached to simple standardised hardware) for the von Neumann side of life.

      -Ada for von Neumann plus activies.

      -Forth for mid-level programming (when Ada is too good).

      I would avoid C languages eg Java or Perl, and next gen languages like python. Because of syntax and they are popular/cool (which makes programmers mono-lingual and inflexible).

      Anyway, principles are what needs to be lernt; not syntax.

      Banjo (currently playing with J/APL)

      *Some say this is a drain on the computer. But then look at Java, .net and p-code VMs. If needs must then they can be turned off (see Ariane 501).

  108. Algorithms by Anonymous Coward · · Score: 0

    The language paradigm is not important. The whole point of programming is to get the computer to do something. The algorithms are what is important. Teach how algorithms work, then teach how to implement them. Problem solving is what it boils down to, whether you are trying to make a quick and dirty script or Skynet.

  109. They are just tools by Anonymous Coward · · Score: 0

    Treat every programming paradigm as a tool; these tools are there to solve a particular type / types of problem. There is no one size that fits all. There will be a lot of people out there to tell you which is the right way forward - but I think you should decide. Just keep programming and learning new languages. Use what you learnt to solve problems. The joy of programming is in programming.

    Every language is a product of the philosophy of its author or authors. It will certianly help to understand the rationale behind why the particular author choose to create a new language and its features. In many cases the restrictions that one (author) faces / faced whilst developing / designing the programming language doesn't hold good after a while - because computers are getting faster or there has been a new algorithm developed that helps solve the problem better / faster. So what was true once is not true anymore.

    Please don't fall into the trap of fanatically following any particular language. I did that and I paid a huge price. The more methodology and languages you learn, the more you will appreciate and understand how to solve similar problems in multiple ways. Who knows after a while you may go on to create a perfect programming language which we might end up learning about. All the best!!

    This doesn't answer your question? Does it??

    The short answer to your question is, theer isn't any correct answer. You can start with any paradigm that you are comfortable with; remember what is more important is to solve problems!! Imperative programming is not a bad place to start but its a personal choice.

  110. Funtional with OOP (Perl/Ruby) by sluuuurp · · Score: 1

    hhmmm...functional with oop definitely like in Perl/Ruby. In addition, student should read this article in their first programming course. http://www.catb.org/~esr/faqs/hacker-howto.html

  111. TI-59 by Potor · · Score: 1

    My first programming course was taught on a TI-59.

    Pure algorithms, really. Learned a lot.

    Never ended up going into comp-sci, though.

  112. Imperative by int69h · · Score: 1

    I say imperative in anything but C. Pascal is a good choice. C just gives people already struggling to wrap their brains around new concepts to much rope to hang themselves with.

  113. Only C is not simple by krischik · · Score: 3, Insightful

    C is not a simple language.

    The C language specification is 500+ pages and a horrible read. C only appears simple on the surface but is full of nasty hidden surprises. The later being the reason why the language standard is such a horrible read.

    I also disagree with you on the base of the for loop. The C for loop is just a while written on one line. Syntactic sugar without additional abstraction. And even as syntactic sugar a failure because you don't save any keystrokes. Compare:

    for (int i = 1; i < 10; i++)
      {
      // do something
      }

    with:

    int i = 1;
    while (i < 10)
      {
      // do something
      i++;
      }

    2 characters and 2 Enter keys less - what a saving!

    compare that to the following Ada code:

    for I in 1 .. 10 loop
      -- do something
    end loop;

    Ok, it does not save keystrokes either - but it does add some higher abstraction and I is constant inside to loop - so no hidden surprises here, like in:

    for (int i = 1; i < 10; i++)
      {
      // 20 lines of something

      if (i = 5) i = 6;

      // 20 lines of some more
      }

    Which brings us back to "C is not simple but full of hidden surprises".

    Martin

    1. Re:Only C is not simple by evanbd · · Score: 2, Informative

      C should, in many ways, be thought of as a somewhat easier to read and portable assembly language. It doesn't hide much of anything from you, for better or for worse. Given the number of students who seem to manage to get rather far in their computing career without actually understanding what a pointer is, teaching a very low-level language first or very early has its merits.

      That said, my personal choice would be either a functional programming language or a carefully chosen assembly language -- probably MIPS on an embedded processor. I'd prefer C to things like C++ or Java, though.

    2. Re:Only C is not simple by PitaBred · · Score: 1

      Stupid programmer tricks exist in every language. Sometimes the flexibility of C is very nice to have, and there aren't many replacement languages that have the same power. A hand saw is not a complete replacement for a circular saw without a guard. One is much more dangerous, for sure, but that doesn't mean it can't do a better job if you know what you're doing with it.

      None of this is trying to say C is a great introductory language. I'd rather people start with some simple scripting language like bash, perl, python, something along those lines. Get results, not have to worry about compiling, etc.

    3. Re:Only C is not simple by sleeping+wolf · · Score: 1

      Indeed, C is a much more complex language than people realize. I work at a company doing a lot of embedded software in C on platforms where it's rough to fit a reasonable C++ implementation, let alone Python or similar. During interviews, I see a lot of people who believe they are experts who get flummoxed by "what is the different between const int * foo and int * const foo?"

      Another question that springs to mind, but is (comparatively) a less practical factoid: "What does the comma operator do?"

      At the same time, the error in your examples that you highlight will be caught by most modern C compilers in some form, though you might have to tell it to give you all warnings.

    4. Re:Only C is not simple by Anonymous Coward · · Score: 0

      Your example using for loop is not good. In C, when you write this kind of for loop, you are expected to be a wizard and know how to keep the loop in few lines and the iterator invariant. Final result is readable code which is more important.

      I agree with your key point. C is not simple.

      Sadly, C is taught (or learnt) like this.

      This is the stove, you light it like this. There you go cooking!!!. Too bad the art (craft?) of cookery is not of much important.

    5. Re:Only C is not simple by Anonymous Coward · · Score: 0

      C-style for() encodes a higher-level concept of looping setup, test and advancement that's far more flexible than simply "in 1..10". The whole point is that it can (and is) used when there is far more complicated code involved in any of those steps, but groups them together to document their relevance to the program flow.

      Yes it can be an incomplete picture if the loop-control variable is changed inside the loop, but that also applies to many languages with "in 1..10". In C, a simple understanding of the "setup/test ? loop/advance/test ? loop/advance/test..." cycle makes it very clear how C handles it.

      Sometimes flexibility to modify the control variable is the only practical measure. For the same reason, the "imperfections" of break/next/continue/last or whatever your language calls them are almost universally available in 3rd generation languages.

      Simpler looping notations are great when you have no need for the loop control variable - C++0x is introducing them - but if provided at the expense of a more generic, flexible for ( ; ; ) facility they force clumsy additional variables and increments around the loop that are harder to understand and maintain.

  114. = == := error by krischik · · Score: 1

    Damm - made an = == := error - again! But it highlight another C problem - Ada would not stand for a typo like that - but in C it compiles and fails at runtime...

  115. for me not Aspect oriented by 2fuf · · Score: 1

    This guy in our office once did a short expose about Aspect oriented programming. It involves implementing features that can be logically grouped as Aspects across classes. The way it was done was by generating additional Java code, so to program a new Aspect, you would work with a bunch of generated code includes before compiling your classes. It made me feel very confused and I never used it, but who knows it might actually be good for something, so, there you go. What I used to jump from procedural to object oriented, was Flash 4. There was the library of assets and you can instantiate them onto the stage, change properties and all instances would change too. That's what made me understand the basic concept. Not sure how many Flash developers will be in your first time programming class though. But that's what helped me understand OOP when I started.

  116. Teach WHAT programming is, not HOW to do it. by Alex+Belits · · Score: 1

    I find it disgusting and appaling how people see introductory classes as an appropriate place for mental masturbation and lengthy sermons. Students with no previous experience have no reference points, no idea what the teacher is talking about when he describes differences between things that he believes to be best and worst practices in programming -- they have to either share the teacher's belief or dismiss it as impractical bullshit, in both cases getting superficial knowledge and no feasible way to apply or verify it.

    Introductory class should first and foremost serve the purpose of providing the foundation for future study, introducing concepts, describing ideas and mechanisms that student will have to understand while studying the rest of courses related to CS, Engineering or IT. To do so, it must describe the subject of study -- purpose and application of software, basics of computer architecture, programming languages, formal logic, algorithms, data representation and data structures, languages, CS theory, various (!) approaches to software design, role of operating systems, interfaces and protocols. By the time the student has a firm grasp on those concepts and he is ready to think about applicability of procedural, object-oriented or functional programming, quality of C++, Java or Perl design, or look for a plausible excuse to use SQL, the semester is over.

    Taking this into account, C is nearly perfect for most of such introduction. The language itself has a very simple syntax, so student is not distracted by learning details of some psychopath's design and implementation decisions. There is no overwhelming ideology pushed through the language except maybe simplicity and modularity. Same language can be used to illustrate workings of hardware, data structures of increasing complexity, operating systems, various approaches to programming, etc. without creating false impression of those concepts being implemented by isolated pieces of software and set in stone by wise and powerful language designers. Knowledge of C helps with learning new languages and serves as a demonstration of simple and unambiguous syntax designed for easy parsing and understanding.

    Obviously the introductory course can't be a year of C and C alone -- students have to see how a different language design matches a purpose of the language -- however no other language is suitable as a proper introduction to the wide range of concepts that CS student has to understand. Least of all Java (the whole language design is a giant sermon on how some guy thinks, people should program), C++ (Frankenstein monster of programming languages), Perl (sure it's usable -- but it only makes sense if you are stoned), PHP (same but you have to be a stoned teenager) or BASIC (stoned toddler?). LISP/Scheme is good as an example of an approach that is drastically different from C, however I don't think, it works as this "foundation of all foundations" -- it's a thing in itself, so it doesn't help to get an idea how it is all tied together.

    --
    Contrary to the popular belief, there indeed is no God.
  117. You got it backwards by FranTaylor · · Score: 1

    With programming, the foundation is in your head, and the apex is in the computer. Learn how to express your programming desires first, then learn how they get translated into the stuff that hardware executes.

  118. Honestly, WTF? by Qbertino · · Score: 1

    I don't really understand your question, respectively the reason you're asking it. However, I can tell you this much: If you're just starting with programming, start with OOP, otherwise your barriers to enter OOP will be significantly higher. In your case it could be that you're spoiled already and will have a steeper climb towards OOP. In that respect C is just about the same distance away from OOP as Basic.

    That aside, I don't really see your problem other that you're problably to preoccupied with the academic approach to programming, which is, quite frankly, something like 20 years behind reality.

    Just go out, get an OReilly - I recommend the Python line of books (http://oreilly.com/catalog/9780596513986/#top), as it is a neat universal PL - start working through it and then find an FOSS project and join it or start your own, preferably some academic stuff you're doing just now and are interested in. Don't get to wound up about the OOP/imperative/functional 'war', as most of the ragging on one or other 'programming paradigm' - whatever the f*ck that is exactly anyway - is not much more that professional trolling to make oneself or the discussion sound more important. Find your PL, become good at it and get the job done. All else is just icing on the cake and you'll find out early enough when to add it.

    My 2 cents.

    --
    We suffer more in our imagination than in reality. - Seneca
  119. Another factor in the decision by Stochastism · · Score: 1

    I see different technical merits in teaching asm/c/java/python/functional languages first.

    There's another factor though, the reason my first formal course was a functional language: it levels the playing field between students that have grown up with C/Java/Python, and those that have never coded before. Even those with a lot of procedural programming experience can scratch their heads when presented with recursion, currying, closures, and other concepts that functional languages promote.

    1. Re:Another factor in the decision by Tony+Hoyle · · Score: 1

      They never tought functional languages at all in our course (if I'm getting your meaning of functional language correctly, anyway.. I can't even understand what the first sentence of the wikipedia page actually even *means* FFS). It doesn't look like a good starting language IMO - these are beginners not professors.

      We learned Pascal, Ada, Cobol and 68000 machine code. All apparently chosen because nobody would know them before and would probably never use them again (except maybe cobol, although that's getting rarer).

      This was a few years ago - before java existed.. although I don't think that's a good learning language anyway - too abstracted from what's really going on. C would be a good start although I think a good grounding in machine code is worth it for the knowledge of internals if gives you.

    2. Re:Another factor in the decision by barneco · · Score: 1

      Why should the playing field be levelled?

      The first programming course really just serves 2 purposes.

      1) Teach programming concepts...how to think like a programmer. If the course succeeds you'll come out of the course not with a command of a language ready to hit the job market and produce valuable work, but with an understanding of what a program is and in the right frame of mind to work into deeper technical concepts like data structures, programming paradigms, algorithms...etc. And,

      2) Weed out those people who just aren't meant to program.

      Those who have grown up programming are only taking the course for the credits(and perhaps can learn solid fundamentals if they've only "dabbled"). There is no happy medium that will challenge these people and provide maximum value for those who fall into category #1.

      My pick would be C++. Steep-but-quick initial curve to help with weed out, straightforward enough to provide clear examples of basic concepts, and with enough growing room to transition directly into advanced concepts and OO. The drawback is that it's not instantly practical for a lot of real-world programming productivity, but IMO sets a great foundation. With a solid base, you can pick up the higher-level stuff much easier.

    3. Re:Another factor in the decision by Anonymous Coward · · Score: 0

      You would be correct, _if_ the goal was to trouble beginning cs majors with underlying details. Those are computer engineering details, basically irrelevant to most programmers and actual scientists.

      CS is more math than electronics, so functional languages are the way to go.

      I would also be brutal about weeding the classes out, and start out with Lisp. I've seen too many VB codemonkeys with CS degrees, still in serious need of oatmeal with fingernail clippings.

  120. reliance on libraries? by Anonymous Coward · · Score: 0

    it's presented by good Java programmers who try to teach good practices and do not encourage excessive reliance on libraries

    Maybe you would like to see the source of what seems to be 99% of the content on TDWTF

    You're right though, I always find that I have way too much time to waste and money to burn in my job. This is why I also choose to ignore well designed, supported and tested libraries in favour of rolling my own.

  121. Too many similes by FranTaylor · · Score: 1

    It's just like a big recursive simile where everyone is trying to explain everything using similies that don't really match up with each other.

  122. How about Turing not too long after? by jonaskoelker · · Score: 1

    I think it would appeal to a lot of students to be shown the hammer and to try knocking some nails in before they're taught about velocity, kinetic energy and force times distance.

    They should be taught it, make to mistake about it, but not as the first thing (in my opinion). It'd be nice to have some evidence to back up either position, though.

    Teaching Turing machines first seems like you're teaching Latin first in the French class.

    Wait, were we talking about the teaching of computer science or the teaching of the craft and art of programming? ;)

  123. What a joke by FranTaylor · · Score: 1

    C has a horribly complex syntax. Go ahead and write a C parser in C, and that will illustrate the point nicely.

    C forces you to learn WAY too much about the guts of the computer before you can get anything done.

    You are EXACTLY wrong about Scheme. Scheme was designed from scratch to incorporate every principle of modern programming technique while stripping away everything that is unnecessary.

    1. Re:What a joke by Alex+Belits · · Score: 1

      C has a horribly complex syntax.

      Only if "complex" means "does not contain pre-made pieces for building simple programs".

      Go ahead and write a C parser in C, and that will illustrate the point nicely.

      Go write a parser for anything in anything. All parsers are complex.

      C forces you to learn WAY too much about the guts of the computer before you can get anything done.

      Yeah! By not teaching fundamentals you can reduce the total time for education by THE WHOLE TWO MONTHS! A worthy goal, indeed.

      You are EXACTLY wrong about Scheme. Scheme was designed from scratch to incorporate every principle of modern programming technique while stripping away everything that is unnecessary.

      When "unnecessary" includes the answer to the question, how a machine can operate on symbols.

      --
      Contrary to the popular belief, there indeed is no God.
  124. #define by krischik · · Score: 1

    Very strange opinions.

    Note that I remember a time where the following where sold as one of the advantages to of C - showing off the true limitless power of #define:

    #define IF if (
    #define THEN ) {
    #define ELSEIF } else if (
    #define ELSE } else {
    #define ENDIF }

    It does actually work.

    Trust me (I used both languages extensively) C make far more unmaintainable code as Ada.

    1. Re:#define by FranTaylor · · Score: 1

      "C make far more unmaintainable code as Ada." is like saying that getting punched in the face is better than getting punched in the gut.

      Why are you comparing two horrible languages?

      I stopped using monospace when I ditched my H19. Maybe you should, too.

  125. I started on Pascal by Sobrique · · Score: 1
    I started with Pascal.

    I still think that's a good start point. A procedural language, that's pretty strict about it's enforcement of basic rules.

    We're talking about first starting learning to program, so it's my opinion that going foraying off into the realms of OO and functional paradigms just muddies the water and makes it inaccessible to the true beginner.

    Pick up something that requires you to 'behave' whilst doing it - and for this reason, never ever C or it's ilk, because whilst it's powerful it's amazingly good at letting a 'newbie' do stuff that horribly breaks their code in insidious ways.

    Object oriented and functional is something that do need to be covered, certainly, but they're a little more abstract than 'make computer do a list of things to produce a result'. Some languages also have a tendancy to be too powerful in my opinon - a lot of the OO stuff has this massive laundry list of stuff you can do with object method calls, but doesn't actually help you understand what's actually going on.

    So whilst I'd never use Pascal again by choice, I'd still recommend it as a starting point for a true beginner.

  126. Make them write an assembler in C or ML by Anonymous Coward · · Score: 0

    If it's a full course, then try to make them write something very standard (an assembler for your preferred platform) in either C or ML (depending on taste. I participated in teaching this to beginning engineering students. Not only they learn how to program in the chosen language, but they understand how the computer works and get to see their code functioning and doing something they always knew about but never thought they could tackle.

  127. Use Design Patterns and algorithms. by Anonymous Coward · · Score: 0

    Use Design Patterns and algorithms as a starting point.

    Computers science (and programming) has everything to do with problemsolving, and this should be done in an abstract way. (A specific programming language is just a tool, just as the paradigm it belongs to.)

    As a side effect Design Pattern books especially introduce you to several language specific implementations of the patterns. This gives an exceptionally good practical insight of what a specific programming language defines.

    At the other end of the spectrum, an introduction to assembly language is a good idea.
    Especially the discrepancy between assembly and abstract concepts will trigger curiosity, attention and true insight.

    J.
             

  128. Lisp by Surreal+Puppet · · Score: 1

    In my university (LinkÃping university, Sweden) the intro programming course is lisp, interwoven with the calculus courses.

  129. The main problem is not paradign by TrixX · · Score: 1

    I recommend you to read this study about CS education... it mentions that even if you can try changing paradigms, techniques, tools, there is a single factor that students bring on already when starting the course which has more impact on their results than any other change.

    I am not saying that every paradigm is the same, only that you're not starting "optimization" of the course at the most relevant problem.

  130. The Basics-Lubrication. by Ostracus · · Score: 2, Funny

    "How these people survived is beyond me, but it is not the language's fault any more than it is the house's fault when the 30 year old child refuses to move out of his parents' house."

    I'm sorry but the basement door is jammed so yes it's the houses fault.

    --
    Shai Schticks:"You don't make peace with friends, you make peace with enemies"
  131. the best CS program I ever saw started with Basic by Anonymous Coward · · Score: 0

    it went
    introduction to programming
    algorithms
    assembly (starting with flipping toggle switches and progressing from there)
    and beyond this you could go in many directions

    the first language isn't critical. the important thing is to learn the basic approaches, a bit of how things are really working, and that there are many ways to do the same thing, and many languages that you can work with (and non of them are 'the one true language')

  132. Python by Anonymous Coward · · Score: 0

    With Python, you can freely mix paradigms in a way that feels natural and convenient. You can use it in a procedural way, object oriented or both, while taking advantage of its functional programming capabilities, such as built-in functions (map, reduce, filter...) or list-comprehensions (taken from Haskell).

  133. First programming course for whom? by mebrahim · · Score: 1

    I think for taking decision on paradigm, language, etc., we should first ask we're going to teach programming to whom?
    A computer engineering student? Imperative paradigm and Assembly + C should be a good start.
    A computer science student? Maybe they should better be introduced to all of them and then go deeper in imperative. (One reason for imperative is: because algorithms are usually described in an imperative style.) I don't see much benefit in getting them involved in pointers and such; the language can be something simpler such as Python (which looks much like pseudocode!).
    Math students? Maybe functional is better than imperative to start with.
    You say for others.

  134. Object oriented programming by Anonymous Coward · · Score: 0

    Do that first. It seems[citation needed] it is easier to switch from OO to functional/imperative than the other way round. So I heared.

  135. F sharp by PermanentMarker · · Score: 1

    Well... if you want to program in the future, create scaleable software and like functional programming.
    But still want a rich and proven environment.

    Then maybe you should learn about F#.net
    It's a multicore language, and i know plain basic is a lot easier, but to sharpen (#) your mind about programming then a functional language would make you a better programmer. I dont say it will be easier, it will be different, if you want simple code simple programs its more easy to start with basic. afterall its called basic

    --
    I know you're out there. I can feel you now. I know that you're afraid. You're afraid of us. You're afraid of change.
  136. Premise is flawed. by Anonymous Coward · · Score: 0

    Unfortunately the premise of this question is somewhat flawed. The effective use of a programming language depends on understanding the paradigm >that language effectively supports. Since programming is hard to teach independent of the language, I would say that the best paradigm to teach is the paradigm the language itself effectively supports... and that a curriculum in programming should include several languages with emphasis and instruction on the paradigms they push.
        Hmm.. I see a post about Stroustrup weighing in on educating software developers.. wonder what it says..

  137. Melbourne? by Anonymous Coward · · Score: 0

    Probably off topic, but this sounds pretty similar to the CS/SE course on offer at University of Melbourne, Australia. Any chance this is where you are/were studying?

    Speaking as a 1st year SE student having taken 'Introduction to Programming' in C, I don't recall the lecturer really focusing on the fact that what we were taught was any particular paradigm. I think it was simply stated that it was one of many ways to do it, and that if we continued to study within the CS/SE faculty we would continue to learn new/different ways with their own up/downsides. I really don't know what paradigm was taught (don't flame me yet), but whatever it was, I understood and enjoyed the course not because of what we covered, but how it was covered. So stop worrying about what you teach, and focus on how you teach it, I have friends at other institutions who hate what they're doing (seems to be the same thing but in Java) and actually transferred to my uni a year later.

    FWIW, we studied functional programmming the following semester (Haskell), I absolutely loved it. I've seen a lot of you say so far that FP will throw a lot of C programmers off, but I got it pretty much straight away, and I'm really not a fast learner. Just had a fantastic lecturer.

  138. More backwards thinking by FranTaylor · · Score: 1

    "Too often I have seen programmers assuming infinite precision in their real numbers and similar errors that someone who has dealt with the reality of bits and bytes would never do."

    These are errors on the part of the computer. The user wants to represent 1/3. He cares not why the computer cannot do it. That's the computer's fault, and it is easily remedied.

    1. Re:More backwards thinking by WH44 · · Score: 1

      "Too often I have seen programmers assuming infinite precision in their real numbers and similar errors that someone who has dealt with the reality of bits and bytes would never do."

      These are errors on the part of the computer. The user wants to represent 1/3. He cares not why the computer cannot do it. That's the computer's fault, and it is easily remedied.

      Your 'easy' solution is to presumably use an infinite precision data type - something significantly slower and more data intensive than a real as handled by the (co-)processor. The thing is, the programmer needs to know which of these he should use, which he will only learn, if he's gotten "down and dirty" in assembler. My point stands.

    2. Re:More backwards thinking by TerranFury · · Score: 1

      presumably use an infinite precision data type

      I was thinking more along the lines of a 'rational' data type (store numerator and denominator as integers). But I'm not the GP, so I can't speak for him.

      But your post makes me think... something simultaneously along the lines of and diametrically opposed to what you've been saying. I wonder if being given just unsigned bytes and having to write code to handle all more complicated cases would be a good instructional experience. I think it would. Pretend the floating-point units aren't there; really make the kids think about mantissas and exponents, and different ways to represent numbers, instead of having the CPU automagically do it all for them.

      (Though this shouldn't be an intro course.)

      I guess this is the spirit of this course.

      (Disclaimer: Not an RPI grad; didn't take the course. Just saw a Youtube video about it. But it looked like a good way to go.)

    3. Re:More backwards thinking by WH44 · · Score: 1

      Oooh! That is excellent! Now if they only did that with real hardware - it's fun to use a bread board, later a soldering iron and finally to watch the lights blink on something you've built yourself. :-)

    4. Re:More backwards thinking by Tablizer · · Score: 1

      Maybe in the future computers or compilers will be smarter and faster such that if we want to represent "1/3", it will actually store it as a ratio or formula *internally* instead of floating point. I may only turn to floating point if the equation complexity exceeds a certain threshold. But this is merely a thought experiment for the future.

      The current way we do it might still be obsolete fairly soon for other reasons. With cheaper memory and CPU we have more practical options now. For more on this, see:

      http://www.c2.com/cgi/wiki?NumberTypes
         

  139. Oh really by FranTaylor · · Score: 1

    If you really want to start from that direction, then why not start with quantum physics, proceed into semiconductor theory, VLSI design, thermal design, clock skew, finite state machines, etc?

    Much better to start from your head and work towards the hardware instead of starting with the hardware and working towards your head.

  140. Learn about the "How"??? by FranTaylor · · Score: 1

    "How" backwards!!!

    When you want to learn to play guitar, you don't start with acoustic theory and the physics of plucked strings. You start with music theory, melody, harmony, chords, etc.

    1. Re:Learn about the "How"??? by WH44 · · Score: 1

      Actually, I did learn acoustic theory before I learned to play the guitar, but I think you're missing my point:

      A person learning something new should start at the lowest level needed for understanding and performing correctly. My guitar teacher started with holding the guitar correctly and making a few chords before going on with melody, theory, etc. In the case of programming, I believe that base level is assembler, based on my own experience and in interaction with other programmers who have and have not learned assembler.

    2. Re:Learn about the "How"??? by Tablizer · · Score: 1

      In the case of programming, I believe that base level is assembler, based on my own experience and in interaction with other programmers who have and have not learned assembler.

      Please keep in mind that I am debating the *order* of courses/topics, and *not* the actual *inclusion* of the topics. I perfectly agree that assembler should be taught at some point. That is not the issue at hand.
           

  141. Hi by hashwolf · · Score: 1

    [Preliminary note: In the following text I use language and paradigm interchangeably. The reason is that programs are, more often than not, built according to the paradigms embraced by the languages they are programmed in.]

    The paradigm/language chosen to start with is IRRELEVANT as long as the programming language used:

    1. is easy to understand/read
    2. comes with simple examples (not just syntax!) for ALL keywords/built-in functions
    3. provides run-time debugging facilities(preferably visual) gives warnings on common mistakes(e.g. using = instead of == in a boolean expression)
    4. give understandable feedback when unexpected behaviour occurs (e.g. out of bounds access, integer overflow)

    Also of equal importance is the IDE used. While many programming teachers seem to be concerned with the paradigm/language to use, I think that the choice of which IDE to use is equally important.

    I personally learned programming using the Turbo Pascal IDE from Borland (Dos based). It has all the "features" mentioned above in a manner that is easy for a beginner to use.

    Today I tend to recommend C# as a language since it also provides the required facilities.

    With regards to which IDE to use I shy away from presenting VisualStudio to beginners, prefering to recommend the use of SharpDevelop instead.

    Important: once a particular starting language/paradigm has been well understood... encourage your students to proceed with other paradigms and languages.

    --
    - "They misunderestimated me."
  142. there's no Object Oriented paradigm by Anonymous Coward · · Score: 0

    Object oriented paradigm is not a true paradigm, but an extension to the procedural, or imperative, paradigm.

    We sill have objects (classes in Java vs. structs/modules in C) that have states, and we call methods (functions) to modify those states. Functions have side effects, and assignment is destructive. Encapsulation, inheritance, and polymorphism are not new paradigms, its just that C++ and Java support them in language syntax and semantics, making it much easier to use.

    The other true paradigms are functional (i.e. Lisp) and logical (i.e. Prolog).

    Lisp also brings the dynamic aspect absent from C/Java world.

    I would never teach students Java, no matter how good the course is. C/assembler would be the mast to learn machine internals and pointers, and Lisp to learn stateless and dynamic programming.

  143. BASIC sucks! by FranTaylor · · Score: 2, Insightful

    How can anyone seriously consider a language that is MISSING almost all of the modern features needed to express your programming intents?

    Write a medium-complexity program like the ubiquitous Towers of Hanoi problem in BASIC, and then in a modern language like Scheme or python. Compare the source code of the two programs and then tell me what language is better for introducing programming concepts.

    1. Re:BASIC sucks! by Alpha830RulZ · · Score: 1

      Speaking just as a devil's advocate, not as a serious proponent of BASIC, the first thing students need to learn is the simple mechanics of expressing instructions in a text file and delivering it to an interpreter/compiler, and then causing the file to be run. Then they need to understand what a statement, constant, variable, and type is. Then they need to understand file operations, input and output. Then they need to understand how a language can limit you. [humor] BASIC is certainly adequate for this.

      That said, Python or Perl would be my first choice for an intro language out of the readily available options these days. Or C, if I thought the kids were sharp.

      --
      I was taught to respect my elders. The trouble is, it's getting harder and harder to find some.
    2. Re:BASIC sucks! by Haeleth · · Score: 2, Insightful

      How can anyone seriously consider a language that is MISSING almost all of the modern features needed to express your programming intents?

      That's one of the things that makes it a good introductory language.

      There's a reason why people who started computing in the 1980s are way ahead of people who started computing in the 1990s -- and it's because we all had a BASIC interpreter pop up as soon as we switched our computers on, while the 1990s generation's computers booted into a vastly less powerful DOS shell, and too many of them were sucked into Doom before they ever discovered the joys of qbasic.

      Dropping people in at the deep end with classes and objects is crazy, when they don't even grok what a variable is yet. Nobody's suggesting making BASIC the basis of the entire course, but it's a reasonable place to start for the first week or two, while people are still getting their heads round what programming is actually about. Then move onto Scheme to teach them about abstractions. Save "real world" languages like Python and Java until they know something about what's going on underneath all that sugary syntax.

  144. ob xkcd by mike2R · · Score: 0, Redundant
    --
    This sig all sigs devours
  145. Explaining languages paradigms and consequences by Anonymous Coward · · Score: 0

    I've just written an article trying to explain various languages paradigms and consequences:
    http://hc.fullpliant.org/doc/language/overview

    And another one for advanced programmers explaining why meta programming is a more important feature than others (because more general) and must not be handled just as syntactical rewrites:
    http://hc.fullpliant.org/doc/language/meta

  146. Gustavo by Anonymous Coward · · Score: 0

    My first programming subject was "Algorithms and Data structures" in wich I learned Pascal and muLisp, great stuff for learning.
        Nowadays they teach C, wich I think is a huge mistake. The reason is that students get themselves lost in C sintaxis, tricks and optimizations rather than paradigm comprehension.

  147. NO NO NO!!!! by Nazlfrag · · Score: 1

    Use an old basic like the GP recommends, with a simple text editor or interpreter environment. Kids do not need the complexity of visual basic or visual studio interfering with their comprehension of the fundamentals.

  148. Best 1st paradigm: procedural programming. by master_p · · Score: 1

    The best paradigm to introduce programming to someone is procedural programming:

    1) it teaches the person to separate functionality into subroutines. This is the first step for every other paradigm (object-oriented, functional etc).

    2) it introduces the concept of variables. Functional programming languages don't have variables, so they are not suitable for teaching the concept of storage, which is central to programming.

    3) it is simpler than object-oriented programming. Object-oriented programming is procedural programming coupled with many other concepts.

    Two of the best languages for introducing someone to programming are:

    1) the programming language Euphoria. It's very simple, but it contains all the basic concepts.
    2) the programming language ABC, which is crafted for teaching and introductory courses.

  149. procedural IMHO by ILongForDarkness · · Score: 1
    I'm not going to toot procedural over OOP or vis versa. Just IMHO procedural is easier to learn at the beginning and is closer to what is "actually" happening in the computer.

    Object orientated stuff adds a lot of complexity before you can start to even learn how to code. The fact that people even mentioned the difficulty in constructing a good object model diagram seems to reinforce my idea. When you are trying to learn how to program and someone spends hours teaching you how to read UML and then showing you diagrams you'll get bored out of your mind.

    Procedural languages in general let the student jump right into making programs that do stuff. As the course progresses they'll learn better ways to do things, figure out what helps them prevent bugs etc. But pushing off the satisfaction of "making something" well into the future as OOP fans tend to want to do is not a good idea.

  150. Re: "Both" by Jane_Dozey · · Score: 1

    You know that it doesn't have to come first right? In my Uni we had to learn the basics first (variables, conditional statements, loops, etc). Then we got onto Java and C++. After that we were exposed to a whole bunch of different languages, including Scheme. In fact a whole class was dedicated to Scheme and the concepts behind functional programming. It was a lot more useful to be able to code in Java/C++/[enter non-functional language here] to get other subjects done (really, how can you learn software engineering concepts or write a simple filesystem if you can't code anything) than wait until everybody had learned functional programming before learning anything else.

    It was made rather clear to us though that programming was much more than Java or OO though so I guess we all knew it was only a part of the programming world that we were being taught.

    --
    Silly rabbit
  151. I know a bad example by Analogy+Man · · Score: 1

    I have observed that engineers can write bad FORTRAN in almost all programming languages.

    --
    When the people fear their government, there is tyranny; when the government fears the people, there is liberty.
  152. Algorithms by egandalf · · Score: 1

    My first course was "Introduction to Algorithms" and was taught using TrueBasic. The greatest advantage to this course was that it was about the basics. Not how to write a function for X language, but rather how to write a function, how best to utilize loops (and we did stay as far away as possible from GOTO, though in Basic it was sometimes unavoidable), etc. It was a class that forced you think in logical paths, to think like a programmer. We learned to plan how we wanted something to work before diving headfirst into code. Though I took classes in other languages and more advanced concepts later, I maintain that that first algorithms class was by far the most beneficial and carried the most knowledge down the line for not just the remainder of my college career, but also my actual career.

    --
    Those who have telepathy have no need to RTFA.
  153. Ada is not horrible by krischik · · Score: 1

    Maybe because Ada is not actually horrible.

    Maybe because Ada is only called horrible by those who never used it. At least I now of no seasoned Ada programmer who calls Ada horrible.

    Which is unlike C / C++: I know several seasoned C / C++ programmer who consider C / C++ horrible and only use it because they have to. Some posted right here in this discussion a little further up.

    Maybe because any seasoned programmer I know of with in deeps knowledge of Ada, C and C++ will choose Ada if he / she has a free hand.

    Maybe because I have more experience with the matter then you.

    And why use monopace? Because code tags don't work any more on "plain old text" posting.

    Martin

  154. Smalltalk, LISP, or Python are good choices. by forgoil · · Score: 1

    They are all three good languages, that are good for programming in. They aren't related to some kind of stupid advocacy nor inflated egos. Knowing any of these will teach you about important programming concepts and give you a good start to becoming a software engineer.

    Java on the other hand is a very poor choice. In my career (10 years) I've met many "Java Programmers". They all sucked, every one of them. It seems like all one trick ponies that gets thought only Java, or never ended up grasping any other language, never really understands the art of programing. I've known many Software Engineers on the other hand that did know how to program Java, among other languages, and many of them have been very good at what they do. This leads me to belive that Java is a horrible choice to teach. It's easy to pick up, it's easy to use, but it is not a good programing language at all. There is 0 need to teach it. Any half way decent softie should pick it up in a week.

    I'm going to end with a brilliant qoute (which I am paraphraising, probably badly) by Jimmy Nilsson (google him!): "Everyone should learn a new language every year".

    So you might have a first language you learn, but if that is also your last, do not bother...

    PS Lua and Javascript are two other great languages to teach. And if you are teaching kids they can have imidiate use of it as well. Addons for MMORPGs and webapps :)
    "

  155. here's an idea by Anonymous Coward · · Score: 0

    Jacopini-BÃhm, and I say this because it's more like...walk before you run.

    I am tired of seeing developers that learned to program OOP first, and have almost no idea on what's involved in actually getting shit done. What I mean is, they don't know what the OS does internally when you ask it to open a file, or read from a file, or put stuff on the screen, etc.

    You asked for language-independent opinions, but...I think the way to go is:

    -Structured programming: Learn control structures, flow: Pascal (boy, will you learn what's a datatype)
    -Structured programming: a little lower, learn memory mgmt, pointers, a better world: C.
    -Structured programming: install DOS 6.0 and play with assembly (now we are talking)
    -Object oriented programming: Hello C++
    -better OOP: Java
    -make the brain work a bit more: lisp, clisp, etc. You probably won't use it, but it will help you analyze problems better.

    I hope that helps.

  156. I don't understand... by Anonymous Coward · · Score: 0

    What's wrong with relying on libraries? Why reinvent a tool if it's already there?

  157. I started with C by Anonymous Coward · · Score: 0

    I started with C. I think it is important that folks understand the concepts of pointers and memory management prior to hitting references and garbage collection. (and structs/unions before classes/interfaces.) As Spolsky once (glibly) said, there are two types of people in the world, those that understand pointers and those that don't, and taking C first helps figure out what group you are in.

    While modern techniques like dependency injection, interfact driven design, event driven programming, etc are key to being a good programmer, I feel like that stuff is best learned after getting a good grasp of good ol' functional low-level programming basics.

    That said, maybe the world can be divided up into "those that just want to hack up web pages or spreadsheets", and "those that want to be hardcore programmers." Because if you just plan on hacking some VB or javascript, then I don't know if you need to know C.

  158. Bits and Bytes by Wyck · · Score: 1

    Well, I learned basic interpreters first and I turned out all right! As for instruction, The first I ever had was watching "Bits and Bytes" with Billy Van and Luba Goy (Canadian TV series, some clips are available on youtube). It's (obviously) the only first exposure to programming I ever experienced. It's taken me an additional 25 years or so to get to where I am now, but I have to say it was good beginning.

    It had cute little animations about bits being light-switches and the CPU being a long-nosed cartoon character putting numbers into boxes. I still think about computers like that.

    For example: Bits and Bytes: Program 1

  159. Scheme by misfit815 · · Score: 1

    My first computer science course was based on Scheme. It was my first exposure to recursion, and my first encounter with a language that didn't have artificial boundaries (such as the 4-byte integer limit, or the delineation between an integer and a float).

    My second was an obligatory introduction to C and Unix.

    My third was a completely theoretical course, utilizing only pseudo-code on a whiteboard.

    Despite the fact that I wasted the remainder of my post-secondary education on video games and alcohol, I have always found this 'trifecta' to be an excellent introduction. To put it another way:

    1. Teach a language that opens up new possibilities (such as Scheme).
    2. Then teach a proper baseline (such as C/C++).
    3. Then get theoretical.

    J

    --
    Jesus told him, "I am the way, the truth, and the life. No one can come to the Father except through me. - John 14:6 NLT
  160. Imperative first, without a doubt by m50d · · Score: 1

    And I say this as a functional programming zealot. It's hard to learn a new paradigm at the same time as you're learning to program at all, and both functional and object-oriented programming require you to shift your perspective a lot. So teach imperative programming first, because it requires the least adjustment to one's way of thinking.

    --
    I am trolling
  161. just.... by xate · · Score: 1

    not Java.

  162. Re: "Both" by mrchaotica · · Score: 1

    A huge chunk of computer science indeed, but almost useless in industry

    If what you care about is being "useful in industry," then go to DeVry or ITT or one of those other vocational schools that advertise on TV.

    --

    "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  163. Seems to Me by Anonymous Coward · · Score: 0

    I am just finishing a Computer Engineering degree up in Canada..

    The way we did it here, first two courses were in Java. The first one started with functional programming, but quickly gave way to OO. The second course was heavy OO. The third focused heavily on design patterns.

    Afterwards we moved to so called "Digital Courses" at which point we sort of started from scratch. All VHDL and Verilog, building simple state machines (counters, handshakers etc).

    After that another course on Assembly, moving up to C, at which point about 2 or 3 about programing on various embedded platforms.

    I think this approach is good... Get your feet wet, understand some high level concepts... and then get right down and dirty and understand how the fundamental blocks are working and slowly build back up.

    just my 2 cents...

  164. I think motivation is the key by Anonymous Coward · · Score: 0

    Programing should make your life simpler, it is a tool. It can also be fun, like crosswords or suduko :)

    I would start with a shell (bash or fish) and show the power of piping, and move on to python since it supports most paradigms. I belive different paradigms are suited for different persons and problems. We should not force one view.

  165. Start at the Beginning by DogLover4 · · Score: 2, Interesting

    I have to weigh in on the side of beginning with imperitive programming. After all, that's closer to what the machines are actually doing. If you don't start with the idea that the machines are taking instructions and perfoming tasks, that concept is harder to grasp later on. I had a computer science professor who used to say that nothing is automatic. If something happens "automatically," that means that someone else has already written the program to do it.

    OOP is a programming design concept. It and the languages that support it should be taught after the basic concepts are learned. Would you teach an architect how to design a house, before teaching him the basic properties, adavantages, and disadvantages of different building techniques? If you did, you might get a house made out of inappropriate materials, just to satisfy a design feature. For the vast majority of applications, you want the architect to use appropriate materials. The exceptional architects will know when to "break out of the box." This is when you get a Frank Lloyd Wright.

    In the same way, programmers should be taught starting with the basics. They must know the advantages and disadvantages of all programming design concepts. They should be exposed to many programming languages, so they can see how to implement different designs in different languages. They should be taught that in the "real world" there will be business considerations that will take higher priority than what they perceive as the ideal technical solution, and that they may have to work with the less than ideal solution. To do this, they need to know many ways of designing programs, and the advantages and disadvantages of each. To understand these advantages and disadvantages, they have to understand how the higher level programming is converted (compiled, interpreted) into what the machine can understand.

    1. Re:Start at the Beginning by v(*_*)vvvv · · Score: 1

      If something happens "automatically," that means that someone else has already written the program to do it.

      This is absolutely crucial. The computer is a machine. Nothing is accidental. And if you are a programmer, there is absolutely no such thing as "it isn't doing what I'm telling it to." No no...

      It is only doing exactly what you are telling it to!!

      Once a programmer, we forget how normal people think... Computers only do *exactly* what they are told. Not many things do that! My mother might click the same icon 3 times if there is no feedback... "Well, if it isn't working, I must have done something wrong." "It might work this time." Then when Word opens 3 times, she thinks she isn't "communicating well" with the computer. Sure, if a splash screen were to show up immediately, she might recognize here request has been processed, but she still doesn't grasp the concept that though there may be delays, the computer is never wrong, and always does exactly what is asked of it. If there is an error, it is human, and most times it is in the software, and you cannot do anything about it.

  166. why take a course? its easy to pick up by peter303 · · Score: 1

    My college (MIT) offers very few real programming courses. Its presumed that almost everyone had learned how before attending. This was as true 30 years ago when I attended as now.

  167. An Odd Idea by WyerByter · · Score: 1

    For an "Introduction to Programming" course, how about pseudo-code?

    Teach the concepts using pseudo-code, then give examples in specific languages, and paradigms. You could use a C inspired pseudo-code, so that the format and syntax would be near that of C, C++ and Java; and that would give you imperative and object oriented. I don't know enough about functional to comment on that.

    You could also use pseudo-code to introduce the differences in the various types of programming.

    Better yet, I think I have run across pseudo-code interpreters from time to time.

    Another way to go, if there is enough demand is to offer multiple variations of the Intro course. "Intro to Programming with C++", "Intro to Programming with Java", "Intro to Programming with Haskel", "Intro to Programming with machine language", or whatever as desired and enrolled by the students.

    --

    This signiture copied from somewhere.
  168. First languages by Anonymous Coward · · Score: 0

    My first programming language was LincolnLog, followed by TinkerToy and then LEGO.

  169. Machine Code is Most Metal by redjack · · Score: 1

    Start on the metal, then work up through the abstraction stack. Machine code is all the damn boxen do anyway, and it teaches hard discipline and later appreciation for higher-order language features.

    If x86 is too ugly, start with a cleanly designed emulator like MIX (er, MMIX).

    Happy DEC-10 day.

  170. We archive it here... by Dareth · · Score: 1

    at this site: www.thedailywtf.com

    And no, you probably don't want to read it. It may just scar you for life.

    --

    I only look human.
    My mother is a halfling and my dad is an ogre, so that makes me an Ogreling
  171. Start with ... by giemer · · Score: 0

    Logic ...

    Doesn't matter what you want to do, if you can't define a logical progression of states, you can't get anywhere in programming.

    High level math class is all any person needs ... the syntax only takes a couple weeks/months to master.

    Best practices for coding is really just a matter of opinion. Any paradigm that is preformed cleanly and consistently is fine.

  172. Re:Assembler... seriously (addendum) by Tablizer · · Score: 1

    Let me clarify the example: Perhaps they should mention that Double-precision has limits in class #1, but not get into the nitty gritty of how floating point works just yet.

  173. Imperative by Anonymous Coward · · Score: 0

    The term object oreinted is used to describe a different set of characteristics of programming languages than imperative is. An object oriented language, like Java, is a programming language supporting user-defined complex type hierarchies and allowing creation of individual instances of those types. An imperative language, like, for example, Java, is one in which statements describe the steps to be taken in order to transform input into output by a sequence of changes in program state.

    Imperative programming dominates most venues of practical use and is also the closest to how the computer operates. The other two common paradigms, functional and logical programming, are much further from the actual behavior of the computer as a device and closer to the mathematics behind programming. They are both worthwhile, but I think that imperative programming is probably the best way to begin, especially since many novice programmers have difficulty grasping the mathematical concepts.

  174. DRY [ Don't repeat yourself ] by jbezorg · · Score: 1
    DRY

    From: Dave Thomas's book The Pragmatic Programmer.

    Don't Repeat Yourself (or DRY) says that every piece of system knowledge should have one authoritative, unambiguous representation. Every piece of knowledge in the development of something should have a single representation. A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.

    Given all this knowledge, why should you find one way to represent each feature? The obvious answer is, if you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. DRY is important if you want flexible and maintainable software.

    --
    I've lost all my marbles except one & It's fun to test angular & centripetal acceleration in my skull
  175. Re:Assembler... seriously (BASIC first) by gosand · · Score: 1

    I learned BASIC first... then assembler. I think it would be hard to jump right into assembler. BASIC gives you the ideas of how things work, and some of what NOT to do. :)

    I was in CS in college back in the late 80s/early 90s. I know things were different then, but I learned BASIC, Fortran, Assembler, Pascal, C, C++, Lisp... probably some others I can't remember. I do remember avoiding COBOL like the plague. I took an OS and hardware class, wrote a bootstrap, etc. I am sure many here had similar experiences. I can't say I use really ANY of it now, I chose the path of testing once I got out of school, and have since moved into project management. But it has always helped me to have those languages / experiences under my belt. It's much easier to communicate with developers if you can understand them and speak their language.

    --

    My beliefs do not require that you agree with them.

  176. Executable UML by lwriemen · · Score: 1

    Cortland Starrett has met with good results teaching high school kids Executable UML. http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=04281135 This will put them ahead of their peers in college, as they will have better insight into proper partitioning of the problem spaces present in a system.

    OTOH, they may have trouble understanding some of the illogical approaches taken by their professors and peers in the name of "good" OOP, or have trouble talking problem solving at a lower level of abstraction.

  177. 5 things Common to All Languages by mackil · · Score: 1

    For my first programming class, the instructor based his curriculm off 5 concepts common in all (ok, most) programming languages.

    1. Input/Output
    2. Saving Information (variables)
    3. Arithmetic and Boolean logic
    4. Selection Structures
    5. Looping Structures

    He hammered these concepts into us, even making us memorize the list (I wrote it up from memory).

    While it isn't perfect (and not entire accurate), it is very effective in teaching a laymen the basic beginnings of programming. Allowing them to decipher bits and pieces of code, in just about any language, that was once foreign to them. I have found it to be quite effective for beginners.

  178. whippersnapper wimps by KeithConover · · Score: 1

    Back in the old days, when we had to walk to school in the snow, uphill both ways, we learned to program the _right_ way. All you you wimps should have to do it that way, too. First, you start by learning to program an 8088 CPU in machine code using DIP switches. Then and only then, you learn how to use A86 assembler. Then you learn a strongly-typed language like Pascal to learn discipline. Then you learn object oriented programming. (I will leave the choice of an object-oriented language as an exercise for the reader. I dislike the sight of blood.) Then you learn cloud computing, neural networks, quantum computing (you _did_ take four years of theoretical physics, right?), or whatever is currently in vogue. Then and only then you learn to actually do something useful, say with AJAX. Can't find a Cromemco 8088 or Z80 computer on eBay? Build one from scratch. (I also think all this garbage about letting medical interns sleep four hours in every twenty-four and one day off in every seven shows how deep the moral rot is penetrating.) Well, what are you waiting for? Go get your soldering iron.

  179. The first course should be about problem solving. by enbody · · Score: 1

    I believe that the first course should be about problem solving. In particular, problem solving using a computer.

    Use a language that lets you focus on problem solving and not on the details of the language. My personal favorite is Python.

    (I've taught introductory programming using FORTRAN, Pascal, C, and C++, and, yes, I do have gray hair).

  180. Bad equipments makes for good scientists by goombah99 · · Score: 1

    IN my college physics labs they gave us bad equipment on purpose so that we could learn how to make sensitive measurements with crappy gear. At the time I thought this as insane. But later in graduate school I learned no this was sheer genius, since all I was ever doing was trying to make a measurement that was just a bit beyond the (theoretical) capability of existing equipment. One had to have a really good grip on how to do error models, and how to remove noise, and how to tweak uncertainty principles to get gains in places you want while giving up things you don't care about.

    When I learned languages, like basic, I was always trying to write other languages in that language. e.g. bootstrapping a pascal interpreter.

    and now I get to my seemingly crazy reccomendation. I understand python and java today because I leanrned Perl first. with Perl, object oriented programming is the equivalent of the visible man. Everything from inheritance, to how attributes are indexed to how the heirarchy of subclass method resolution is traced is at your disposal to tweak.

    it's the "visible man" on languages.

    turns out python objects are just a subset of perl's object method. Under the hood they work identically. i.e. pythons __dir__ is the same as a blessed hash in perl. python's slots are the same as a blessed array in perl. You just don't get to see them in action in python but they are there lurking underneath.

    So if you really want to understand object oriented programming. use perl. it's not a good language to write huge object oriented programs in. But it makes you see how all the magic works and how tou can change the magic to do some really great things.

    and that will bake you a good scientist. otherwise learning one language well just makes you a good programmer.

    --
    Some drink at the fountain of knowledge. Others just gargle.
    1. Re:Bad equipments makes for good scientists by DocHoncho · · Score: 1

      ...turns out python objects are just a subset of perl's object method. Under the hood they work identically. i.e. pythons __dir__ is the same as a blessed hash in perl. python's slots are the same as a blessed array in perl. You just don't get to see them in action in python but they are there lurking underneath.

      You've got that backwards.

      From http://www.perl.com/pub/a/2007/12/06/soto-11.html:

      Python

      After Tcl came Python, which in Guido's mind was inspired positively by ABC, but in the Python community's mind was inspired negatively by Perl. I'm not terribly qualified to talk about Python however. I don't really know much about Python. I only stole its object system for Perl 5. I have since repented.

      --
      Celebrity worship is a poor substitute for Deity worship and costs more to boot.
    2. Re:Bad equipments makes for good scientists by goombah99 · · Score: 1

      Well that does not really contra dict what I said. Python and perl have the same object model. Python is hidden from the user and perl's is exposed. (like Lua).

      --
      Some drink at the fountain of knowledge. Others just gargle.
  181. Paradigm Paradox by Anonymous Coward · · Score: 0

    RAD - It's the most interesting and people need as much help as they can get to stay awake during a computer programming course :-).

    When you start out it certainly helps to understand there are different ways to develop software and this really depends on a lot of different aspects. The realy question is what resources are available? What expert knowledge is there? Does the customer know what they want or do they need help to get the specification correct?

    A good software architect would know that any large software project may involve several paradigms, each working for a given area. For example if you want to build an interface for a system you may pick to develop using a rapid application development and mix and match with other paradigms.

    If you wanted to build software for medical equiptment or missiles then you'd have to look very closely at how to make sure it's safe.

    My course taught us to look at the complexity based on how many instructions there were, and how many different systems were involved. This helps decide on how much time NEEDS to be dedicated to testing any given module and what 'cycle' you should use to develop.

  182. Beginners want to make games by KalvinB · · Score: 1

    I would start with a language that's easy to use and gives easy access to graphics. A beginner needs to learn "concepts" not syntax. I like BASIC because you can create simple shapes and learn all about double buffering and screen modes without having to learn much syntax. You can also learn how to make functions and implement basic AI. BASIC would allow students to make games within the confined time of a semester or year.

    Then, if the student decides that this programming thing is fun they can be aware of DirectX, OpenGL, etc and when they go to learn how to use it they know the concept of screen modes, double buffering, functions, loops, logic, etc which makes learning the new more powerful languages significantly easier. Games require a vast array of concepts that can be applied to any programming project.

    It would take a week to learn in C what can be learned in a day with BASIC. Students can then be self motivated to learn the more complex version of the basic concepts on their own time.

    The next class should get into more powerful languages that show how the concepts learn in BASIC are applied. Then you don't have to waste a semester showing students that all languages implement many of the same concepts. They'll figure it out on their own. And they'll know the concepts so they can figure out how to use any language quickly.

  183. I think the CS posts miss the point... by Big+Boss · · Score: 1

    The OP is talking about a first PROGRAMMING course. Not a CS degree specifically. The goals are not really the same. If you're teaching someone to program you don't really want to start with the low level stuff. A CS grad needs to know that stuff, but I don't see why it should be covered as "Intro to Programming".

    As far as paradigm, imperative. Why? Because it's going to be kind of familiar to newbs.

    Language? BASIC or Python. Java is nuts. I shouldn't have to tell a newb about classes and objects. Or, worse, to tell them to ignore the magic statements. You can do "Hello World" in a single line of BASIC. No magic. Python is similar, but with a better library.

    Teaching programming should be about programming, not machine level interactions. Teach things like variables, operators, conditionals, and loops. Teach it in BASIC first, then Python. You're not teaching syntax or algorithms here. Once they can do those, you can move to more complex stuff like functions. After that is the time to start talking about objects. A newb can start making sense of what an object is and why they should care to use them at this point.

    Functional programming is very different from how most people seem to think. It's useful to learn it though, so perhaps the last month or so can be dedicated to functional. Show how to do some of the things we already did in a functional way. That way, the student can see that there are different tools that might be better for various problems.

    Pointers, memory management, objects, classes, and other such things aren't really "into" concepts. They layer on other concepts. A good programmer needs to know them, but they don't need to start there.

  184. Show me the money! by rlnorthcutt · · Score: 1

    I think many of you are missing the point... the object is to get intro students to learn programming. ANY language will teach them the basics of logic and structure IF they are taught - but what will ignite the imagination and give immediate results?

    Why not a web dev environment like PHP or RoR?

    In addition to being decent languages, the students can get really fast results and an immediate "product". As they get more excited, they will WANT to learn more details and figure out how to create a better app. PLUS - web dev is a relatively easy way to make some extra cash, and practical abilities that can lead to money are another motivator.

    I know - learning C or Pascal, etc. is more foundational and powerful in the big picture. But for beginners, I think its more important to get them excited to learn. Once they have a bit of confidence and curiosity, its much easier to migrate to just about any other language they want/need. Humans learn best by actually "doing stuff" and not by theory alone. Theory and the intricacies of coding become more relevant once we have a rough foundation to build on.

    Get them "hooked" with immediate gratification and easy apps (that they can easily share with friends!), and then lead them into deeper waters once they are comfortable.

  185. Re: "Both" by Fallingcow · · Score: 1

    If what you care about is being "useful in industry," then go to DeVry or ITT or one of those other vocational schools that advertise on TV.

    ... and get paid less than you would have if you'd gone to through a dumbed-down (or not, either way) 4-year program that got you that nice CS degree. And have fewer options for employment outside of IT since you don't have a 4-year degree.

  186. No brainer, procedural by Jaeph · · Score: 1

    This is a pretty easy question. You are teaching basic programming to someone who has no prior experience. Teach them to think like a computer first - assignment, decisions, branching. Show them how that's a state machine, but don't delve deeply. Show them a few assembly statements (but don't make them program in assembly) so they really see how it works down deep.

    Let them code the towers of hanoi and all the other basic fun stuff. Don't throw heavy theory at them right now.

    Class #2 is a great point to extend towards your favorite. Now that you've got them doing basic programs, you can show them the pitfalls and why is superior. But first, ground them in the basics.

    -Jeff

    --
    Please learn the difference between a dissenting opinion and a troll before you moderate.
  187. Scheme? by fieldstone · · Score: 1

    My intro programming class at U of Chicago was taught entirely in Scheme. Having already taken C++ and Basic before, I found it tedious and hellish, but I can see how it would definitely leave a new programmer open to any other paradigm.

  188. A different approach. by julesh · · Score: 1

    The first programming course should be about how to write good unit tests.

    It's suprising that so few programmers leave university and even progress in careers as software developers for years without this basic, essential skill. More emphasis on testing at an educational level would solve a lot of the problems we have with writing good software these days.

    (So says somebody who didn't learn how to write a good unit test until ten years after graduation)

  189. Re: "Both" by mrchaotica · · Score: 1

    ... and get paid less than you would have if you'd gone to through a dumbed-down (or not, either way) 4-year program that got you that nice CS degree.

    Actually, out of the three of my friends who majored in electrical engineering [technology], only one of them has a job in his field. The other two have IT/website backend/light Java-type jobs. Guess which one went to DeVry (while the other two went to GA Tech).

    Now, I don't know how that actually translates to salary, per se, but I'd bet the DeVry guy's job is at least as good as either of the other guys'.

    (By the way, all degrees were Bachelor's degrees, but the DeVry guy earned his in 3 years while the other two struggled through in 5, and the DeVry guy got a full scholarship.)

    The bottom line is that if you want job training, you are not better off at a University. It's the same in all fields: getting a mechanical engineering degree is a waste of time if you want to be an auto mechanic. And there's nothing wrong with being a mechanic (or, analogously, an "IT guy" or a "programmer"); in fact, there are a lot more of those sorts of jobs around than there are for engineers and computer scientists! The real problem here is that both schools and students have completely the wrong expectation of what a university computer science program is all about.

    --

    "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  190. Thats the problem with the "real world" by bussdriver · · Score: 1

    Colleges are supposed to TEACH understanding so one can discover and solve their own problems and essentially train themselves on the grunt level stuff (not that training may still save time.)

    TRADE schools are supposed to TRAIN workers to get the job done. Understanding is not required beyond what is mandatory to the trade. (I know I'm oversimplifying the difference.)

    CS is NOT supposed to train you for industry! Colleges are being undermined for their focus theory because people are mistaking a college for a TRADE SCHOOL.

    Theory applies indirectly to industry. Its up to industry to understand that a CS major has to learn trade type stuff on the job; some are realizing the CS degree is less important than real experience.

    The big question is should CS be an offshoot of math and go back to its theoretical roots?? Should a TRADE like path be used instead where you have apprentices and masters - because becoming a master programmer is actually akin to a TRADE like carpentry?

    Why should 1 model of career development dominate each offshoot specialization? (other than the bias for academic institutions to expand and remain relevant even when they are not best suited.)

    Would development of computer worker unions help address the problem? For example, local unions for plumbing, pipefitting, painting, etc. have an apprenticeship model for career development - the academic model doesn't work their careers.

  191. here's a start... by TemporalBeing · · Score: 1

    To start with, an "intro" class should not focus on one single paradigm, but focus on general concepts and show how they apply in multiple paradigms. This is best done through using several different languages, and repeating the same exercises in each throughout the course. Later courses can focus on a single paradigm and language, and then choose one that best fits what that course is trying to achieve. And yes, this is doable, but requires a very dramatic change in the CS curriculums to do it.

    Many curriculums assume that you need to teach the students "how to program" before you expose the students to multiple languages. This holds true, somewhat, but the use of multiple programming languages can still be easily achieved in a intro course. To achieve the result, select different languages that each have different paradigms (chaotic, functional, OO, etc.) and go through each one covering each quickly - e.g. spend 3 weeks in each language on really simplistic programs that demonstrate the basics of programming; the assignments for each 3 week group are the same, just in a different language using a different paradigm.

    You can also run a secondary "intro to language C/Java/whatever" course alongside the course to go into greater depth on other things; or it can be reserved for the next semester/year.

    BTW, I speak as someone who was through such a course. My high school programming classes started with an intro course that introduced the other programming language courses. The first semester was more or less computer introductory, and focused on DOS Batch programming; the second took up QBasic, the third Pascal, and the fourth C++. QBasic, Pascal, and C++ each had advanced courses we could take after that. But it taught us a lot more than a standard CS intro course - it was more analogous to my "Programming Languages" course - a "200" level college course. So yes, it can be done and done well; and by doing it, you get to mold the student's mind into being able to think in more than one paradigm or programming language.

    Given today's computer languages, I would probably advocate the course use something like JavaScript, Perl, C/C++, Java, and SmallTalk. (JavaScript because it is handy for a lot of scripting - web and on Windows computers - and it can be very similar to Chaos style programming. Perl for its RegEx, C/C++ for functional, Java for its sluggish OO style, and SmallTalk for true OO.) But I wouldn't limit it to specifically those. You could replace JavaScript with Assembly for true Chaos style programming, but I think that would be going a bit too far for an intro course.

    Needless to say, I would put the emphasis on the intro course being a diverse CS experience, having to deal with multiple paradigms and programming languages. It will give students a better taste of what CS really is as opposed to focusing simply on a single paradigm and language that embodies that paradigm.

    --
    Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
  192. Hard to say... Dijkstra if you can sell it, else C by ravyne · · Score: 1

    I would probably lean towards a procedural language for a first go. It just seems to be easiest to grasp. Objects require too much design overhead for newbies to get right -- doing a fair amount of procedural programming, IMHO, gives them enough of a feel for program structure that they at least have a hope of getting things modeled well enough using objects later. Furthermore, if you were to teach, say C, you can introduce OO concepts through procedural means such using structures having associated functions taking a "this" pointer, function-pointers for basic polymorphism, etc. I realize that C++ is not a "pure" OO language, but being able to show things in the more-transparent C, which are direct analogs to their C++ implimentation is very valuable.

    A decent modern BASIC might also be a decent route -- VB/VB.net is no good, all the focus on the GUI aspects confuses students. My girlfriend is taking a Web development course, and the poor VB students can make a GUI well enough, but they didn't learn what a function was until the last week, which was a week after they began their final project. Maybe FreeBASIC or RealBasic would be better.

    In the end I think its mostly about teaching varied and fundamental methods -- for example, whatever the language, make sure you school them well on recursion, because it opens a door to a new way to solve a problem for most people -- and its also an important basis for functional programming.

    I wouldn't worry so much about whether that language supports various features, such as closures or first-class functions, as long as the chosen language allows you to demonstrate a reasonable facsimile of the feature -- providing an intellectual framework in which to discuss the feature and how it works behind the scenes is what's important, not that it actually *is* implemented that way in the chosen language. IMO, its all the better if you can put it in familiar terms in a "primary language", say C, and then show them what it looks like in a language that supports it naively -- since that often demonstrates the elegance of the feature, as well as putting it in a high-level light free of the implimentation details.

    I might be tempted to say that C would be the best choice -- Its in a unique position of being low-level enough to serve as a basis for most features in any language, as well as being the "lingua franca" of programming languages.

    Then again, Dijkstra believed that an intro programming class should not be about computer programming at all, but rather about logic, reasoning and proofs... I actually tend to agree, but I doubt you'd ever sell the faculty, parents, or students on that because there's no immediate gratification -- That was actually the point of Dijkstra's famous essay; that the desire for immediate apparent gratification goes hand-in-hand with the infantilization of the educational institution, at the detriment of all involved.

  193. Christmastime at Slashdot! by jafac · · Score: 1

    What a great day, both a Platform religious flamewar, and a Language flamewar in a single day! How great is that?

    I love you guys. Keep those inline ads coming!

    --

    These are my friends, See how they glisten. See this one shine, how he smiles in the light.
  194. Focus on how those paradigms translate into ... by Conficio · · Score: 1

    What I learned most from in my CS studies was to understand how a higher language (in my old days Pascal) translates into a machine readable form.

    The basis to all this was the understanding a Van Neuman machine and We simplified actual Pascal Programs into a PascalSimplified dialect and then into assembler code. You can do the same with higher level concepts like OO or functional programming.

    The beauty is that after that exercise you are ready for the next paradigm shift, which is about 5-7 years away. You can understand how it relates back to what you already know and do not start from scratch or fear the "new world."

    --
    Busy helping non technical users of OpenOffice.org - http://plan-b-for-openoffice.org/
  195. Not a Paradigm by Jedi_Yo_Jo · · Score: 1

    You should learn software design first. Learn how to make a software requirement specification, test plans, and and architecture.

  196. Process over paradigm by DragonWriter · · Score: 1

    Functional, OO, or (structured) imperative methods are all valid; I think How to Design Programs is a good basis for a first course not because of paradigm, but because of its focus on problem analysis, design for reuse, and testing, which is largely paradigm independent.

  197. Another opiton? by rekica · · Score: 1

    Just a small information.. I am a first semester student (Bachelor in Informatics) and we started with both Java and C. The very basic concepts were introduced in Java and then we continued in C for pointers and data structures. So this option exists too.. it's a bit strange but it works for the moment (or I must say, I hope it works...)

  198. What about C as a compromise? by Nurgled · · Score: 1

    I think the best place to start is a language that is close to how the machine "thinks" without creating lots of unnecessary detail early on. I think I'd probably start with C for that reason. It has enough expressive power that you can introduce some basic stuff without needing to go into full detail right away, but as you introduce the lower-level bits (probably in assembler, as you say) you can easily identify how the C constructs map onto the underlying machine language, so the details are introduced in terms of the abstractions that the student has already learned.

    This also works well in the other direction. Having taught C, you can show how it makes solving some common problems quite fiddly, and thus introduce the concept of an abstraction and the concrete examples of object oriented and functional programming as abstractions for solving certain classes of problems. At this point it's easy to draw the parallel that C is in fact an abstraction over assembler which is itself an abstraction over the machine language.

  199. Teach all major paradigms, but start simple... by Anonymous Coward · · Score: 0

    I think it's a mistake to assume that each paradigm requires learning a new language.

    Use a language like Ruby (Python might work too, or even JavaScript) that will allow you to start out with super basic procedural stuff, and then add object orientation, and then work your way up to functional programming. (See http://www.rubyconf.org/talks/46 if you don't believe you can do functional programming in Ruby.)

    Along the way you can dabble in a language that typifies each approach, so C could be covered briefly, and Java or C++ or C# as well, and Lisp or Scheme or Haskell or Erlang toward the end. But I would make the main focus the single language (Ruby, for example) so that through the course the students are not merely getting exposed to several languages but are actually building on what they learned and building practical skills.

    There's no need for "real-world skills" and theory to be completely at odds. A really popular language that provides the ability to work in multiple paradigms allows for learning both marketable skills and important CS concepts.

  200. Assembly. by gfxguy · · Score: 1

    I know I'm late to this thread, so most people probably won't read this, but I didn't want to Jones in on a sub-thread. I also admit I only read through the first page and a few on the last page.

    So the way I see it, starting with assembly language really lets people understand what's going on "under the hood," how memory is allocated for variables... you don't have to write a big program in it, just a few small ones so that students understand how memory works and the importance of various types of instruction sets. So not for long, and not necessarily in depth... like the first few weeks.

    Then C. It's simple for people to see how C could be translated into assembly, and then you can also expose them to libraries. Again, this doesn't have to be long, I just think it's one of the easiest languages to learn HOW things work.

    From there, you can go on to anything: C++ seems logical but it can be a bit of a beast, and if you want to discuss object oriented, I think Java would be a fine choice.

    Like everybody else, just my opinion.

    But hey, we were taught Pascal in CS 101 and 102, and I managed to graduate and get a pretty nice job programming, so as so many others are pointing out, the language doesn't mean a whole lot... of course, I already knew BASIC and had taught myself assembly on my Atari...

    --
    Stupid sexy Flanders.
  201. Correct by symbolset · · Score: 1

    Since they're learning the consistent and creative application and extension of abstractions, the less "real" it is at first, the better. Imaginary machine code makes a nice beginning because from there they'll be glad to have structured programming, and if the go the electronics route instead they won't have the mental crutch of a "magical black box".

    --
    Help stamp out iliturcy.
  202. Re: "Both" by Fallingcow · · Score: 1

    Hrm. Interesting. It was my impression that DeVry and the like had reputations similar to that of "Joe Bob's Correspondence University of Theoretical Physics". Perhaps I am mistaken. I don't know any HR people personally; maybe they don't feel that way after all! ... in which case I really should have taken them up on that scholarship thing. DAMNIT!

  203. For teaching whom? by Anonymous Coward · · Score: 0

    For teaching to whom?

    For kids, definitely using ALICE

    LUA

  204. Theory first by Anonymous Coward · · Score: 0

    The best Intro to Programming classes I took covered theory first, starting with an introduction of the differences between sequential, object-oriented and functional programming. The theory has to do with languages, and what they are..

    In the course labs there was hands on experience with C/C++, etc., but no language-specific stuff in the main lectures. Later, each class would use a different language to introduce a CS concept. Java for web, C/C++ for operating systems, Dylan/Lisp for the compilers class. This is the best, since languages change too frequently.

    I learned Basic, assembly and Pascal first, but they're ever used directly now. I say focus on the theory, and an overview first.

  205. In OO We Trust? by Wowlapalooza · · Score: 0, Offtopic

    The methods within an object are, of course, functional.

    Despite omnipresent side effects?

    Um, "omnipresent" means being everywhere, simultaneously, and is thus an attribute of a deity. I doubt that even the most ardent OO-worshipper would ascribe godhood to an object.

    I'm thinking the word you meant was something more along the lines of "inevitable" or "ineluctable".

  206. They're not spoilt yet /metalinguistic abstraction by j.leidner · · Score: 1

    Since the newbies are not pre-occupied by what is going to be their first language, I suggest you'd ask THEM how they think the computer should best told what to do. That way, we can maybe achieve progress on the programming language front, for really there isn't much new stuff coming out, but this doesn't mean today's languages are perfect. Lanugages like Ruby (and I'm not saying anything against Ruby here) are really just mashups of existing features found in Scheme, Perl, and Python. It's time to come up with new revolutionary paradigms, and nowhere can the be better encouraged/instilled than in the first programming class.

    In some sense, any course based on SICP goes a long way, as it introduces abstraction as the foundation of computing, and meta-linguistic abstraction, i.e. the invention of new languages, is described as just one our of the many tools that often lead to better software. So True!

  207. Assembly language by aminorex · · Score: 1

    Assembly language allows the new programmer to understand the computer as it really is. Anyone who doesn't understand what is happening under the covers of higher abstraction layers is never going program above a very poor level.

    Preferrably, a RISC assembly language, but PPC is relatively orthogonal.

    --
    -I like my women like I like my tea: green-
  208. Scheme by Anonymous Coward · · Score: 0

    My first programming course was taught in Scheme, a variant of Lisp. It made sense since students came from all kinds of different background and some already had skills in C, C++. This way everybody stated from scratch since it was very unlikely somebody already knew Lisp programming.

  209. "Object-oriented" is not a very meaningful term by Estanislao+Mart�nez · · Score: 1

    Nobody's every offered a usable definition of "object-oriented" that really allows you to distinguish OOP from non-OOP in any reliable manner. Classes don't do it (because of prototype-based languages that are said to be OO); "sending messages to objects" doesn't do it either (counterexamples: CLOS, Dylan); object.operation syntax doesn't do it either (CLOS and Dylan, again). Dynamic dispatch seems the closest thing to a deciding criterion, but that alone seems like an unsatisfying answer, because it describes a technique that can be easily built into a random impure functional language (you can probably implement simple dynamic dispatch in two pages of Scheme code).

    "Pure functional" does have a good demarcation criterion (the language has referential integrity in all contexts with no exception), but "impure functional" is also impossible to demarcate precisely (Is Ruby an impure functional language? Is Python so? C#?)

    Ultimately, I think all this talk about "object-oriented" vs. "functional" isn't very useful. It would be better to enumerate specific features or properties that one would like a language to support. So, for example, I like PLT Scheme because it has first-class functions, closures, macros, dynamic types, mutable state, record types and a module system. I can use these fairly straightforwardly to implement nearly any programming technique or feature out there, from dynamic dispatch to monads, logic programming, or what have you.

    1. Re:"Object-oriented" is not a very meaningful term by julesh · · Score: 1

      I'm pretty sure dynamic dispatch is the key element. I'd say a Scheme that had been extended in the manner you describe is an object-oriented Scheme. (This is the great thing about LISPs in general: you can implement almost any paradigm you want in them, as long as you don't mind using peculiar syntax for it).

      Certainly, dynamic dispatch seems to have been central in Alan Kay's mind when he invented the term.

    2. Re:"Object-oriented" is not a very meaningful term by DragonWriter · · Score: 1

      Dynamic dispatch seems the closest thing to a deciding criterion, but that alone seems like an unsatisfying answer, because it describes a technique that can be easily built into a random impure functional language (you can probably implement simple dynamic dispatch in two pages of Scheme code).

      You can (at least, I think I've seen it done) implement prolog-style logic programming in a couple pages of Scheme code; the fact that something has a convenient implementation in Scheme hardly means it isn't a valid programming paradigm. It just means Scheme is a powerful tool.

    3. Re:"Object-oriented" is not a very meaningful term by Estanislao+Mart�nez · · Score: 1

      I'm pretty sure dynamic dispatch is the key element.

      I just don't think dynamic dispatch is a big enough idea to merit the name "paradigm." I realize that there can be no principled rule to distinguish between "paradigms" and mere "techniques," but I'd say the following:

      1. Functional programming is a paradigm.
      2. Object-oriented programming is a vague family of paradigms.
      3. Dynamic dispatch isn't a paradigm; it's a feature.

      I'd say a Scheme that had been extended in the manner you describe is an object-oriented Scheme. (This is the great thing about LISPs in general: you can implement almost any paradigm you want in them, as long as you don't mind using peculiar syntax for it).

      What's peculiar to the syntax for invoking a generic function in a CLOS-type system? It's the same syntax as for applying any other function in Lisp. The fact that the function does a dynamic dispatch is an internal detail of the function.

      There is likely some special syntax for defining the generic functions and the methods, sure; how is that peculiar, also? Stereotypical OOP languages have separate syntaxes for class definition, method definition and method invocation.

      Certainly, dynamic dispatch seems to have been central in Alan Kay's mind when he invented the term.

      What does "central" mean in this context? He certainly had a lot of other stuff in mind at the same time. Were any of these other things "central" too? If so, were any of them more "central" than dynamic dispatch? Again, there's no principled rule here, but I just don't think dynamic dispatch by itself reasonably counts as a "paradigm."

      I must say that I find some of the Smalltalk core ideas pretty bad for software engineering, particularly the emphasis on subclassing and adding methods to base classes. And a lot of OOP folks would wholeheartedly agree with this...

    4. Re:"Object-oriented" is not a very meaningful term by Estanislao+Mart�nez · · Score: 1

      But logic programming gets called a paradigm because it's a Turing-complete computational model that's dramatically different from the more familiar ones (Turing machines, lambda calculus). I'm not aware that dynamic dispatch is like that.

      Though by that criterion, functional programming is a paradigm, imperative is a paradigm, an OOP isn't. To me that just goes to show that the notion of a "programming paradigm" is vague; there are a bunch of different reasons that somebody refers to something as a "programming paradigm," and the criterion by which logic programming makes the cut is not the same as the ones by which OOP makes it in.

    5. Re:"Object-oriented" is not a very meaningful term by DragonWriter · · Score: 1

      But logic programming gets called a paradigm because it's a Turing-complete computational model that's dramatically different from the more familiar ones (Turing machines, lambda calculus). I'm not aware that dynamic dispatch is like that.

      Its not, clearly, and so OO languages also fall into one or more other paradigms (frequently imperative, sometimes functional or logic.) You could probably meaningfully describe imperative, functional, and logic as programming paradigms and OOP (data structures + associated methods used via dynamic dispatch) as a really powerful design pattern (or cluster or related design patterns) rather than a programming paradigm in the same sense that functional, imperative, etc. are.

  210. What is the context? by SanguineV · · Score: 1

    I would have to say the best language is dependent on other factors involved. Consider the goals of both the teaching institution and the type of graduate they wish to produce. I'll describe three different approaches to education I have come accross and why each would use a different language paradigm.

    Example 1: Alpha
    Alpha is a university that has a strong focus on research and academic qualities over industry practice. Their approach to programming is that it is a part of computer science and they are interested in teaching computer science. Their courses focus on mathematics, logic and languages with a heavy emphasis on theory. In this scenario I would suggest a functional programming language to begin with - it matches the mathematics and theory quite nicely.

    Example 2: Beta
    Beta is also a university, however the emphasis is on creating industry ready graduates. The university has taken a conscious decision to focus on skills over theory and has no mathematics as part of their IT course. Their approach to programming is very mechanical and about understanding state. In this setting I would suggest a procedural language that is heavy on state, maybe C, C++ although OO languages are also options.

    Example 3: Gamma
    Gamma is a tertiary education institute that creates certified graduates with specific skills. Their approach to programming is to create a programmer who can jump into a team right away and start working. They have no real interest in underlaying programming theory at all, they want to tick a box on an application form or resume. They typical run a language specific course on the language used by the industry and so would likely teach OO languages such as Java.

    I would not claim any of there are a "better" or worse approach to learning your friend programming language. IMHO the universities (Alpha and Beta) should produce better programmers in the long run as they go into more theory and detail, but any of the three is as good a starting point as the other - in the end a good student will learn despite the limitations of the institution.

  211. I don't think the type of language matters. by disunencoded · · Score: 1

    I first learned from people who kept it interesting for me at first, and I learned in basic (lol it was the 80's). As I recall, it wasn't the means but the ends that excited me in the earliest days. From there I taught myself, and I think the key wasn't the language, it's truly being interested in what you're doing and seeking out better ways to do "stuff with code".

    I'm not advocating people toss formal education aside, but I will say that I firmly believe that without a love for programming no amount of training will ever make anyone a "good" developer. Proficiency != skill in my book.

  212. What about this... by Anonymous Coward · · Score: 0

    There is a free online programming book called
    How To Design Programs:
    http://www.htdp.org/

    It uses Scheme as the teaching language, but covers most of the common things, such as recursion, loops, etc.

  213. First and foremost we must tell by jawahar · · Score: 1
    1. Telephone enhances talking ability.
    2. Television enhances seeing ability.
    3. Automobile enhances traveling ability.
    4. Computers enhances thinking ability.
  214. Do you hate your students? by OutOfMyTree · · Score: 1

    Are you at a university at the top of the international league tables, that enjoys treating its students badly -- "shape up or ship out"? If so, of course you will go with functional programming. No need to think about their best interests, especially not for those students who won't stay with computing.

    If you care about your students on an ordinary Programming 101 where approximately 0% will go on to a job with Programmer in the title and many will not take programming next year or ever again, then you need to think harder about what serves your audience. That part who will stay in hands-on computing will mostly be in databases and/or web development.

    Start with procedural or OOP programming? Well actually, start with something in which your students can easily produce professional-looking programs. Those happen to be OOP languages with good development frameworks. Dedicated nerds or students required to take just this one course will both benefit from a feeling of achievement.

    My experience suggests introduce procedural concepts first, wearing the OOP lightly "We will program this button to...". In depth OOP can be introduced in System Analysis (if you are really lucky in your colleagues).

  215. Language and Paradigm independence. by v(*_*)vvvv · · Score: 1

    Man, I am SO late but... just to add to the pile.

    1. Emphasize that there are multiple paradigms, not a single paradigm.

    2. Demonstrate each paradigm with different programming cases and languages. For example, do something OOP in scheme. Something functional in Java. Or preferably do them all in multiple languages. Show how some languages have features that gear the language towards specific paradigms and coding practices.

    3. Help them recognize the difference between learning how to build something, and the internals of programming. Building involves knowing your platform, getting the tools, knowing where to find help, and getting over bugs and quirks to accomplish the end result. An example would be making something for the iPhone, or for Windows. The internals of programming involves learning all the concepts, and how things *actually* work.

    4. Teach what makes a good programmer independent of language. Code reading comprehension. Code debugging. Consistent syntax. Variable naming. Scope and namespaces. Commenting and organizing code in a way that lets other people easily work with it. Team concepts. Abstraction. Abstraction layers. Using and building APIs and libraries. Google searching skills.

    5. If the science is important, why not show them this:
    Structure and Interpretation of Computer Programs, Video Lectures by Hal Abelson and Gerald Jay Sussman from 1981

  216. Do Not Eschew Basics by JamesonLewis3rd · · Score: 1

    BASIC

    --
    Hebrews 11:8
    Jeremiah 33:3
  217. NOT SCIP! Peanut Butter and Jelly Sandwiches! by PurplePhase · · Score: 1

    While functional programming and other paradigms are important to computer science, they are NOT important to a beginning programmer. Why not have them doing graduate-level compiler optimizations in their second week?

    First thing you have to do with new programmers is get them to relate what they're doing to what they already know. The classic "tell me how to make a Peanut butter and Jelly sandwich" exercise is a way to engage the group and get them to realize how literally everything is taken by the computer. Then start them making similar programs - Ruby, Python, whatever seems fine as a way to program without cruft and less confusion for the students.

    I had programmed in Apple BASIC and MSDOS C before taking MIT's SCIP course, and I still couldn't make heads nor tails of their functional programming. I barely survived by doing pattern matching to make somewhat functional programs once we hit the part of using true Scheme/LISP paradigms, but that is no environment to encourage understanding nor creativity. Possibly because I already understood procedural, but I doubt it. I don't see how picking someone off the street has a chance of understanding functional programming. (Oh? You who are protesting: How much programming is a prerequisite for an INTRO course?)

    Just because you present the material doesn't mean you've made it understandable. MIT definitely proved that to me, even when Abelson and Sussman taught the course. Well, presented it.

    Object oriented, however much others protest, is just an abstraction on procedural (ie. the definition of C++) and has nothing to do with functional programming. OO languages may have other features which lend them to functional programming (or functional ones with OO features) but they're hardly equivalent nor disjoint sets.

    Also, yes, after the first course have additional courses in functional, ASM, etc. 6.004 was a blast building computers first with ANDs/ORs and later programming chips to interpret 'languages' all the while wiring them together. I hope everyone has the chance to do that!

    8-PP

  218. Why not all of them? by inline_four · · Score: 1

    I think if someone wants to give a good introduction on programming, the goals should encompass a detailed, but high-level overview of what computers do, how they are architected, what the different styles of programming are, and how to play around with them. It does not need to be a single language that rules them all. It does not even need to be the best representative of each style. I'd say the focus should be on getting the message of what each programming paradigm stands for as quickly as possible.

    I would say that easy-to-use tools are important here. And they don't have to always be traditional development environments with traditional assignments. To teach the concepts of modern computer architecture, I'd devise a game, where students play the roles of a controller, memory, and other parts. Only, to make it interesting, the controller operates on a set of simple "real world" instructions that can be used to write a program that causes the players in the game to bake a cake or solve some puzzle. This would also go a long way in explaining some concepts of imperative programming, what compiled and interpreted languages are all about, etc.

    For functional stuff, how about let the students play with spreadsheets? I am biased on this subject, having developed a kind of programmer's spreadsheet app that I think is great for this sort of exercise, but it's not the only one. There are lots of extensible spreadsheets out-there that can teach one the same concepts. Then, to reiterate how programming is not always manifested in the same way, draw parallels to XSLT processing and have the students grasp some concepts from there as well. The goal here is to teach them to think, not teach them a specific skill, yes?

    --
    Alexey
  219. beginner pov by Anonymous Coward · · Score: 0

    I don't know if this will give some sort of insight or not but I thought I'd share my story of starting out in my first programming courses.

    I'm most definitely a beginner programmer still to this day. I started out at college with Java and being young and not knowing much after about half way through the semester I quickly felt overwhelmed. I switched majors and did about 2 years of VB.NET and ASP.NET. Now when I go back to Java, or look at other languages like PHP and Python everything is SO much clearer than it was. Understanding OOP has become so much easier among other things.

    I guess my point is it really helped me to not start out with a "hardcore" OOP language like Java (which may not actually be that hardcore, keep in mind my knowledge level). After starting out with VB.NET I moved to C# .Net and now am going back towards my older Java days and found a new interest in Python. I know there is many elitist on here and I don't know anything about "Paradigms" but I thought it might help hearing from a beginners point of view.

  220. C before C++ by Austin+Milbarge · · Score: 1

    I tutor students in computer science courses and have seen so many students complain that they don't understand functions and data, yet their teacher has moved onto classes and objects.

    The problem with teaching C++ and not C is the that too many teachers move too quickly to the OOP stuff because they feel that it somehow "replaces" non object C programming. This is not only wrong but dangerous because these students are rushed into OOP without understanding the problems it solves. Besides, not all problems are best solved with OOP.

    The C programming language is actually a simple language. You'd be surprised at how quickly students can pick up concepts like pointers and dynamic memory management if the teacher only expose it to them early on and give them short projects to boost their understanding. Sadly, many teachers do the students a tremendous disservice by trying to avoid pointers because it gets in the way of teaching OOP. Or perhaps the teacher himself is rusty.

  221. let them choose by quippe · · Score: 1

    Given they are learning what a turing machine and a language *are* on other courses, if you want them to teach programming, forget languages at first and teach paradigms and patterns. Dont need to go deep inside language flavours to learn divide et impera, bottom-up, facade and wrapper; then assign programming problems focusing on input-output, data structures and design: dont forget when most posters here, including me, graduated, we hadnt the net but just plain books. Thus, let them form a personal idea about what to use to solve the problems.

    After that introductory part, divide them in six groups, each one respectively writing a client and a server in C++ on windows, in C on linux and in java (for instance a simple client-server versioning text editor/repository). Let the server groups and the client groups meet each other in order to specify a common protocol and a common data format. During the course make them write the software so that the linux client can interoperate with the win server and so on.
    At the end of the course, probably there will be no working software, but you would have taught to this little army of uber-developers the way to face programming problems, not your way to solve them.

  222. assembly by Criminally+Insane+Ro · · Score: 1

    IMHO, I think Assembly is the best because it forces you to start thinking about how the machine itself functions underneath. Art of Assembly is where I got my start.

  223. It's all imperative at some level by ProfessorJoy · · Score: 1

    I was a programmer in the US Air Force. I also taught their 11- week computer programming course for three years. We began with basic problem solving. We taught programming design language (PDL) and flowcharts. Students were given simple problems to solve with these tools before they learned any actual computer languages. Their first languages after that were Assembler, Fortran, and Cobol. It worked very well. For those who believe object oriented is best, remember, within your objects are methods, and those methods are essentially imperative.

    --
    Do what you can do until you can figure out how to do what you can't do.
  224. Paradigm? by Sophira · · Score: 1

    The best first programming paradigm is one that doesn't involve the word "paradigm".

    (You should watch out, you'll become a manager that way.)

  225. e a doctor?Re:The Basics. by Hognoxious · · Score: 1

    Would you expect somoene starting med school to already be a doctor? Some subjects aren't taught in high school, or at least not in all of them.

    TFA did say it was an introductory course.

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  226. Don't worry about the paradigm by goodoldschu · · Score: 1

    I'd recommend whatever paradigm best gets out of the way for new programmers. IMHO, in the first course, you shouldn't focus on the paradigm - you should focus on generally learning how to get computers to do things, and how to solve problems with them. Once the students know the basics, they can start learning different paradigms and the tradeoffs between them.

  227. Go SICP!!! by Anonymous Coward · · Score: 0

    I was taught SICP here at berkeley in Scheme. The language is a multi-paradigm language so we really understand functional programming by the end of the first month. Then we move on to imperative, and object oriented for another month. Then just to make sure we really understand whats going on under the hood we build our own language interpreter. Then we implement our own lazy evaluating, and logic based languagues! Then we create a register machine for this interpreter!

    After that class I some very strong opinions about what a programming language should and shouldn't be. I've also learned 3 programming languges in one semester on my spare time! I couldn't imagine a better way to learn about programming.

  228. How this paradigm works... by Anonymous Coward · · Score: 0

    An Assembler programmer can program C, C programmer can program C++, a C++ programmer can program Java, a Java programmer can program Python.

    A python programmer who can't program java, can't program C++

    A java programmer who can't program C++, can't program C.

    A C++ programmer who can't program C, can't program Assembler,

    A C programmer who can't program Assembler, doesn't understand computer architecture.

    QED.