Slashdot Mirror


Best Language for Beginner Programmers?

jahardman asks: "I work at a High School that has recently seen a decline in the number of students that want to take our entry level-programming course in Visual Basic. We have been toying with the idea of having the introduction course be in PHP or Ruby on Rails; but are not convinced that they lead well into higher level languages. Does anyone out there have suggestions as to what would be a better language to start students with? Ideally one that might be more 'enticing' as well?"

78 of 448 comments (clear)

  1. RealBasic by Blakey+Rat · · Score: 2, Insightful

    You could try them out on RealBasic: http://www.realbasic.com/

    It's a lot like Visual Basic, except:
    1) Portable to MacOS and Linux
    2) Easier to just jump in and write apps with
    3) Produces apps with no DLL dependencies.

    Give it a try, you might find it meets your needs.

  2. Java? by m0rph3us0 · · Score: 3, Insightful

    Java might be a good idea. Lots of tools available for free, and isn't domain specific like PHP.

    1. Re:Java? by jd · · Score: 4, Informative
      Java is a good language for a beginner and does teach some very useful OO concepts. I would quibble that as PHP can be run as a standalone application it is really no different from other scripting languages. However, it has poor structure and encourages some really bad programming practices. That's the only real reason I'd discourage it for beginners.


      I would NOT touch C++ at the novice level - way too much packed into it. Java is lighter and more modular, which is a better design practice. Teach by example, not just by examples.


      Really, structure is more important than syntax. Anyone can learn a new syntax, but if they don't grasp structure, they will never grasp programming. For that reason, even Pascal as a teaching language has its good points.


      The programming language D seems to have some of the benefits of C++ and C#, without as much overhead, so that might be a candidate too.


      Don't go for over-structured languages like Ada - they're as bad for newbies as the totally unstructured ones. (In fact, either extreme is a mental health hazard to all programmers and should be banned under EPA guidelines.)

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    2. Re:Java? by anomalous+cohort · · Score: 3, Interesting

      I once was an adjunct professor at USF and introduced programming to MIS students. The first time that I taught that class, I presented a simple, console based balance checkbook example in Java. I watched as the class recoiled in horror at all those curly braces.

      For the next class, I presented the same program only this time written in Python. That class was much more comfortable with the Python sample code than the previous class was with the Java sample code.

    3. Re:Java? by raolin · · Score: 2, Interesting

      To be honest I would stick with C++. You get much of the memory manipulation of C with the OO principles. Once you understand HOW memory works, and have a grasp of the fact that memory is really whatever I feel like calling it, then you can move into languages where more of the work is done for you. Until you have written your own classes, managed the core dumps and have had to track down where you failed to check the amount of memory allocated I do not think you should work in a language that hides these processes from you. It is one thing to get lazy, it is another to start off that way.

      --
      "It is sad to see a family torn apart by something as simple as a pack of wild dogs."
    4. Re:Java? by jd · · Score: 2, Funny

      No, the Ada programming language is quite definitely a pollutant.

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  3. consider Python by Tumbleweed · · Score: 4, Insightful

    If I'm remembering correctly, Python came out of a language designed for teaching. The very syntax encourages some good programming principles (indentation, etc.), and it's object-oriented. It's a very common language to find on shared web hosting plans. Also, Ruby on Rails isn't a language - it's a framework. The language is Ruby. Ruby would also probably be a good language for students to learn, though it seems less popular right now than Python.

    PHP as a _language_ is probably not a great idea, but used in conjunction with web development, it would be great, but don't forget MySQL and/or PostgreSQL. And Perl, though that should come later; students need to learn programming with something with decent syntax before being exposed to something like Perl.

    IMO, anyway.

    1. Re:consider Python by croddy · · Score: 5, Informative
      I agree. Python is an excellent starting point for beginning programmers:

      It has a very clean, refined syntax; It can be used equally well as an object-oriented language as a simple procedural scipting language; It is open-source, freely distributed, and cross-platform (so that students will be assured of the ability to install it on their home PC's easily and legally); and while it is easily extended, it has a very useful standard library which will fill the needs of beginning programmers for a few years to come.

      Ruby is very similar to Python, and is another excellent choice, although I feel that the documentation for Python (in English, at least) is somewhat better.

      Neither PHP nor Rails are good choices for beginning programmers -- while developing web applications is very simple for advanced and intermediate coders, remember that beginners can get into some serious trouble learning a programming language, a query language, and a markup language all at the same time. Perhaps these would be better for a second course.

    2. Re:consider Python by deeny · · Score: 2, Informative

      Neither PHP nor Rails are good choices for beginning programmers -- while developing web applications is very simple for advanced and intermediate coders, remember that beginners can get into some serious trouble learning a programming language, a query language, and a markup language all at the same time. Perhaps these would be better for a second course.

      While I agree with the statements as posed, I also think that Ruby (as opposed to Ruby + Rails) is an excellent alternative to Python and more generally useful (my experience) than Python.

      Python's so quirky with the whitespace (I don't mind the whitespace personally, but I think it's weird to teach it as syntax in a first language).

      But then take it with a grain of salt from someone who's moved on from Python to Ruby.

    3. Re:consider Python by Incongruity · · Score: 2, Insightful
      Python's so quirky with the whitespace (I don't mind the whitespace personally, but I think it's weird to teach it as syntax in a first language).

      Quirky? How so? The using of whitespace/indentation for meaningful things really only encourages good programming and readable code. As long as you don't mix tabs and spaces (i.e. use a decent text editor that allows you to replace tabs with a group of spaces) the mandatory indenting is a fantastic thing.

      Much in the same way that LISP's usage of parenthesis made it so much easier to write code that worked on the first attempt, Python's indentation rules are extremely helpful help your write good code quickly and keeps it readable (also a plus if you're a teacher who has to read what the students code). Moreover, by encouraging high readability standards, starting in python will be make you a cleaner coder in other languages because your standards will be raised... again, all that's just my opinion...

    4. Re:consider Python by sgant · · Score: 4, Insightful

      I second the Python recomendation. It's a great language to learn concepts on and it's very powerful so it scales well when they get into higher level programming. Plus, it's cross platform on just about anything and everything that has a console.

      Give it a look. Tons of resources out there also.

      --

      "Leo Fender was in a 'state of grace' when he designed the Stratocaster." -- Paul Reed Smith
    5. Re:consider Python by Gryll · · Score: 2, Informative

      I will also cast my vote for Python. I have used Python as an introduction to programming with very good results.

      Early on being able to directly interact with the interrupter is very useful.

      Due to Python's high level nature programs can be written with very few lines of code allowing students to focus on what they want the program to do without the language getting in the way.

    6. Re:consider Python by croddy · · Score: 2, Funny

      hey, you spelled "spaces" wrong.

    7. Re:consider Python by try_anything · · Score: 2, Insightful
      I second Python. It's simple, it's a quick way to get to cool stuff, its features can be learned incrementally, and it's powerful enough to give the most interested kids a lot of room to grow and implement cool projects. If not Python, choose another language with:

      1. A REPL
      2. Simple, readable syntax
      3. Few and simple language features
      4. Enough libraries that beginners can do "cool" stuff with a little hand-holding.

      Of course, if you're teaching kids with brains, patience, and ambition, do them a favor and teach them something that will blow their minds, like Haskell. For a lot of kids, high school is the last time they'll have the patience and curiosity to do something that expands their mental repertoire but has no obvious immediate payoff. (Used to be college, but kids these days....)

      At the other extreme, if you know your students are lazy and likely to stick with one language their entire lives, I hear C works for that.

    8. Re:consider Python by bit01 · · Score: 2, Insightful

      ... the One True Way, tabs.

      Tab characters, as distinct from the tab key, are nothing more than a primitive and error prone text compression method. They should've been put out to pasture years ago.

      ---

      I love the free market zealots think monopoly is a good thing.

    9. Re:consider Python by gstoddart · · Score: 2, Insightful
      Quirky? How so? The using of whitespace/indentation for meaningful things really only encourages good programming and readable code. As long as you don't mix tabs and spaces (i.e. use a decent text editor that allows you to replace tabs with a group of spaces) the mandatory indenting is a fantastic thing.

      I guess that's an opinion, and a lot of python programmers claim that.

      The last time I used a language in which whitespace was significant syntactically, it was friggin' COBOL. From my perspective, I find pythons indenting rules to be just a horrible idea and seems broken.

      And I've seen C code written by python programmers who keep to that convention ---- it was some of the shittiest code I'd ever seen.

      YMMV, but for me, having whitespace be syntactically significant is just BAD!
      --
      Lost at C:>. Found at C.
    10. Re:consider Python by gstoddart · · Score: 4, Insightful
      It's quirky in that it allows both spaces and tabs to be used interchangeably, instead of forcing indentation to be done the One True Way, tabs.

      But there isn't One True Way.

      Or you end up with some abortion of how the text is written to the file, and therefore wrong. Emacs, for example, will not write out a single tab for each level of indent. It will collapse them all down to a single character to be space efficient.

      Then you have the encoding for how many levels of indent you actually have being encoded in an editor-specific method. So things like vi, cat, less, lpr (or notepad and printing if you're on windows) don't know how to interpret the content.

      I've had this argument with my co-workers -- some like two spaces indent, we had standardized on 4, but when edited by some editors, it crapped back a broken representation of the string because it was 'cleverly' encoded --- and it was incompatible with other editors.

      This is why whitespace chars shouldn't be interpreted as being syntactic, nor should they be stored in the file in an incompatible way.
      --
      Lost at C:>. Found at C.
  4. Teach programming, not the language. by DaoudaW · · Score: 4, Insightful

    I've been recommending (and teaching) c++ for several years now. Pascal was great, even Java has its good points. The main thing is whatever language is being used to introduce programming use it as an example language for the programming concepts which are being taught.

    1. Re:Teach programming, not the language. by BrokenHalo · · Score: 2, Funny

      In other words, consider assembly code. Sure, it takes a bit of effort to learn, but it's still by far the best way to really get to grips with programming.

  5. My answer by Omnifarious · · Score: 5, Insightful

    I don't know about Ruby on Rails, but I strongly agree with you about PHP and VB. I think they both lead poorly to working in other languages.

    I would recommend Python, because I'm more familiar with it than Ruby. It has a clear, elegant syntax, and many concepts in it exist in other languages as well.

    But, Ruby may be perfectly adequate as well. I know that most concepts that exist in Python that aren't particularly language specific have counterparts in Ruby.

    I used to recommend assembly, then scheme, just so all the people who entered thinking they were programmer hotshots because they knew BASIC, VB or C or something would find themselves in deep water and having to learn something new.

    But I suspect that's a bit overly hostile. Depends on the environment of course. Still might be a good idea for people going to a hard-to-get-into technical school to knock them down a peg or two and convince them that there's stuff they don't know.

    1. Re:My answer by failrate · · Score: 4, Interesting

      Python and Ruby are very similar, and I would recommend them about equally. C/C++ are bastard hard as starter languages, and VB is just about the tool of the deevil.

      --
      Voodoo Girl is the bomb!
    2. Re:My answer by Pheersome · · Score: 2, Insightful
      Hear, hear. My vote is definitely for Python. It's my language of choice in general, but it also has a lot of qualities that make it great for introducing to programming. A few of my favorites:
      • helloworld is literally a one-liner -- don't have to wrap it in a function (or, god forbid, a class *cough*Java*cough*) or import any I/O libraries
      • The syntax is ludicrously simple; eliminates bugs like "if(foo); {do_stuff();}"
      • The standard library is substantial and reasonably well-documented
      • After students have the basics (variables, conditionals, loops, functions, etc.), you can introduce OOP and/or functional programming
      The introductory programming course at my alma mater (a rigorous four-year math/science/engineering school) has been taught in Java for years, but it's being rewritten in Python. Go Python!
      --
      Better to light a candle than to curse the darkness.
    3. Re:My answer by MAdMaxOr · · Score: 2, Interesting

      While Ruby may be a good choice for a 1st language (though I'd teach either python or java), DO NOT teach Rails.

      Besides the obvious concerns of having to teach HTML at the same time, Ruby on Rails uses *way* too much magic for beginning programmers. There are all sorts of domain specific shortcuts that Rails uses. How are you supposed to teach iteration when the Rails uses something like collection_select?

  6. Python by MBCook · · Score: 5, Insightful
    Python. Python has everything you need and then some. It runs on every platform (Linux and OS X boxes already have it installed), and it's free.

    Python (through the use of forced whitespace) forces them to learn to write more readable code (I remember taking C++ in high-school, the stuff people wrote would make your eyes bleed). The language has everything your students might need for intro programming (for loops, functions, etc). If they want to continue on will Python later (or you want to offer advanced classes later) it has bindings for all sorts of stuff (XML, OpenGL, QT, GTK, and many many other things). It also has all sorts of handy stuff like an interactive interpreter, a "for each" loop, and more. It's object oriented too.

    Look into Python. It's easy to use and would make a great stepping stone if they want to later use a language like C/C++/Java. Or (as I said) Python is great in and of its self and they can stick with it.

    --
    Comment forecast: Bits of genius surrounded by a sea of mediocrity.
    1. Re:Python by TeknoHog · · Score: 3, Informative

      One more reason why Python is great for teaching is that you get results much faster than in some traditional languages. Of course this is great for everyday programming work, but for students the motivational aspect of rapid development is even more important. There's very little grunt work you need to do before getting into the fun stuff.

      --
      Escher was the first MC and Giger invented the HR department.
    2. Re:Python by gregbaker · · Score: 2, Interesting

      We have recently started using Python in our first programming/CS course in the first-year of University.

      Feedback from students has been quite good. The biggest complaint now is when we switch to Java in the next course: "Why do we have to use Java? Everything so so much harder."

      From my point of view, Python is well structured and has all of the language features I'd ever want while introducing programming (and arguably, all I'd ever want period). Students seem to pick up relatively good habits (of course, some will find ugly ways to do things no matter what the language encourages).

      More importantly, students can spend more time thinking about their program, and less time fighting with the language. Python seems to do its thing and get out of the way. More "serious" languages tend to be more complex--that complexity adds more overhead for the students, which means more to learn before they can actually get much done.

      For example, in Java you have to learn about classes, methods, references, and related stuff earlier in your journey. In Python, a lot of this can be ignored and introduced later. All the same concepts are there, but you can hold off and introduce them on your own terms, not because they're needed to write the next program.

      If you are interested in teaching Python, I have some course materials I can share--both mine, and collections of other resources that I point students to.

  7. Would you like to play a game? by losman · · Score: 5, Insightful

    In school kids have objectives that are more short term. Graduating, having fun and being creative are common examples of that. As educators you have more long term objectives for the kids. Preparing them for college or the professional world being prime examples of that. The answer to your question is somewhere in the middle.

    If I wanted to interest kids in programming and teach them something useful I would try something like a course in Unreal Tournament editing or some other game that has a well defined scripting language. Yes it is a game but the scripting language is very C like in nature. And let's be honest you should really be focusing on teaching them how to analyze, break down and solve problems progamatically regardless of the language. Teach them that and then let them decide if it is something they want to pursue.

    Another great aspect of teaching a course this way is that it shows them both the difficulty and the rewards of programming. It is not easy to create good levels in these games. They have to learn to handle various types of media as well as programming the main logic. As a great bonus they end up with something they all can play with in the end.

    Any how, this kind of idea is not for a conservative environment and if you are in that situation then teach them Java and emphasize object oriented development. If your environment is a bit more progressive then I would look at the gaming route.

    --
    Q: I am short, useless and provide no value. What am I? A: a sig
  8. python! by EngMedic · · Score: 2, Interesting

    scripting language holy wars aside, python WILL teach good programming style, it's clean, easy to learn, multiplatform, and if you want a good real world example of why it's useful --- well, bittorrent comes to mind.

    --
    filter: +3. Hey, look! all the trolls went away!
  9. Pascal WAS a language designed for teaching by rebug · · Score: 4, Informative

    It was designed as an introduction to structured programming.

    Python wasn't designed as an educational language. Guido explains its origins in the FAQ.

    --

    there's more than one way to do me.
    1. Re:Pascal WAS a language designed for teaching by fireweaver · · Score: 5, Insightful

      Personally, I am a fan of Wirth-style languages, so I would recommend Modula-2 (successor to Pascal with a cleaner syntax), or Oberon (successor to Modula that adds objects and garbage collection). Although I'd stay away from the native Oberon programming environment since it is quite unlike the environment most of us are familiar with (Windows and its look-alikes). Both of these languages, like Pascal were designed for instruction, but are powerful enough to be used in production environments.

  10. Java by OAB_X · · Score: 4, Insightful

    Java is easy to learn, gets programs that do real stuff going rather quickly, and is runable on any platorm, and is enterprise level.

  11. DrScheme by sleepingsquirrel · · Score: 5, Informative

    Give DrScheme a look. Nice graphical IDE, libraries, dead simple syntax. Free. Different language levels to cater to the learning process. And pleanty of introductory texts.

  12. Java & Eclipse by curious.corn · · Score: 3, Informative

    Really! Running programs from Eclipse is dead easy (no Makefiles) as is debugging the stacks (to see the how the clockwork ticking). Very visual, method completion, infopop javadoc, convention enforcing wizards and all (GUI too). Taking up Java with Eclipse is a breeze and Java itself has a nicely documented library for anything you want to play with and explore the basic practices of OOP.

    --
    Mi domando chi à il mandante di tutte le cazzate che faccio - Altan
  13. Why not C? by dasunt · · Score: 4, Insightful

    Why not teach them C?

    (Oooh, I can't wait to watch the modding for this comment.)

    C has a standard (a few, actually, C89 and C99 are probably the most important). Its not a difficult language to learn, its supported on almost every platform out there, and for certain tasks, its the only choice. Plus, there are many good support tools for C (gdb, valgrind, gprof, etc). Finally, many, many libraries are written in C -- C often ends up being the 'glue' code to tie another language to a specific library. And don't forget the many, many projects that already exist in C -- if you want to extend any of those projects, you need to understand the language.

    I always thought that assembly is not a bad teaching language either. It helps to understand how a processor works.

    I would also recommend lisp, but that has already been covered in this thread.

    1. Re:Why not C? by dasunt · · Score: 2, Insightful
      Now tell me, what is ONE thing you can do in C that you can't do in another language? And by another language I can mean anything from machine code, various architecture assemblers, C++, etc..

      Gotta weasle a bit: By saying "only choice", I meant "only reasonable choice".

      Short of assembly, C (or its cousin C++) is frequently the only reasonable choice for embedded programming (and lets be honest, for big projects, assembly is quite often not a reasonable choice). When resources are low, C shines. Interestingly, John Carmack had a blog just the other day about how you can use Java for cellphone programming, and detailed his gripes about the performance of Java on a cellphone.

      In addition, if you want to extend code written in C, you are going to have to know the language. Want to use a new C lib in python? Time to hack up a module in C. While this is true for any language, the sheer amount of libs and programs written in C is a strong incentive to learn C. (However, for the most common libs, there are often language-specific wrappers -- for example, pygames is a python wrapper around the C SDL libraries).

      Now, I'm sure someone is going to come up with an example about how to use a black candle, three monkeys, and the giant keyboard of Thor to use another language for a job that C has been traditionally good for. I applaud such a hack. But lets be honest -- the same thing that makes C a pain to use (manual memory management) also makes C a rather useful tool for some jobs.

    2. Re:Why not C? by Better+Than+Bacon · · Score: 5, Insightful
      When I first started with Java/VB, I found programming to be really hard. I decided to learn assembly/C++ and, just like dasunt said, I think they taught me how computers really work.

      Once I knew that everything is a just a number (pointers, instructions, everything) and that memory is just one big linear array, nothing was a mystery anymore -- I could figure out what the compilers and other languages were really doing. This put me way ahead of average programmers my age until 4th year university when they forced everyone else to learn that stuff.

      To be a good programmer I think you have to understand how computer really work, and C/assembly is the best way to pull back the curtain and be confident that you can get anything to work.

      On a related note, when people are teaching object oriented C++ to beginners, it's common to focus on the high level stuff (encapsulation, polymorphism). What I'd like to see is for them to mix in a little bit of "and here's how you would implement polymorphism in C" -- then people see how it all comes together. Er, well, that's what I think :~)

    3. Re:Why not C? by 91degrees · · Score: 2, Informative
      Now tell me, what is ONE thing you can do in C that you can't do in another language?

      Compile a piece of C code pathologically designed to break a C++ compiler.

      But less specifically, if your requirements are:
      • Fast.
      • Maintainable.
      • Capably of accessing memory directly.
      • Portable to different architectures.
      • Widely understood by programmers.
      C or C++ are the only reasonable choices.

      Assembler is not portable. Nor is it very maintainable.

      There are a few languages that will allow explicit memory operations, but most of them do not.

      Out of these, C is the most widely understood and the most widely ported. There are probably several embedded processors that don't have a port of C++ or pascal. Since C is also one of the most widely understood low level languages, the argument for any other low level language is weak. Hence, if you are forced to make a choice, the only choice is C.
  14. python is a good beginning by swf · · Score: 5, Interesting

    I've found that python works really well as a beginning language. Python (and many other interpreted languages) let you write fully functional programs with very few programming concepts. It's really easy to introduce one concept at a time, focus on it, and then use that to introduce the next.

    You can start small by using the interpreter as a calculator, then move the caculations to a script and executing that. After a while you can gradually introduce variables, comments, functions and modules. After that, you could introduce the standard library and show how to print the contents of a file or download a web page. Or you could introduce the OO concepts of classes, encapsulation, polymorphism and inheritance. It's really up to you and how well your students are going.

    Advanced students should also be able to create simple GUI or command line interfaces. Python has a great base class for command line programs that takes away most of the tedious parts. It also has some simple and easy database modules if you want to teach relational databases and SQL as well as programming.

    But don't forget that the most important thing to do is to teach them how to teach themselves. Show how to look through the standard library for something new, or how to find and install new modules from the net.

    When everyone has become comfortable with the language (and if you have the time) you can introduce a similar language for contrast. I've found that people who have experience with a wider variety of languages tend to be able to "grok" programs a bit easier than those who haven't.

  15. Perl. by Pacifix · · Score: 4, Funny

    Perl. We don't need any more competition! Perl should just about scare the living daylights out of them.

  16. Ruby or Scheme perhaps by Anonymous Coward · · Score: 2, Interesting

    PHP or Ruby on Rails; but are not convinced that they lead well into higher level languages.

    Uhm, PHP and Ruby shouldn't be mentioned together like that. Ruby *is* a higher level language compared to PHP.

    But that's not really important to a *beginning* programmer. What you really want to do is first teach the basics, then immediatelly teach about "best practices", like keeping code simple and clean, writing *TESTS*.. unit testing should be taught AS SOON AS POSSIBLE in my opinion. Ruby makes it easy and doing it "test first" (write the test first, then write the code) makes it even easier.

    If you want to them to understand the basics of functions and programs teach them Scheme. You can do some cool stuff with DrScheme. Then when they get to Ruby (or PHP) they will see how it's a "downgrade".

    But yeah you'd probably be better off with a language that gives them room to grow like Ruby, rather than locking them in the little space that PHP offers.

  17. Logo? by thegrassyknowl · · Score: 2, Interesting

    I remember learning to program in BASIC during my very early years. I hated it. I still hate BASIC, it was crap.

    I also remember learning Logo when I started at high school. That little turtle that pottered about on the floor was really cool, and it had all of the concepts that a programming language needs.... loops and conditionals! Having a real-world output from the program was a good way to inspire students to learn it - everyone really enjoyed it.

    There are some gizmos now called the MicroMouse or somesuch. It's a little PIC powered rover that is similar to the Turtle. You program it up with a simple dialect of C, and download the code into the PIC. The development environment comes with all the libraries to make things like starting motors and reading switches easy from the C code. That might be a good way to teach the basics without boring students that otherwise don't see a use for it :)

    Those that enjoyed it enough went on to study the more advanced stuff in later years of school.

    Of course, my days in Logo were back when the BBC 8-bit micro was new and powerful.

    --
    I drink to make other people interesting!
  18. May I suggest.... by Seraphim_72 · · Score: 3, Informative

    That you find a book first. In fact - find Head First Java" IMHO the best book to teach teens about programming. Next arm yourself with a woman of renown to teach object orientation, namely Alice, she will amase you and your teens. Lastly, once they have the basics down after the new year, get them up and running Code Rally and the winner of the Grand Prix gets extra points towards that grade!!

    Sera

    --
    Slashdot, where armchair scientists get shouted down and armchair theologians get modded up.
  19. Java, then assembly language by MobyDisk · · Score: 5, Insightful

    Here's my qualifications for choosing Java, then Assembly:

    Java:
    - Is not too verbose (Hello World is not daunting)
    - Any algorithm can be reasonably implemented
    - Any structure can be reasonably represented
    - No low-level complications like pointers
    - Supports modern programming techniques like functional and O-O
    - The student can do real-world things in it
    - The student can experiment at home for free

    Don't forget assembly!!
    - Too many new programmers need to do something low-level, or interoperate with another language, and they have no concept how memory is arranged, what source code compiles down into, or even what a compiler does! They don't comprehend that a string isn't an intrinsic thing the CPU recognizes, and that there are hundreds of ways to store and manipulate them. So when they have to learn about memory-thrashing, multithreading, garbage-collection, optimization, etc. they are lost.

    This must be taught this very early on, not as an advanced course, so that when they learn other lagnauges and algorithms they can see where it comes from.

    1. Re:Java, then assembly language by johnnliu · · Score: 3, Insightful


      I agree highly with the point about assembly language. While I think no school should teach students to write serious programs in assembly, I'm shocked at the fellow programmers that I talk to today who have no real idea of what a 'memory overflow' really is, or why is it called a 'overflow', why not just 'insufficient memory'. They don't understand the differences between stack or heap, what is a null-pointer, and have difficulty in understanding concepts such as arguments pass-by-reference and pass-by-value (for object references).

      When they start to use Java or .NET, they can't understand what's so great about garbage collection, and when they write C++... Arrggh memory leaks galore (and/or segfaults), and then they ask - what is a segmentation fault? Why is it called a 'segfault'?

      While I had no particular love for assembly or compilers back in the university days when I 'had' to write them to graduate, looking back, they laid a foundations of understanding what exactly is going on in the machine. I'm grateful for that lecturer whose name I've forgotten in the particular choice of assignment. :)

      ---

      Anyway, I think people who want to take writing software seriously needs to know this stuff - sooner or later. It's like a carpentry artisan needs to know about wood, and not just about carving.

  20. Anything that starts with "C" by frenchs · · Score: 2, Insightful

    Let me start this post by putting on my flame-proof suit. =)

    In order of preference:
    1. C++ - but don't move into the advanced features right off the bat. I like string handling better than C though, so it gets the nod for the top slot. But the user would have to learn the compile process. Templates, STL, and OOP can all be added once you have the basics down.
    2. C - pretty much on par with C++ in the features you would want to introduce to a beginner.
    Ones I'm unsure on:
    • Pascal: I can't comment on this one, but it's supposedly well-suited for teaching.
    Ones I wouldn't touch for intro programming because of syntax.
    • Python
    • Ruby
    • Lisp

    These are all fine languages, but they all have specialized syntaxes, and the bridge between that, and their *next* language would be where you do them a disservice by using these ones.

    Other poor choices:
    • Perl
    • PHP

    Perl, which has a reasonably decent syntax, but because of the TIMTOWTDI philosophy, it's actually, IMHO, an ill-suited introductory programming language.

    PHP, while similar syntax to C/C++, has the benefit of not having to learn how to compile apps. It's ultimate downfall is it's scoping rules and lack of namespaces. This is stuff an intro programmer should learn about.

    1. Re:Anything that starts with "C" by theonetruekeebler · · Score: 4, Funny
      Java is like C++ with training wheels.

      Java is C++ without the giant rotating knives.

      Java's "music" class library appears to support every musical instrument in the symphony but on closer inspection requires you to understand metallurgy before you can instantiate a trombone, and spit valves are in the open position by default. C++'s music library on the other hand assumes that all brass insturments are, at their most fundamental level, a kazoo. You can drive it with anything from bare lips to a jet-powered compressor, but despite Stroustrup devoting eight pages to protected abstract virtual base pure virtual private kazoo destructors, never once in the 20-year standardization process did anyone notice there is no member function called play().

      --
      This is not my sandwich.
  21. Noooooo! by Xtifr · · Score: 4, Funny

    Please, it takes kids YEARS to recover from the damage that learning any flavor of BASIC does!

    "It is practically impossible to teach good programming style to students that have had prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."
                    -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5

    Things (specifically BASIC variants) have improved since Dijkstra wrote that, but an underlying fundamental truth remains.

    "Whom the gods would destroy, they first teach BASIC."
                    -- unknown

    1. Re:Noooooo! by Blakey+Rat · · Score: 2, Informative

      Have you tried RealBasic? It's not VB, it's closer to Java than any flavor of Basic from the past. In fact, I wouldn't mind at all if they changed the name... but try it before you knock it.

    2. Re:Noooooo! by Xtifr · · Score: 2, Interesting

      Yes, I have looked at RealBasic, at least briefly, and I agree it's not as bad as the language(s) that Dijkstra was complaining about (you'll note that I even said something along those lines). But if it's more like Java, then what's the point? Just teach 'em Java, and that way they'll have something that might actually be useful to them someday.

      Frankly, I think Pascal or Python or Scheme or Modula or Eiffel or Smalltalk would be a much better choice for an introduction to programming, but I certainly don't see the point in switching to an obscure language that is vaguely derived from BASIC just because it still has the string "Basic" in its name, especially since you should be moving away from anything named "Basic" as rapidly as possible.

      I'd probably recommend ADA before I recommended RealBasic, and I'm not a huge ADA fan. But it is (like RealBasic) a much better language than its reputation would suggest.

    3. Re:Noooooo! by The+Tyrant · · Score: 2, Interesting

      I could not agree more, having learned basic as a kid, in several flavors, and then moving onto vb6, I got so disgusted with the whole thing (not least that vb6 is so full of annoying bugs that anything big you want to write needs to be done entirely via api calls for such simple things as window creation and drawing of standard looking scrollbars) that I've totally regressed and am now learning assembly and am blissfully happy at the level of control and new abilities I have. One day I might learn C, but I've been scared off high level languages for good.

      How about teaching these kids some assembly? Something nice like 68k assembly, you could get a load of old 68k based systems (my vote is for Atari ST's) and teach them simple things, like how to manipulate bitmaps on screen, which leads nicely into the writing of little games, and nothing motivates kids more than games. Assembly isnt that hard really, especially on a nice big endian CISC like the 68k, and it'll give them serious insight when they come to learn C ("ah-ha, so a for loop is just a dbra!").

    4. Re:Noooooo! by indifferent+children · · Score: 2, Interesting
      I think Pascal...

      Noooo! Why would anyone teach students using Pascal instead C/C++. Does anyone think the BEGIN/END is really more straightforward than {/}? As students, they are going to have to *learn* things when they program, and curly-braces are the least of it.

      Is 'record' and clearer than 'struct'?

      If you don't want the students to have to deal with memory management, then use a garbage collection library with your C compiler. If you want to CYA, tell them that they are using a GC library. If you teach them Pascal, and don't explain that Pascal does GC, then they will be hosed when they get to a C/C++ course and don't understand why they have to manage memory.

      --
      Censorship is telling a man he can't have a steak just because a baby can't chew it. --Mark Twain
    5. Re:Noooooo! by angel'o'sphere · · Score: 4, Informative


      If you teach them Pascal, and don't explain that Pascal does GC, then they will be hosed when they get to a C/C++ course and don't understand why they have to manage memory.


      Pascal does not do GC.

      And yes, most of Pascal is cleaer than C ...

      Pascal:
      myDates: array [1..10] of Date;

      C:
      Date myDates[10];

      What is the low bound and high bound of myDate in C and in Pascal?

      How do you do an array from 99 to 104 in C? You cant ... neither you can't do 2 or more dimensional arrays in C (you have to relly on arrays of arays and manually initialize them).

      There is plenty stuff where Pascal is FAR clearer than C, its designed to be so, while C is designed to be a portable assembler.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    6. Re:Noooooo! by Nutria · · Score: 4, Insightful
      The C version is far more concise.

      I spit in the general direction of "conciseness", and it's kinsman "cleverness".

      To quote Kernighan:
      Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

      I used to be a clever programmer, but then I graduated and got a Real Job, and had to read the code written by both Clever and Grown-up programmers. Guess which code was easier to modify, debug and add functionality to. Guess which code had less bugs.

      A good (but not huge!) dose of verbosity and simplicity would go a long way towards making more robust applications.

      Another relevant quote, by Jeff Polk, co-creator of CVS:
      There's no obfuscated Perl contest because it's pointless.

      --
      "I don't know, therefore Aliens" Wafflebox1
    7. Re:Noooooo! by greenlead · · Score: 2, Interesting

      I started (at about 10 years old) playing with QBasic examples from a kids programming book. I would type them in exactly, and then modify them.

      When I was about 11, my father created a web page for me, and required me to maintain it myself. I made all changes by hand, through trial and error. No fancy GUI tools at that age!

      Rant:

      {

      that's why we have so many lousy "web designers" these days! Kids are spoiled rotten by pretty web tools from Geocities and the like that spit out horrible code, and the kids are satisfied with it, and proclaim to me "I made a web page, aren't you proud of me????". They aren't willing to receive advice either, and think that HTML is hard to learn. :-(

      }

      When I was a sophomore in HS (would've preferred starting programming as a freshman, but they made me take a computer application class as a pre-req), I learned the basics of MS's Visual Basic 6. I liked the quick results, which are essential if you want to get someone's interest long enough to actually teach them something. Most of the kids were there because the description in the course selection book basically said "Create cool programs by dragging icons onto a form". I actually helped teach this class. (By the way, it took six months of annoyed programming before I figured out that "End if" was a statement, not a condition. Nobody had bothered to explain it, they just told me I had to have it there because the compiler demanded it.)

      My junior year, I learned the basics of C++. We spent almost the entire time making basic command line programs. This was good, because I actually had to learn structure and the importance of good code and documentation, rather than making a mess because I was in a hurry. I also was forced to learn the importance of planning, rather than the dive-in method.

      Now, I am getting into PHP, which is relatively easy for me, because it is very similar to C++, and I already understand HTML. It also helps that there are lots of tutorials out there for it, and it is fun to play with.

      My case was a little different than most kids these days, because my father is a programmer, and I had been exposed to computers all of my life, and had been required to fix my own problems, with guidance from him only when I really needed it. My oldest brother was formatting floppies from the DOS command line at 5. We had all built at least one computer and did all setup (format the hard drive, figure out why DOS refused to install, etc.) on it by the age of 10.

  22. What entices high school students? by Dukhat · · Score: 3, Insightful
    I don't think anybody who is new to programming will think a programming language is cool based on the capabilities of the language or the libraries it has. The coolness factor is based on seeing some application built in it, and they want to be able to do the same thing. I doubt that there is any consensus among your students as to what a cool language is. The students may have some aversion to VB from things they have read, but all languages have critics as well as hype.

    I think you will be able to attract students to your course by focusing on what you can do in the course and not on what language you get to use. A course on "Building a Blog", "Programming a Robot", or "Building an Online Store" is much more enticing than PHP or Ruby on Rails. When you watch a home remodeling show, they don't advertise it as the show with the coolest miter saws and wrenches. The show isn't about the tools, it is about the end product, a new deck, or new cabinets in your kitchen.

    Since you are teaching new programmers, I will suggest languages and frameworks based on how easy they are to start using as opposed to how good they are in the long run.

    PHP has excellent documentation. Although its function names can be inconsistent or duplicated (e.g. sizeof, strlen, count), it is fairly easy to follow the code. This would probably be the easiest well development platform to get started on without evaluating different components, since you really don't need to bother with libraries to do MVC for a beginners course. You definitely will want to set up PHP with "xdebug" so that PHP will provide you with a stack trace for your errors. Otherwise, you will only see the line number where the error occured, which is not very useful if the line number is inside a function that gets called in a hundred different places.

    Ruby on Rails is a very large frameworks, and you are just throwing names around to suggest this for an intro course. Ruby, the language, and a basic html templating system might be easy to teach, but Rails involves the MVC pattern, object-relational mapping for database access, and an architecture for unit/functional testing. This is NOT good for beginners. The Rails tutorials will also give you a false impression of how easy it is by having you build a bunch of database driven web pages with very little code. After you finish the tutorial, you will still have a lot to learn.

    Although I think Ruby is a more powerful language for an experienced developer than PHP is, it has a lot of syntax rules to learn. For example, curly braces {} could contain a block of code or an associative array, and "joe!" means run the joe! function, and "!joe!" is a boolean NOT operator acting on the return value of joe!

    My personal favorite programming language is Python. It has a cleaner syntax than PHP or Ruby, although an amazing amount of new Python programmers are burnt by mismatched indentation between tabs and spaces. Python will treat a tab as the same indentation level as 8 spaces, but your text editor may be using a different value. Even though python tells you the line where the syntax error is, the error may be invisible in your editor. If you are interested in Python for web development, Zope involves learning too much infrastructure for beginners. You would be better off with Spyce.

    Instead of making your students build things from scratch, they may feel likethey are accomplishing more by customizing an opensource program that alreadyexists. You can find a bazillion PHP web portal projects at http://freshmeat.net./

  23. Don Box asked before. I suggested LOGO by Quantum+Jim · · Score: 2, Informative

    Don Box had a simular journal post about which language was best to teach his kids to program. I felt that LOGO was the best choice.

    When I was younger, the ability to program the robotic turtle really empowered me! The fancy shapes and colors produce amazed me, and it made me feel like I was accomplishing something. It isn't a coincidence that one of the first things I programmed in Integer BASIC (my second language) was a clone of LOGO for the IIgs (also, we couldn't afford a copy).

    I still feel that way. In fact, to learn to program you really should start with simple text-only (like command line) or path-only (like turtle maps) interface stuff. Anything else requires the ability to think in terms of metaphors that are hard for newbies to grasp. It also helps new programmers learn to program in steps (i.e. design) rather than struggle with the grammar or vocabulary (i.e. one big main function).

    --
    It is impossible to enjoy idling thoroughly unless one has plenty of work to do.
    - Jerome Klapka Jerome
  24. Python is the perfect first language for learning by Ursus+Maximus · · Score: 2, Informative

    Python is the perfect first language for learning to program. It has a fast learning curve, teaches good programming practises, introduces powerful programming principles quickly and easily, and is fun for the students, allowing them to do real things, including graphics, games, web programming etc. Ron Stephens Python Learning Foundation

  25. Making a reasonable case for PHP by danielDamage · · Score: 2, Interesting

    When I learned programming, it was painful to get past the strange things I didn't understand in C, C++ and Java's "Hello World" program.

    Header files, main(), etc. It was intimidating to me, and I am far from the most intimidated by new concepts person I can imaging.

    The reason I like PHP for a programming teaching language:

    • It uses basically the syntax that is common to C, C++, Java and Javascript. It's an introduction to curly braced code blocks, parentheses as a grouper for boolean evaluation, etc.
    • Feedback is instant. You make a change, you refresh the page.
    • It operates in a web paradigm, so it looks useful to people. I took 2 semesters of C++, and could write a shell application, but knew how far I was from being able to write a real application that would be useful to me. Being able to get a form variable in a web page and write it to a text file already feels pretty damn useful.
    • You can teach the basics of procedural programming before you start to gently introduce objects.
    • Array handling is friendly and non-threatening...you can populate and output arrays, hashes, etc very easily without worrying about too many implementation details to start with.
    • You can teach the very idea of objects in a simplified way. Instantiating them, writing a constructor, restricting access (in PHP5), simple inheritance, polymorphism...

    Lots of people are saying, TEACH THEM C! IT'S GOOD FOR THE LITTLE BLIGHTERS!

    But really, as someone who has taught a lot of programming informally, the biggest obstacle is people: a) seeing that programming is useful and b) seeing that programming is something THEY could actually DO.

    At the beginning it's SO easy to feel like it's just a whirlwind of details you'll never be able to keep straight. If you can just teach selection (if...else) and iteration (foreach) and get it to stick that problems can be solved this way, yes, even by ordinary humans, then it's really not that hard to graduate people to Java or some such.

    At that point you're just adding the concepts of namespaces, data typing, OO as a deeper part of the language....and the syntax and basic concepts are already there and familiar.

    I hear people worried about generating bad habits, but I just don't think this is the primary concern when FIRST introducing people to programming.

    --
    Slices, dices, eats your lunch.
  26. Best Language by deanj · · Score: 4, Insightful

    The best language is the one that the teacher can teach well. If the teacher can't do a good job explaining the language, it doesn't matter how good the language is for programming... there will be a lot of kids in class that will be lost.

  27. SEGA Genesis programming all the way. by Travelsonic · · Score: 2, Interesting
    Here is an interesting variant of basic you should look at (if you don't know already)

    http://devster.retrodev.com/sega/basiegaxorz/


    It's BASIC, but it compiles to work on SEGA Genesis emulators and, given the right tools, a real SEGA Genesis. Easy to do, but sure to give them a real spark of "wow, holy crap this is cool!"

    --
    If you believe in privacy, and believe you have "nothing to hide" at the same time, you're a goddammed idiot
  28. Python has a free book and pygame by edalytical · · Score: 5, Informative
    Python is definitely the way to go. There is a free book that is written especially for High School CS classes, it's called How to Think Like a Computer Scientist: Learning with Python. You can get it here: http://greenteapress.com/thinkpython/ for free in any of these electronic formats: PDF, LaTeX, Postscript, and HTML. Or you can buy printed copies here: http://greenteapress.com/thinkpython/terms.html

    In addition to that there is pygame. A set of Python modules designed for writing games. It's really simple and easy to use. I think even beginner programmers wouldn't have much trouble making simple games. I wrote a breakout clone that's only 147 lines, I was going to use it to teach a programming class too. There is nothing complicated in it at all, just a few loops, if statements, some rectangle geometry and negating numbers. Elementary, really.

    I think Python fits the requirement, more so than any other, for a language "that might be more 'enticing' as well."

    --
    Win a signed Stephen Carpenter ESP Guitar from the Deftones: http://def-tag.com/?r=0008781
  29. What is the goal? by Anm · · Score: 2, Interesting

    I'm seeing lots of good advice, but a lot of it coming without a few very simple questions. What are you wanting the students to come away with? And what are the students interested in coming away with?

    Back in high school, when I was first learning to program, I wanted some level of instant gratification. This is the basis of languages like Logo, where a core set of commands give a visual representation. But we can get similar results today in other domains.

    losman mentioned UnrealScript, which I generally like, but still has some drawbacks. First, is the cost of the handful of Unreal licenses and the hardware to run them. It also assume the developers are on Windows (at least until UT2007), which may not be true for students at home. But beyond such technical issues, are you going to handle the distractions/complications of the additional media assets? As a teacher, if you're up to the challenge, you can take advantage of this to drawn in more students and allow students to follow their own interests within the environment. Ideally, students can group around projects where they all contribute based on their interest. Lastly, can you handle the parents (or tax payers in a public school setting) who see violent video games as inherently evil.

    Web apps can offer similar instant gratification. The pitfalls here include maintaining a server that allows server side scripts and teaching HTML (and probably basic browser compatibility) along the way. Again, you need to decide whether hooking into additional media is going to be an advantage or distraction in the classroom.

    One problem both of these share is the difficulties in tracing the stack. Their unique run contexts can make it hard to debug problems, which can be as frustrating for your students as it is for you trying to help them as project dues date approach.

    That said, it is possible to bring the engagement of a game to other development platforms. A small top down arcade game can teach several core concepts, from simple data structures (lists of actors, multi-dimensional arrays of terrain, variables like position and health, event handlers from input or actor collision). Build an outside level editor and you can teach GUI development, file I/O, and string manipulation.

    If you go the GUI and graphical route of a game, Java seems like a good match. I believe it works well in classroom scenerios. At the basic level, the virtual achine it free and platform independent. Several good IDEs are available, and I believe there is work on an Eclipse plugin geared toward students. The APIs are stable, self-consistant, and well documented, although exceptionally broad and thus easy for a novice to get lost in without guidance. And if you target applets, students have a simple way to show off their work.

    I'm sure C# has basically the same benefits, but I don't know enough to comment on it. Given an MS grant for a Visual Studio lab, I wouldn't rule it out.

    Python is also an option, but I would choose wxWindows over tkinter anyday. Being a dynamically typed language, you loose the support of a context sensitive IDE, but you gain the easy access to a shell-like evaluation environment, useful for allowing students to interactively test thier code fragements (actually, integrating Beanshell into a java app is both easy and useful). I've never found a debugging environment for Python I liked, but at least they exist.

    Several other scripting languages could be mentioned here, but again I am not familar enough to comment on them.

    Other posts have mentioned C, C++, and assembly. While I think they are all critical for a complete CS education, I am not convinced they are ideal for a high school introduction course.

    However, if the target audience is more advanced, I would put C on the table before the others, especially if taught in an object oriented way to mimic modern programming practice. This is a great way to show what that C++ compiler or that Java or C# VM are doing on the metal.

    Anm

  30. "Scripting" language by DavidNWelton · · Score: 3, Insightful

    Java might be ok for some people - I think that's what AP Comp Sci classes use. However it has a few drawbacks:

    1) It doesn't "scale down" as well as languages like Python, Ruby, Tcl etc... So might not be as well suited for those who aren't as interested/motivated/quick on the uptake.

    2) It's kind of dubious, IMO, to be promoting a product of one company.

    In any case, that would leave us with the scripting languages, which I think are all worth considering for different reasons, and all have in common a faster, easier development cycle with no need to recompile each time.

    Python: clear, easy to read, and very general purpose. Good introduction to OO without beating you over the head with it or forcing you to adapt to it from day 1.

    Tcl: because of the interesting introspection that it has and uses for certain common programming tasks, I'm not sure it's the best to start with, but on the other hand, being able to create something *visible* on the screen with a few lines of code is pretty gratifying, especially for a beginner. (Python has Tkinter which is pretty good too, but slightly more complex to start with than regular old Tk).

    Ruby also seems like a good, reasonably generic language - I don't know it as well, but from a casual glance, don't like the (willful) resemblance to Perl in terms of the syntax. But I think you could do a lot worse - you'd certainly have some advanced concepts available to teach with it.

    If you teach them PHP, you're going to be teaching them web programming, basically. I'd stick to a more general purpose language (you can use PHP for general purpose tasks, but it's still really oriented towards the web).

    On the other hand, if you've got bright kids and are willing to explore something interesting, you might try languages like Smalltalk or Scheme, that introduce some really interesting ideas.

  31. What a load of rubbish by crucini · · Score: 4, Interesting

    The idea that learning something can "mutilate" you or decrease your ability to learn other things is crap. I, and most of the good programmers I know personally, learned on BASIC - evil old unrepentant BASIC, full of GOTO and GOSUB. Maybe Dijkstra had trouble teaching "good programming style" to students with a BASIC background because they had experience, and weren't automatically willing to accept someone else's definition of "good". Or maybe he was just kidding.

    BASIC was grungy, useful, widely available, and offered a fast edit-run loop - key ingredients in getting a lot of kids hooked on computers.

    1. Re:What a load of rubbish by crucini · · Score: 2

      I'll tell you why it's a hot button for me. I tend to learn concretes first, concepts later. When I was 12, BASIC completely hooked me on programming. I was like the rat with a button wired to the pleasure center, and would have died of dehydration in front of a TRS-80 if not forcibly removed. Much like a talented kid banging on a drum kit, I was in love with the feedback loop, with the immediacy of the machine. In time, the love and deep awareness of computers that BASIC implanted led me through many platforms and languages.

      I'm grateful that nobody tried to teach me about computers back then. I was not very receptive to adult authority at that age. I hear suggestions now to start kids with smalltalk, C++, java, whatever. I'm sure these things would not have interested me at 12. You have to write a lot of BASIC and/or assembler before you understand the point of C. You have to write a lot of C before you understand the point of C++. Those who are spoon-fed C++ at an early age must have an awfully hollow understanding.

      I am immensely grateful to those who created the early personal computers and BASIC interpreters. It's notable that the computer science establishment did not contribute much to this effort. While they were pottering around in their ivory towers, Prometheuses like (gasp) Bill Gates and Paul Allen were bringing the micro to the masses. When the privileged folks, who had access to good technology before everyone else, criticize the democratizers of technology, it irritates me. Remember how UNIX folks bitched about Linux when it was young?

      This comment has gone long enough, and hardly scratched the surface. I'll just say I was very lucky to grow up when I did - I don't think the aspect of computing that young people see today would have interested me at all.

  32. Re:What is "dubious" about it? by fcgreg · · Score: 2, Informative
    Java is not an open spec. It is owned and controlled entirely by Sun.

    Please, please. How many times does this have to be rehashed here on Slashdot and the Internet in general, especially when good, detailed information is so easily accessible? The Java "language" is an open specification. How do you think GCJ and other projects are able to do their work? Sun's JRE source code is quite a different story, for example, but that's not what I was referring to.



    They accept feedback from other members of the JCP, but all the decisions are made by Sun.

    This is incorrect, actually. The final "decisions" are made by the applicable Expert Group for the submitted JSR, which is made up of industry "experts" from many different companies, possibly including Sun, but often not. For a nice breakdown of the entire process, please see here:

    http://www.javaworld.com/javaworld/jw-10-1999/jw-1 0-jcp.html

    Hope that helps.

    --
    Greg T.
  33. depends what you want to teach them... by orabidoo · · Score: 2, Informative
    If you want to teach them Computer Science and the deeper concepts of programming, then give them Lisp and/or some form of ML.

    If you want them to have a clue how computers actually work, show them assembler and/or C.

    If you want them to learn the "my data is mine i can easily do what i want with it" attitude, teach them Python, Perl, Ruby or PHP.

    If you want them to get "standard" jobs in the industry, teach them Java or C#, with some C++.

    In no case would I first show them any form of Basic. Kind of brain-damaging as a first language.

    My personal take would be to give them two different classes corresponding to the first two items in my list: ML/Lisp and assembly/C. Make a solid grab at the two extremes and they can always figure out the 'middle' stuff on their own, which is comparatively easier.

  34. Re:Scheme by Intron · · Score: 2, Insightful

    "The can learn some really interesting concepts."

    Like how to count parens? I spent a lot of time doing:

    1 2 3 3 3 3 2 2 3 4 4 3 3 3 2 1

    --
    Intron: the portion of DNA which expresses nothing useful.
  35. Re:Functional? by IpalindromeI · · Score: 2, Insightful

    I would contend that it's much easier to move from functional to procedural than the other way. Witness the teeming masses of procedural programmers that end up saying, "Well I tried looking into some of that functional stuff because it sounded interesting, but it's just too weird. I can't get my head around it." I know some very bright programmers who have a lot of difficulty with the functional style because they're so used to procedural.

    In contrast, I think anyone could pick up procedural programming if they had already learned a different type. It's basically just typing out instructions for the computer to perform. And I'm not a functional programmer trying to disparage the procedural method. I've been programming in C++ and Perl for years and only recently started feeling comfortable with Haskell.

    I think the biggest disadvantage to teaching functional first is that functional languages usually have more features to offer than procedural languages, so it can be a bit frustrating sometimes moving in that direction.

    --

    --
    Promoting critical thinking since 1994.
  36. Integrate with other parts of the curriculum by 2901 · · Score: 2, Interesting

    For example you might want the programming course and the calculus course to be mutually supporting.

    The rules for differentiation could be coded up in
    the programming language. For Common Lisp it might
    look like

    (defparameter plus '+)
    (defparameter times '*)
    (defun differentiate (form variable)
        (typecase form
              (number 0)
              (symbol (if (eql form variable) 1 0))
              (list (case (first form)
                  (+ (list plus
                       (differentiate (second form) variable)
                       (differentiate (third form) variable)))
                  (* (list plus
                       (list times
                         (differentiate (second form) variable)
                         (third form))
                       (list times
                         (second form)
                         (differentiate (third form) variable))))))))

    (differentiate '(* x x) 'x) => (+ (* 1 X) (* X 1))

    But why are those the rules, rather than some other rules? Well it is supposed to agree with
    the numerical version

    (defun numerically (function argument difference)
        (let ((left (funcall function (- argument difference)))
          (right (funcall function (+ argument difference))))
          (/ (- right left)
         (* 2 difference))))
    (defun square (x)(* x x))
    (numerically (function square) 7 0.001) => 13.998031

    And indeed

    (defvar x 7)
    (eval (differentiate '(* x x) 'x)) => 14

    Notice the wider vision: students are taught a programming language to give them a language in which to talk about procedures, including procedures that they are expected to master in other parts of the curriculum.

  37. Re:Python Isn't Elegant by Omnifarious · · Score: 2, Interesting

    I base my opinion of Python on this...

    When I look at a Python program, it seems pretty obvious what it does. There are very few special-case syntax elements. The program is clear and to the point. When I have examined Ruby programs, it was not nearly so immediately clear how they worked. There seem to be a number of special case syntaxes related to lists, strings and blocks of code used as arguments that render Ruby code much less readable.

    Perhaps it is my ignorance of the language. Or maybe Python is closer to other languages I'm used to. But, I was able to pick up and understand a Python program when I was first learning Python much more quickly than I was able to pick up and understand a Ruby program.

    That is why I hesitate to recommend Ruby as a beginner's language.

  38. Syntactic whitespace by Anonymous+Brave+Guy · · Score: 4, Insightful
    YMMV, but for me, having whitespace be syntactically significant is just BAD!

    That was my initial reaction when I first met Python: sacrilege!

    In many other block-structured languages it's customary to indent but the {} or begin...end markers are the syntactically significant things. Unfortunately, when humans read the code, it's actually the indentation they use to parse the logic most of the time, as many a new C student has learned via the standard deviously indented if...if...else demonstration.

    On reflection, that means having the indentation not be significant, yet using other markers that are, is a bit like putting a banner comment at the top of every function with the function name in it: it's fine if you copy it in properly, but it doesn't really help, and it's a maintenance hazard that can actually harm readability if it's changed incorrectly.

    Punctuation in a programming langauge is good, exactly up to the point that it stops increasing readability and/or reducing errors. After that, it's just clutter. So IMHO the question is whether (from some objective, analytical point of view) ignoring whitespace and introducing {} or begin...end markers improves readability or reduces bug count for programmers using the language. I suspect the answer really is a matter of taste: for some programmers it will, and for some it won't.

    This is why not everyone agrees on whether syntactic whitespace is a good or a bad thing. There just isn't a single, universal right answer to the question.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  39. Multiple Tiers for Teaching Programming... by trims · · Score: 2, Informative

    I've noticed everyone here is recommending their favorite language, without mentioning why it might be useful for beginning programming. I'd like to address that issue:

    In Beginning Programming, you're assuming that the student know absolutely nothing about programming. They should know Algebra (to understand variables), but that's about the extent of Math.

    Thus, probably the Right Thing to do is build on the basic Math understanding that your students have, and start to introduce programming concepts from there.

    For that reason, I'd start with a Functional Programming language as they tend to be rather obviously Math-derived, and help ease the introduction of programming constructs. I would recommend Scheme, since it is associated with one of the best "Teaching Programming" texts ever, Structure and Interpretation of Computer Programs.

    After they've grasped Functional Programming, I'd have them move on to Procedural Programming, starting in Pascal or Modula-2. These two are excellent languages which illustrate the fundamentals of procedural programming, without some of the nastier pitfalls. There are also excellent textbooks available for Pascal (fewer for Modula-2). Later, I'd move them to C to introduce pointers and some of the other hairier features.

    Finally, they're ready for Object Oriented Programming, for which I'd use Java - it's widely used, very common for college-level coursework, and there are a large number of supporting utilties and good textbooks useful for teaching aids.

    Overall, I'd look at teaching Functional in 1 semester, Procedural in 1 or 2 semesters (depending on the detail and breadth you want), and OO in 1 or 2 semesters.

    In all honestly, I love scripting languages like Perl, Python, and Ruby. However, as a teaching tool, they're all too multi-purpose, and it's easy for the student to do something they're not supposed to do (even though it works). For teaching languages, you want ones which pretty much only allow the student to program in the methodology you're teaching. That is, you generally want those languages which are LESS flexible, since your main goal is correctness, not functionality.

    -Erik

    --
    There are always four sides to every story: your side, their side, the truth, and what really happened.
  40. Guido von Robot might be worth a look. by whatteaux · · Score: 2, Informative

    Specifically designed for teaching programming. Although it's not a 'real' programming language as such, it might be well worth exploring.

    http://gvr.sourceforge.net/

    Or PL/I, of course. :-)

  41. Scheme or Python by NNland · · Score: 2, Informative

    If you want them to be able to adapt to any other language available, teach them Scheme.

    If you want them to be able to program in their first day, teach them Python.

    My question is, "What do you want them to do with the knowledge they gain in your course?" If this is to be an introductory course to progamming and/or computer science, it makes sense for it to be both enjoyable and educational. Start them out with Python and get them into PyGame, they'll be tickled to be writing games in their first course. If/when they want to get into writing web applications, send them off to Cheetah or some other templating language for Python. If/when they want to write GUI applications, send them off to wxPython.

    Of course this all fails when they get to college and they are forced to learn Java (C/C++ was so much better to learn), but by the time that rolls around, we hope they have matured enough to understand that learning multiple programming languages is actually good for them.

  42. Brainfuck is what they need by Sad+Loser · · Score: 2, Insightful


    I think that introducing the beginner to Brainfuck is highly likely to mutilate them (or at least induce them to self-mutilate).

    On a more serious note, I think that to most (non geek) people, computer = Interweb so a programming language that has the ability to output html is preferable. This would mean that they can show off their work to friends, which has a powerful re-inforcing effect in itself.

    Although I like PHP, it sounds like Python has the edge in that it is more flexible in this regard

    --
    Humorous signatures are over-rated.
  43. My answer is: it doesn't matter that much by retrovince · · Score: 2, Informative

    A concrete grasp of classic logical operations is far and away more important for any programmer, especially beginners. I find that most people I interview for programming work fall into one of two categories: those that can understand binary math and those that don't. IMHO, Java-centric trained folks including those with advanced computer science and engineering degrees by and large have difficulty implementing any bit-level analysis and manipulation. While high-level language proponents argue that this level of programming is unecessary for most applications, the inherent computing overhead introduced by increased abstraction often requires programmers to think about making their apps work on real equipment in the real world. Languages are flavor-of-the-month. Students will study and master any language if it gets them employed. A solid grounding in logic is language-agnostic and actually builds better programmers.

  44. Re:Well.. by JamesOfTheDesert · · Score: 2, Informative
    Ruby is a programming language. Easy to learn, but very powerful, combining features from Smalltalk and Lisp (among others) but with a more friendly (i.e., C-like and file-based) syntax.

    Rails is a Web-site framework built using Ruby, much as Struts is a framework/tool-kit built using Java.

    Ruby makes for an outstanding first language. Learning to use Rails (or Nitro or Wee) could serve as a "next step" course for developing Web applications while examing Ruby's meta-programming facilities.

    --

    Java is the blue pill
    Choose the red pill