×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Best Language for Beginner Programmers?

Cliff posted more than 8 years ago | from the what-do-you-start-them-off-with dept.

Education 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?"

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

448 comments

RealBasic (2, Insightful)

Blakey Rat (99501) | more than 8 years ago | (#13299373)

You could try them out on RealBasic: http://www.realbasic.com/ [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.

Noooooo! (4, Funny)

Xtifr (1323) | more than 8 years ago | (#13299904)

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

Re:Noooooo! (2, Informative)

Blakey Rat (99501) | more than 8 years ago | (#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.

Re:Noooooo! (2, Interesting)

Xtifr (1323) | more than 8 years ago | (#13300051)

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.

Re:Noooooo! (1)

syynnapse (781681) | more than 8 years ago | (#13300180)

hey! i learned QBASIC before any other language and im a great... pretty good... ok, average.. alright, you win.

seriously though, ive heard the damage is only done by heavy use of GOTOs - which im afraid i did a lot of back when i was nine and learning from my mom. however, the desire to use GOTO faded fast when i learned how nice functions were. however, im still in school so maybe i dont know just how much damage BASIC did to me. ;)

Java? (3, Insightful)

m0rph3us0 (549631) | more than 8 years ago | (#13299382)

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

Re:Java? (4, Informative)

jd (1658) | more than 8 years ago | (#13299486)

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.)

Re:Java? (1)

TykeClone (668449) | more than 8 years ago | (#13299503)

(In fact, either extreme is a mental health hazard to all programmers and should be banned under EPA guidelines.)

Don't you mean OSHA guidelines :)

Re:Java? (1)

drakethegreat (832715) | more than 8 years ago | (#13299660)

I would go with java. Its easier then C/C++ for beginners in high school yet its powerful. It teaches a lot better skills then PHP in how to properly structure code. Its incredibly portable too so if they have a Mac or a PC they can use it. Of course you can do pretty much anything in Java that you can with Visual Basic or C.

Well.. (1)

El_Servas (672868) | more than 8 years ago | (#13299384)

Ruby on Rails is not exactly just a programming languaje, but a language and a framework...

Kinda like .NET is to VB or C# right? RIGHT?!

I sense a war regarding this topic... (The article, I mean)

consider Python (4, Insightful)

Tumbleweed (3706) | more than 8 years ago | (#13299394)

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.

no, you're not remembering correctly (0)

Anonymous Coward | more than 8 years ago | (#13299451)


whyfor there is Python.

You might be thinking of Pascal, which was designed as an introduction to structured programming.

Spot on about Python being an extremely solid choice, though.

Re:consider Python (0)

Anonymous Coward | more than 8 years ago | (#13299470)

Pascal came out of a language designed for teaching too.....

Pascal WAS a language designed for teaching (4, Informative)

rebug (520669) | more than 8 years ago | (#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.

Re:Pascal WAS a language designed for teaching (5, Insightful)

fireweaver (182346) | more than 8 years ago | (#13299794)

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.

Re:consider Python (5, Informative)

croddy (659025) | more than 8 years ago | (#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.

Re:consider Python (2, Informative)

deeny (10239) | more than 8 years ago | (#13299760)

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:consider Python (2, Insightful)

Incongruity (70416) | more than 8 years ago | (#13299948)

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...

Re:consider Python (4, Insightful)

sgant (178166) | more than 8 years ago | (#13300101)

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.

Teach programming, not the language. (4, Insightful)

DaoudaW (533025) | more than 8 years ago | (#13299401)

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.

Re:Teach programming, not the language. (1)

phallstrom (69697) | more than 8 years ago | (#13299551)

To add on to this... pick a language that doesn't require learning some new GUI/framework/etc. Pick something that can easily read/write to a simple console.

Re:Teach programming, not the language. (2, Funny)

BrokenHalo (565198) | more than 8 years ago | (#13300118)

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.

My answer (5, Insightful)

Omnifarious (11933) | more than 8 years ago | (#13299409)

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.

Re:My answer (4, Interesting)

failrate (583914) | more than 8 years ago | (#13299437)

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.

Don't discount VB and C#... (1)

Saeed al-Sahaf (665390) | more than 8 years ago | (#13299919)

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.

Well, that all depends on what environment the person intends on working in. I know most here would rather die than work in a Windows centered environment, but you know? They exist in large numbers, not everyone is "down" on Windows, and in that case, Windows centered languages such as VB, C#, and maybe C++ (down the line, maybe) is the direction to go. As far as PHP, I like it, any language offers opportunities for crappy code, and that's as far as I'm going.

Re:My answer (2, Insightful)

Pheersome (116234) | more than 8 years ago | (#13300007)

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!

What about XUL and Javascript? (1)

labal (804733) | more than 8 years ago | (#13299414)

I find that to be pretty easy, and fun to do as well, especially when writing simpl extensions for Firefox, etc. Not only that, but Javascript is very useful for use with webpages as well.

Re:What about XUL and Javascript? (1)

Anonymous Coward | more than 8 years ago | (#13299430)

"What about XUL and Javascript? "

I'd recommend against Javascript for the sole reason that sometimes it's not as easy to debug as languages that utilize a compiler or an IDE.

If they DO go the Javascript route, learn to use the "javascript:" output window that Firefox provides, as their error output is far more useful than Internet Explorer's.

Python (5, Insightful)

MBCook (132727) | more than 8 years ago | (#13299445)

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.

Re:Python (3, Informative)

TeknoHog (164938) | more than 8 years ago | (#13299543)

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.

Would you like to play a game? (5, Insightful)

losman (840619) | more than 8 years ago | (#13299449)

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.

Re:Would you like to play a game? (1)

Dukhat (198764) | more than 8 years ago | (#13299999)

Editing Unreal Tournament would attract many boys to the class, but I think it would bore most girls and guys who aren't gamers. Just because you enjoy to play on a computer, it doesn't mean you will enjoy to build something. I think the students who sign up for an Unreal Tournament Programming Class would primarily be interested in the "user testing" portion, and they would get frustrated with how much programming is not gaming.

Re:Would you like to play a game? (1)

losman (840619) | more than 8 years ago | (#13300067)

I agree completely. But, and there always is a but, what would be different with any other language???

With regards to gender; a creative teacher would understand that different people have different interests. That is why there is not one role in software development. You have testers, programmers, builders, integrators, scripters, configurators, design and graphics, audio & visual and a whole host of other roles.

Now imagine that very smart and inventive teacher structuring the class so different people work on different aspects and then come together to deliver one product. So people could be responsible for heads down coding and logic. More graphically oriented people could work on meshes and stuff. Audio and musically inclined students could work on tracks. Map, planning and layout people could design the levels. Hmmm... That sound strangely like a development team which is important to learn.

So back to my question about any other language, at least with this the teacher is ahead of the game because they already have something the kids could connect with. Would it be easy? No. But it would good.

I'd recommend web development. (1)

vertinox (846076) | more than 8 years ago | (#13299450)

Although, lord knows we don't need any more web developers, but...

If they kids have access to notepad and some type of free webhosting then they can always work on a web page regardless of having to have a compiler. Once they understand how syntax works (like closing your tags!) then they can move up to more complicated programs that make you hunt down errors after you compile.

Although some people would debate getting the inner workings down pat first is more important (like hello world programs in C), I'd debate that web page development brings instant gratification to the person making the page fairly quickly and from there you can expand on advanced topics such as Java and PHP programming.

The kids that are more visual oriented will drift towards the more graphic parts of the web development like Flash while those who find themselves interesting in the gut coding towards C++.

And maybe you can teach them Photoshop skills and how to not make a fugly web page while you are at it...

Re:I'd recommend web development. (1)

thephotoman (791574) | more than 8 years ago | (#13299522)

Well, give them photography skills. Learn Photoshop and all you know is Photoshop. Learn Photography and Paint Shop Pro and The GIMP come easy as well.

But that's beside the point. Knowing markup is also a good idea. As long as you teach them XML, they'll be able to figure things out. But the question was about actual programming and which language you should teach first, not about markup and web developing.

python! (2, Interesting)

EngMedic (604629) | more than 8 years ago | (#13299457)

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.

The envelope, please? (1, Insightful)

thephotoman (791574) | more than 8 years ago | (#13299458)

Go with Python. It's quick, easy, and clean. It encourages decent syntax, and is portable to anything. Furthermore, as it's interpreted, you get the instant gratification of being able to run the program once you've saved it and set the permissions--no waiting on a compiler. Also, studens can take their work home with them, as it's portable and free both as in freedom and as in beer.

Also, the GUI bindings aren't that hard to use and most are equally portable.

What about using X-code? (1)

jessecurry (820286) | more than 8 years ago | (#13299463)

It might actually be good to start the students on the path to learning Cocoa. With X-code and interface builder a large number of fairly powerful applications can be constructed with very minimal coding, but the students will have the option to code 'till their heart's content.
Interface builder would allow students to even go as far as building a fully functional web browser without having to touch any code, and since it is free you wouldn't have to invest much into your startup.
I suppose that the only drawback would be that the student's applications would run only on Mac, but the last time I visited a high school there were plenty of Macs available to work on.

Think about audience. (1)

nes11 (767888) | more than 8 years ago | (#13299467)

Think about your audience. A few of these kids will really want to learn programming, but most are just wanting something cool that shows quick results. I think PHP would be a great idea. It's quick, easy, & a very forgiving language. Plus they get to develop programs that will have real-life value that they can continue to modify & use after the assignment is turned in.

Sure you could try something like Pascal that better teaches programming, but that's just going to make your enrollment decline more quickly.

Scheme (1)

Knetzar (698216) | more than 8 years ago | (#13299523)

If the kids don't know anything about programming, and are interested in math, Scheme (or Lisp) might be the best language to teach them. The can learn some really interesting concepts.

But, that's probably too academic, in which case I recommend Jython. It'll be really useful as a scripting language, and will allow you to have a follow up course on Java in which you slowly replace a large Jython program with Java code and then extend it even farther.

Re:Scheme (1)

Mr2cents (323101) | more than 8 years ago | (#13299771)

Scheme is a great progamming language to start with. At least try an interpreted language first, you can explore while interacting directly with the interpreter, it's more fun.

And there are video lectures about scheme available online for free at the MIT. Very interesting, and made by the creators of the language (Abelson and Sussman).

(Please don't start downloading them all at once, those are huge files).
http://www.swiss.ai.mit.edu/classes/6.001/abelson- sussman-lectures/ [mit.edu]

Re:Scheme (1)

Piquan (49943) | more than 8 years ago | (#13300100)

(Please don't start downloading them all at once, those are huge files).

A quick google found a torrent [www.sik.fi] of the DivX versions. 9GB total. There's currently 2 seeds and 3 peers. The files are under the Creative Commons licence.

dont flame me (0)

cwraig (861625) | more than 8 years ago | (#13299527)

i know it doesnt sound like a good idea but i began on Qbasic.

it provided a very basic introduction to loops, variables, randoms and triggers.

i know its not particularly practical but for starting with its the pick for me.

For a second lets consider whats most important in your first programming exercise. can you make the language say "hello world"

Java (4, Insightful)

OAB_X (818333) | more than 8 years ago | (#13299529)

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

Java & Eclipse (3, Informative)

curious.corn (167387) | more than 8 years ago | (#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.

Pascal (1)

jb.hl.com (782137) | more than 8 years ago | (#13299550)

I learned programming using Borland's Turbo Pascal (yes, Windows, not free as in speech (ZOMG)) and it certainly helped me learn some programming basics. I've moved on to learning C++ now and the Pascal background made it much easier.

GM (1)

Daxster (854610) | more than 8 years ago | (#13299555)

My first 'real' language I learned was C++, but what led me to it was GameMaker (www.gamemaker.nl). It's a program designed to make games, but once learned you can create really quick apps (much like VB's RAD principle). GM is OOP-based, teaches a lot of things like GUI creation and making the back-end, and leads well into higher languages. It follows C-style syntax, but it lacks power, compilation speed, and flexibility..thus people will want to progress to different and better languages :)
It's meant to be an easy game creation tool, and it does its job well.

Why not C? (4, Insightful)

dasunt (249686) | more than 8 years ago | (#13299580)

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.

Re:Why not C? (1)

MerlynEmrys67 (583469) | more than 8 years ago | (#13299638)

Time to pull out the BS detector and examine
and for certain tasks, its the only choice
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.. Now I would like you to list the things you CAN'T do in C, or are immensely difficult in C, but are quite easy in other languages (parsing anyone, memory management, Stack Frame manipulation, raw manipulation of registers - and no _asm bx, 12 doesn't count)

That said - yes you can not get a driver checked into the mainline Linux kernel in anything but C -- but somehow I don't think that is your target audience

Re:Why not C? (2, Insightful)

dasunt (249686) | more than 8 years ago | (#13299854)

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.

Re:Why not C? (5, Insightful)

Better Than Bacon (828025) | more than 8 years ago | (#13299952)

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 :~)

Re:Why not C? (1)

FireFlie (850716) | more than 8 years ago | (#13300018)

I would have to agree. Python's syntax (although very intuitive for most of us) may not be the best choice for beginners. Java can be problematic becase of how pickey it can be concerning syntax (in my opinion, don't flame me over this).

C certainly can do anything that would need to be done (although I would imagine on a high school level you wouldn't need to do much with it). Sure it let's you shoot yourself in the foot, but I do believe that it is fairly easy for a beginner to understand.

When you say beginner, however, I would like to know how far you would teach? Classes? Linking multiple object files? Headers? Depending on how simple you are looking for I would also suggest perl. Perl can be an extremely handy language, and it is one of the easiest languages to learn that I have ever dealt with.

It is probably good to leave VB. When you want to teach someone how to program, teach them stuff on the command line, to get the feel for programming. dealing with GUI stuff just wastes time for a beginner.

Re:Why not C? (1)

shaitand (626655) | more than 8 years ago | (#13300126)

I have to second perl. There are a large number of different programming tasks out there, and for each task there is one or two languages that excel; but the tasks that perl excels at are the ones you need a tool to accomplish 90% of the time.

Re:Why not C? (1)

BillyBlaze (746775) | more than 8 years ago | (#13300119)

I agree with C, for two big reasons. One, it's one of a few languages that it's possible to fully master. It's just not that complex. C++ introduces tons of special cases in its type system, and it hides more behind the curtains. Java simplifies this, but hides still more. Which is the second reason - C is much closer to the machine. As soon as you learn a bit of C, you should be familiarized with assembly language, the stack, etc., just so you get an idea of what's actually going on. Only then do you bother with object oriented programming and all the rest.

Some might argue that being "close to the metal" is not a benefit, but I think it depends on what you want to do. If you're just trying to make one project, to hack together code once, hopefully working (not that there's anything wrong with this), then use a language that will let you do that. But if you want to make a career of programming, you're going to need to understand many languages, why they are designed how they are, and how to use them efficiently. This requires a good knowledge of what's actually happening underneath the hood, and so you may as well start with C. Plus, C syntax is the gold standard to which all other languages aspire.

Once somebody wanted to learn about programming, and I lent him the K&R C book. I never got back. So screw it, teach them PHP or something.

Re:Why not C? (2, Insightful)

slubberdegullion (544119) | more than 8 years ago | (#13300182)

Seconded.

The great thing about knowing C is that most other languages can be understood in terms of C - after all, a lot of compilers have been written in C. So when the kids learn perl-style pattern matching, they can think about how they'd implement it in C, and they'll have some idea of how it might work, what might be efficient/inefficient, etc.

If you teach a language like Java, on the other hand, students will be more likely to view stuff like lists as "magic structures" with certain strengths and weaknesses which must be memorized. This is OK if the goal is to make something that works, but not if the goal is to understand.

TurboPascal was great.. (1)

SocialEngineer (673690) | more than 8 years ago | (#13299583)

I did my programming in HS with TurboPascal, in a "Computer Math" class.

It was just me and a few honor-role students (lets just say I got bored easily, so I sluffed off.. I have no problems being a B student). None of them really had any aptitude for programming, but the language itself worked well for them because of the syntax. We wrote simple games, stuff to do our math homework and difficult calculations, and the like. I ended up writing a printing program for printing out our source code.

Great part about Pascal in general is that it is a great precursor to C, or C++.

However, if you are going to insist on them having a language that they'll be able to use in a professional (or semi-professional) environment, you've got another vote for Python here. Perl is also good, but it'll be more difficult to learn.

python is a good beginning (5, Interesting)

swf (129638) | more than 8 years ago | (#13299587)

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.

Perl. (4, Funny)

Pacifix (465793) | more than 8 years ago | (#13299590)

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

Ruby or Scheme perhaps (2, Interesting)

Anonymous Coward | more than 8 years ago | (#13299610)

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.

C# or Java (1)

Ratbert42 (452340) | more than 8 years ago | (#13299696)

I'd need a really good argument to not use Java. A decent Java developer is harder to find than a C++ or even a C# guy. Tools like Eclipse are free and there is a lot of free online documentation. And it's easier to build a quick GUI in Java than C++.

Logo? (2, Interesting)

thegrassyknowl (762218) | more than 8 years ago | (#13299721)

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.

Re:Logo? (1)

deeny (10239) | more than 8 years ago | (#13299784)

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!

I have to admit that I always envied the people who learned turtle graphics (at the time when it was au courant).

Re:Logo? (1)

thegrassyknowl (762218) | more than 8 years ago | (#13299962)

I have to admit that I always envied the people who learned turtle graphics (at the time when it was au courant).


I feel better for having learned it. Gone are the good days of computing. Now it's all VisualCRAP.

May I suggest.... (3, Informative)

Seraphim_72 (622457) | more than 8 years ago | (#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

Python (1)

YA_Python_dev (885173) | more than 8 years ago | (#13299747)

I think we will have a bit more good programmers if they start to learn programming with Python: concentrate on the algorithms not on irrelevant details.

Old Basic (1)

photon317 (208409) | more than 8 years ago | (#13299763)


I was thinking about this (from the perspective of what I would do to educate a promising youth with no programming experience who seemed to have a the right mind for it) same sort of topic a while back, and here's what came of it:

First, kill Visual Basic - that's just plain bad.

Also note that you'd need some good emulators or some old-school hardware for some of this (although you might be able to build/find new DOS-era hardware based on Intel's 386EX chip, I think they still make it for little embedded systems, anyways..)

I would start a programming-illiterate person off in plain old BASIC (like, the kind you did in old MS-DOS, or the Apple ][, etc). No Visual anything, no windows, nothing complicated.

Start with "Hello World" and move up from there to the kinds of simplistic text-based applications and games one used to see source code for in 3-2-1 Contact

In parallel, teach them very basic electronics - the kind you'd learn from those old Radio Shack 423in1 electronics kits. Battery, LED, resistor, switch. Move from there to very basic digital logic using TTL or CMOS chips to teach them about the binary system and binary logic, finish it off around the level of making neat little circuits with the logic chips and a 555 timer or something. (They could of course branch out on their own beyond that).

Around the time both of the above are going well, introduce them to PEEK and POKE in BASIC, tell them more about the hardware in the system, show them how to directly manipulate video memory via PEEK/POKE to the mapped video-ram addresses, etc. This transitory phase will go quickly.

Next you step them right on down to early x86 (no more than simple '286 instructions are neccesary, screw protected mode and all that jazz for now) assembly, with a text editor and MASM/TASM. BASIC is no longer useful. Let them learn all over again to write those same little console games/apps in assembler. Get some good books on the subject for reference guides.

Once their assembly code starts getting a little unwieldy and difficult to debug due to complexity, introduce them to better ways to manage their code than BASIC-style linear programming. Show them to organize their assembler code into little libraries of subroutines with standardized calling interfaces, etc. Once they're comfortable, and they're ready to start making even more complex software, but the complexity of doing it all in ASM is slowing them down (But they are using some good functional-style technique)...

Switch them over to C. Show them how C is like platform-neutral assembler that's easier to write and maintain. You might well wean them off of DOS and head straight to Linux for the C part. Stick again to text-console software, no crazy graphics libraries or anything. As they're getting used to C and getting used to the Unix shell in general, touch on unix shellscripting - and later as their C starts getting decent show them perl.

After that, they're pretty much good to go in any language with Google and/or the O'reilly section of their local bookstore at their side.

I think part of the natural advantage programmers of my era have (~30 years old now) is that we grew through a lot of these stages naturally as they evolved around us in popular geek culture (if that's not an oxymoron). More recent guys are in some ways crippled by not having the benefit of going through these stages sans modern amenities and languages.

Java, then assembly language (5, Insightful)

MobyDisk (75490) | more than 8 years ago | (#13299765)

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.

Re:Java, then assembly language (1)

YA_Python_dev (885173) | more than 8 years ago | (#13299855)

Java: - Is not too verbose (Hello World is not daunting)

May I suggest you to try to write an hello world program in Python, Ruby, Basic and Perl and then compare them with the smallest hello world that you can get in Java?

Languages like C, C++, Java and C# have some uses, but even a simple hello world requires a lot of black magic for a novice.

Re:Java, then assembly language (0)

Anonymous Coward | more than 8 years ago | (#13299892)

What???? Java most certainly does have pointers!

assembly! (1)

Unordained (262962) | more than 8 years ago | (#13299780)

Seriously.

AT-Robots or some other assembly-like language to teach them how to program with registers, conditional jumps, interrupts, and all that. They'll later realize they hate goto from this. But mostly it's really stinkin' fun, and they'll hardly realize they're programming. Instead they'll be thinking about the problem they're solving, trying to beat each other in competition.

Then a language like C, to learn about functions, loops of various sorts, pointers, maybe even function pointers. This is when it gets boring.

Then a few other languages to learn about OO, dynamic typing, etc.

They really should be exposed to both interpreted and compiled languages, strongly typed and otherwise, with and without OO, ... learning to program isn't about learning to program -something- in particular.

I would object to teaching them specifically "Ruby on Rails" -- that's like teaching someone how to hammer together a bird-house, as opposed to teaching them to be a carpenter. Also make sure they know the difference between a language and a library, if you can make that distinction.

Anything that starts with "C" (2, Insightful)

frenchs (42465) | more than 8 years ago | (#13299787)

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.

Re:Anything that starts with "C" (1)

deeny (10239) | more than 8 years ago | (#13299815)

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.

I think compiling should be a second year thing, at least for high school.

My order of preference:

  1. Ruby
  2. Squeak
  3. Scheme
  4. Python
  5. Java
  6. light PHP in the context of an HTML class
  7. C or C++
  8. ...anything else...

Re:Anything that starts with "C" (1)

deeny (10239) | more than 8 years ago | (#13299833)

Actually, I'd put Pascal below C at this point. I think teaching OO concepts is important and Pascal falls down on that. I used to like it -- ages ago.

Re:Anything that starts with "C" (1)

Procyon101 (61366) | more than 8 years ago | (#13299997)

Not moving on to the advanced features just yet is exactly why I would teach Java first before C++. Java is like C++ with training wheels. It supports all your basic OO in a very constrained format that makes it hard to make dumb mistakes in. It teaches you interface based programming, single inheritance models and other good OO techniques. Too many new C++ programmers start multi-inheriting and dynamic casting right off the bat and end up not learning the importance of KISS until they really get bitten by it. Later, after they have all their good habits well ingrained, take off the training wheels and show them C++ where they will still use all the good habits, but see the benefit and magic of occassionally shoving default implementation into the interface, or templatizing implementation superclasses. If you give them C++ too early they will be too apt to spend all there time exploring the esoteric instead of the fundamental.

Perl (1)

dreamer-of-rules (794070) | more than 8 years ago | (#13299796)

Teach 'em Perl. Teach loops, pattern matching, and `exec` statements. These can be kept very english-like. The more adventurous students can explore either more advanced or esoteric Perl (to show them some Martian Perl, show some "Perl Minigolf" examples).

Perl is a quick and dirty way to automate anything. Running programs on a recurring basis, testing file structure and existence, querying SQL databases, accessing internet resources. Nearly any job involving running a computer program could be made easier using Perl. Perl is also cross-platform, unlike VB or Cocoa.

The thing I like most about teaching Perl is that you can start with a three line useful, working program. Then modify it to solve different problems, each time introducing a new concept or command.

Please make useful examples. None of those $car_object->turn_left() abstractions.

Avoid all languages with big libraries (1)

Julian Morrison (5575) | more than 8 years ago | (#13299822)

If you teach VB, PHP, Perl, Ruby, Python, Java then your students will spend most of their time gluing together other people's library code. This is boring, uninformative, and gives a false and anticlimactic sense of early achievement. Yes, five minutes in VB will glue together a working text editor. And you learn nothing in so doing. Similarly PHP for a website.

Good languages to start programming have a simple core library that does basic IO and data manip, and nothing else. The best are probably Scheme or C, depending if your focus is academic or technical.

Bwa? (1)

Jerf (17166) | more than 8 years ago | (#13299838)

I'll echo the "Python" recommendations, tempered by the fact that a Rails-like framework may be a good idea. On the other hand, it may involve learning too many things at once; I've been web developing for just shy of ten years now and it's hard for me to feel how hard this stuff is. But take Javascript, HTML, Ruby, the Rails framework, and a couple of things tossed in for good measure, and it may prove a bit much. (Or not. I happily defer to anyone who has actually tried to teach programming starting people from scratch from Rails. But I think I'd start with a tech that is made out of less acronym soup.)

But what I really wanted to comment on was:

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.

Bwa? Check your terminology. Ruby, Python, Perl, and the like are the highest level languages there are for general use at the moment. They can hardly fail to lead well into themselves.

(PHP is deliberately not in that list. I would not start them there. PHP requires immense discipline to use properly and there's little gain to be had for that discipline. I'd say it's the closest candidate for a modern heir to the "You can't teach a Basic programmer how to program" meme from Dykstra; in some sense it's not a "bad language" but it definately teaches a lot of very bad habits, with a community that enables this behavior. Your students should not end up on Bugtraq [google.com] with their school project.)

In fact, you'll be jumping those kids ahead of a lot of Old Farts (TM) who still look down on those languages for a host of misguided reasons and insist on using C, not because it's the best choice for some good reason (like a cross-platform library, for which it is still King), but because they honestly think it's the best choice.

Your danger is that if the kids are ever presented with C, they'll wonder why the hell anyone does things in such a baroque fashion and they'll refuse to be placed into that sort of bondage. Me, I consider that progress, but YMMV.

My experience (1)

Wolfbone (668810) | more than 8 years ago | (#13299848)

I suffered an introductory course in programming in VB while studying physics at university and despised it. Later I was fortunate enough to come across SICP and the SICP videos when I decided I needed to learn programming in earnest but if I'd been stuck with something like C++ or BASIC or Java, I suspect I'd still have found programming a tedious and unrewarding distraction from real maths and science and never really understood its potential. Now I actually like and respect it and there are good resources available for high school level stuff:

http://www.teach-scheme.org/ [teach-scheme.org]
http://home.adelphi.edu/sbloch/class/hs/testimonia ls/ [adelphi.edu]

Apparently Scheme/Lisp appeals even to 'liberal arts' types and though I'm not one of those myself it certainly rapidly transformed my attitude to and understanding of computing and I can see why it might make better and more enthusiastic programmers of students whatever their abilities and preferences.

why the need for enticing? (1)

acdc_rules (519822) | more than 8 years ago | (#13299865)

do you want lots of programmers or develop fewer, but better programmers. someone suggested assembly. yes, that's good, but go back one further to machine code, if its possible. i learned programming using those microprocessor kits with hex keyboards, displays, etc. you get a real sense of what's happening inside the CPU and how addressing and data transfer take place. this approach builds a deep foundation. i know people writing C/C++ that don't completely get stacks, interrupts, etc.. as for high level language, how about something completely different like logo and forth. it is a good way to illustrate the unimportance of a specific language.

Go with PHP (1)

Bald Wookie (18771) | more than 8 years ago | (#13299915)

PHP is great for high school kids:

1. It's an "instant gratification" language that makes it easy to get results.

2. You can do a lot of web based projects which teens should find interesting.

Yes, PHP has a lot of problems. It's very undisciplined. However, I think it's a good choice for a class where probably 80% of the kids won't ever program again.

What entices high school students? (3, Insightful)

Dukhat (198764) | more than 8 years ago | (#13299936)

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./ [freshmeat.net.]

C (lalalalala.. lameness filter sucks) (1)

_Splat (22170) | more than 8 years ago | (#13299941)

Straight C. They're gonna have to learn it sometime, it's useful, and they'll learn about how the computer works. Unless people don't think knowing something as low-level as pointers or a sort algorithm is important. Then go ahead and teach Java with its libraries for everything and garbage collection and slow-and-fatness.

Python, natch. (1)

jericho4.0 (565125) | more than 8 years ago | (#13299946)

Python is a great choice for a first language. Heck, it's a great last language, if you're not a pro. Ruby's OK, but python is more straightforward, while stil giving you lots of power.

Java's too verbose, C/C++ is too close to the hardware, and we probably shouldn't go that low for a fist language. PHP is too domain specific (and kinda cluncky). Ideally, your students would get a bit of exposure to several languages, so they can see some differences (typeing, etc)

Re:Python, natch. (1)

amliebsch (724858) | more than 8 years ago | (#13299998)

This question would be much easier to answer if you could provide us with some insight as to why they dislike VB. Otherwise, we're just guessing.

Personally, I think VB.NET is an excellent beginner's language. It is simply easier to quickly get to the "making windows programs" stage (which is the interesting part) than Perl or Python. The syntax is more human-readable than java or C#, but is instructive for good technique since it supports full proper OOP. Finally, the rich framework and ability to build web apps is icing.

Don Box asked before. I suggested LOGO (2, Informative)

Quantum Jim (610382) | more than 8 years ago | (#13299958)

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).

UnrealScript (1)

Corngood (736783) | more than 8 years ago | (#13299960)

Can't beat that for excitement, just make a bot competition out of it or something. You can even download the unreal engine 2 runtime for free from http://udn.epicgames.com/ [epicgames.com]. UnrealScript will teach basic programming and OO design, and stuff like 'latent' functions make controller logic a lot simpler.

Also, you could easily integrate it with an art programme to teach that side of it.

Assembly language (0)

Anonymous Coward | more than 8 years ago | (#13299985)

Hear me out...

My first programming language was assembly language and it was really helpful in learning all other programming languages.

Whether it was programming BASIC, C, C++, COBOL, Delphi/Pascal/Modula2, Perl, Python, Ruby, Scheme or XBase, I always benefitted from having learned assembly first.

Some languages such as Ruby or Python obviously don't necessarily benefit as much from having learned assembly first. But still...

Logo (1)

kbielefe (606566) | more than 8 years ago | (#13299994)

waits a while for mocking laughter to die down...

Hey, it's what got me interested in programming. It's interactive so it gives instant results. It can teach the basics of algorithmic thinking without burdening the beginner with all the necessary quirks that go with "normal" programming languages. If they find they actually have a talent and interest in programming, a more conventional language can be used for a 102 course.

I've actually thought a lot about this question since my wife took a Java 101 class a few years ago. The following are comments she made while she was doing her homework:

  • What the heck does "public static void main" mean?
  • What's all this import stuff about?
  • What's the point of this try/catch stuff?
  • Why do I have to recompile the whole thing when I just changed one letter?
  • These error messages don't make sense and it's hard to tell where they occurred.
  • I know what all the commands do individually, but I really wanted to learn more about how they work together.
  • I spend so much time dealing with the compiler and stuff, that I haven't been able to really learn about programming.
  • What's the point of floats, doubles, and ints? Why don't they just call it a number and leave it at that?
What I got out of her comments was that the programming language was getting in the way of learning programming. While most of her questions seem pretty basic to an experienced programmer, they were still outside the scope of her class. The teacher didn't have time and the students didn't have the background to understand the answers.

In my opinion, the best languages for introduction to programming are loosely-typed scripting languages. Let the students get the basics of programming down first, then concepts like type, storage, classes, packages, error handling, compiling, etc. can be added later.

Python is the perfect first language for learning (2, Informative)

Ursus Maximus (540370) | more than 8 years ago | (#13300003)

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]

Crazy ideas (1)

MadChicken (36468) | more than 8 years ago | (#13300008)

Yeah these are kind of crazy, but...

I always thought Inform [inform-fiction.org] would be a cool learning language. It introduces the concepts of objects in a very easy-to-grasp way. It's really easy to throw together a working game.

Also what about something like DarkBASIC [thegamecreators.com]? I haven't used it at all, so I have no idea if the syntax is intelligible (or if it teaches good programming practice). Think about how students would respond to something like this, though...

GAMES!

PHP and Ruby on Rails both good choices (1)

forestgomp (526317) | more than 8 years ago | (#13300029)

PHP and Ruby on Rails (RoR) are both excellent choices because:

  1. they both are interpretted languages (don't make your High School kids deal with compiling!).
  2. they are both built for the Web, which is what your students are interested in.
  3. they both enable rapid application development.

Ruby is very elegant (pure OO, powerful but simple, clean syntax). As many have noted, RoR is not a programming language per se but rather a Web application development framework that uses Ruby together with a lot of neat stuff (like Object Relational Mapping) that works "out-of-the-box" without configuration (if you follow design conventions). You could start your students with Ruby and then later in the term introduce RoR. Nice.

PHP is a good choice if you're not too worried about stressing pure OO (although you CAN do OO in PHP), but want to show how quickly and easily great stuff can be done on the Web. There are tons of libraries available for your students to dig in to as well.

Good luck. Glad to see you're moving away from VB!

Making a reasonable case for PHP (3, Interesting)

danielDamage (838401) | more than 8 years ago | (#13300046)

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.

Are you sure that the PL is the problem? (1)

bigsteve@dstc (140392) | more than 8 years ago | (#13300093)

Before you go to the effort of changing all of your teaching material, etc, etc, you need to have a good handle on why students are not taking the course. Are you sure it is the programming language you are teaching that is turning them off?

What you need to do (and this is hard!) is to find out why students are turning away, and try to address those issues.

Python, all the way (1)

Punboy (737239) | more than 8 years ago | (#13300139)

Python is great for this. It's object oriented, interpreted, has amazing documentation and tutorials readily available, and forces the developer to learn good indentation practices at the start.

This is what I started with, and found it very easy to from there learn Java, C, and C++.

Best Language (4, Insightful)

deanj (519759) | more than 8 years ago | (#13300159)

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.

Why not Tcl? (1)

Eil (82413) | more than 8 years ago | (#13300187)


I think Tcl is a great beginner's language because it balances a shallow learning curve with a quite a lot of power. (More than most expect before they've tried it.) Although I hardly ever program, I've dabbled in C, C++, Java, VisualBasic, and Python, but Tcl was the only language that I felt at home with. I was writing useful programs (GUI programs, even) within 2 hours of discovering its existance.

A lot of OSS folks are put off by it's blindingly simple syntax:

[command] [arguments]

But this shouldn't be an issue in a beginning programmer's class, because your aim is to teach programming, not the subtle nuances of a particular C-sytle syntax. Once they understand basic programming concepts, then show them how other programs do it. Another huge bonus is that Tcl has a very helpful and friendly community [wiki.tcl.tk] behind it. Try sending your students to comp.lang.c or some of the other communities on the net and they'll probably be discouraged from programming ever again.
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...