Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Education Programming Technology

Best Language for Beginner Programmers? 448

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?"
This discussion has been archived. No new comments can be posted.

Best Language for Beginner Programmers?

Comments Filter:
  • Re:Java? (Score:5, Informative)

    by jd ( 1658 ) <imipak@yahoGINSBERGo.com minus poet> on Thursday August 11, 2005 @07:58PM (#13299486) Homepage Journal
    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.)

  • by rebug ( 520669 ) on Thursday August 11, 2005 @08:01PM (#13299507)
    It was designed as an introduction to structured programming.

    Python wasn't designed as an educational language. Guido explains [python.org] its origins in the FAQ.
  • DrScheme (Score:5, Informative)

    by sleepingsquirrel ( 587025 ) <{Greg.Buchholz} ... ingsquirrel.org}> on Thursday August 11, 2005 @08:05PM (#13299531) Homepage Journal
    Give DrScheme [drscheme.org] a look. Nice graphical IDE, libraries, dead simple syntax. Free. Different language levels to cater to the learning process. And pleanty of introductory texts [schemers.org].
  • Java & Eclipse (Score:4, Informative)

    by curious.corn ( 167387 ) on Thursday August 11, 2005 @08:05PM (#13299534)
    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.
  • Re:Python (Score:4, Informative)

    by TeknoHog ( 164938 ) on Thursday August 11, 2005 @08:06PM (#13299543) Homepage Journal
    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.
  • Re:consider Python (Score:5, Informative)

    by croddy ( 659025 ) on Thursday August 11, 2005 @08:09PM (#13299558)
    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.

  • May I suggest.... (Score:4, Informative)

    by Seraphim_72 ( 622457 ) on Thursday August 11, 2005 @08:40PM (#13299735)

    That you find a book first. In fact - find Head First Java" [oreilly.com] IMHO the best book to teach teens about programming. Next arm yourself with a woman of renown to teach object orientation, namely Alice [alice.org], 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 [ibm.com] and the winner of the Grand Prix gets extra points towards that grade!!

    Sera

  • Re:consider Python (Score:3, Informative)

    by deeny ( 10239 ) on Thursday August 11, 2005 @08:45PM (#13299760) Homepage
    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.
  • Re:Noooooo! (Score:3, Informative)

    by Blakey Rat ( 99501 ) on Thursday August 11, 2005 @09:15PM (#13299931)
    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.
  • by Quantum Jim ( 610382 ) <jfcst24@@@yahoo...com> on Thursday August 11, 2005 @09:21PM (#13299958) Homepage Journal

    Don Box [wikipedia.org] had a simular journal post about which language was best to teach his kids to program [pluralsight.com]. I felt that LOGO [wikipedia.org] 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 [wikipedia.org] (my second language) was a clone of LOGO for the IIgs [wikipedia.org] (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).

  • by Ursus Maximus ( 540370 ) on Thursday August 11, 2005 @09:29PM (#13300003) Homepage
    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 [awaretek.com]
  • by edalytical ( 671270 ) on Thursday August 11, 2005 @11:06PM (#13300474)
    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/ [greenteapress.com] 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 [greenteapress.com]

    In addition to that there is pygame [pygame.org]. 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."

  • by Anonymous Coward on Thursday August 11, 2005 @11:34PM (#13300664)
    php is a higher-level language than C. As a comp-sci instructor, you should know that. And VB teaches even worse habits than php.
  • Re:consider Python (Score:2, Informative)

    by Gryll ( 23531 ) * on Thursday August 11, 2005 @11:50PM (#13300749)
    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.
  • by fcgreg ( 670777 ) on Friday August 12, 2005 @04:47AM (#13301982)
    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 [javaworld.com]

    Hope that helps.

  • Re:Why not C? (Score:2, Informative)

    by 91degrees ( 207121 ) on Friday August 12, 2005 @07:13AM (#13302373) Journal
    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.
  • by orabidoo ( 9806 ) on Friday August 12, 2005 @08:38AM (#13302758) Homepage
    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.

  • Re:Functional? (Score:1, Informative)

    by Anonymous Coward on Friday August 12, 2005 @10:26AM (#13303657)
    I'd disagree. If you start with C++ you spend your time learning syntax not programming, or computer science. Scheme has a very minimal syntax, and so you can start learning about computation, not where to place the "}", ";", ",", etc. If you want to "get the idea of compiling in there" thats fine. A program written in DrScheme can be interpreted, compiled to byte code, or compiled to an executable. Scheme also supports variouse programming methodologies. If you wan't to learn OO you can there are OO libraries available (The DrScheme GUI is written using classes, methods, all that fun OO stuff). If you want to do functional that's fine to. If you want to do procedures Scheme supports that also. I agree that Scheme is "fundamentally different from most of the big languages out there" that isn't a bad thing. The teach scheme project (http://www.teach-scheme.org/ [teach-scheme.org]) has been using Scheme to teach programming in high school for years, they've found that students that spend 1/2 a year learning Scheme followed by 1/2 a year learning C++, end up being better C++ programmers than those that do a full year of C++! The theory is that they learn how to program first then how to program in C++ (the syntax) is easier. As a side note they also use Scheme to teach algebra, as Scheme is very close to executable math.

  • Re:Noooooo! (Score:5, Informative)

    by angel'o'sphere ( 80593 ) <angelo,schneider&oomentor,de> on Friday August 12, 2005 @01:54PM (#13305544) Journal

    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
  • Re:Scheme (Score:1, Informative)

    by Anonymous Coward on Friday August 12, 2005 @02:58PM (#13306177)
    Stop using Notepad or a whiteboard as if it were a programming editor, dim wit.

    C has almost as many parentheses as Lisp does, if you count curly braces; and typically more punctuation if you include commas and semicolons.

    Emacs and vi can both match parentheses automatically, and Emacs can automatically indent Lisp code so that you can visually discern mismatched parenthesis by glancing at indendation. (vi may do the same, but I don't use it.)
  • by trims ( 10010 ) on Saturday August 13, 2005 @03:15AM (#13310163) Homepage

    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 [wikipedia.org] 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 [mit.edu].

    After they've grasped Functional Programming, I'd have them move on to Procedural Programming [wikipedia.org], 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 [wikipedia.org], 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

  • by whatteaux ( 112343 ) on Saturday August 13, 2005 @05:27AM (#13310428)
    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/ [sourceforge.net]

    Or PL/I, of course. :-)
  • Scheme or Python (Score:2, Informative)

    by NNland ( 110498 ) on Saturday August 13, 2005 @05:40AM (#13310454) Homepage
    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.
  • by retrovince ( 613971 ) on Sunday August 14, 2005 @12:19AM (#13314468)
    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.
  • Re:Well.. (Score:3, Informative)

    by JamesOfTheDesert ( 188356 ) on Tuesday August 16, 2005 @10:40AM (#13330165) Journal
    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.

The hardest part of climbing the ladder of success is getting through the crowd at the bottom.

Working...