|Do you know where your variables are?|
Perl as one's first programming languageby amarquis (Curate)
|on Apr 07, 2008 at 16:00 UTC||Need Help??|
In the distant past (2001, perhaps) I posted a thread asking people's opinions about the value of Perl as one's first programming language. Searching back, I see also Perl as a first language (2000) and Learning Perl as a First (programming) language, which have similar replies to the thread I remember.
It got me curious, though, as to what the general feeling was today. Plenty has changed in the intervening years, in the Perl world, the programming world, and elsewhere. There are new languages out there, and old languages that have matured. Perl has matured too, and the web is now a vital application for almost everyone. I think back in 2000-2002 I was the only customer of cable internet on my street, and now I can see 4 neighborhood wireless networks from my computer room.
One specific note: one of the points brought up a few times was that it is better to learn something like assembly or at least a language where you have to manage your own memory. The idea being that this would familiarize you with the basic workings of the machine. And, in the case of memory management, it is a demon serious programmers will have to deal with at some point anyway.
Do many still feel this way? Personally, I think abstraction is a virtue for a beginner. When I tutored beginning CS students and Physics students doing their first programming, I found most learned best when I could abstract away as much as possible. Memory management, in particular, I think is a big, imposing clump of trees that make it impossible to see the forest.
Obviously a choice of first programming language is going to depend heavily on what one's goals are. But I personally think that Perl is a very good vehicle for teaching the fundamental ideas of programming. I'm talking the very, very basics here: that the computer will sequentially evaluate your statements, the concept of variables and the state of the machine, etc. Basic ideas, but not trivial to the beginner. I've encountered plenty of people fairly far along in CS101 who had fundamental misconceptions about what was going on or why what they did worked. Myself included.
I watched many students drop out of my own Java-based CS101 class. Some were not appropriate for the CS program, but others felt like they were behind from day one. public static void main doesn't mean anything to a beginner. It is a mysterious black box that makes people feel like there is something more they should know, even to make the most basic of programs. say "Hello"; however, is something anybody can write and understand the basics of each part.
I think the above is a strong argument for a language that requires "knowledge as you go." Simple to start off, and as you want to do more complicated things you can expose yourself to the meatier bits.
Perl is a good fit for this, and, as a bonus, you walk away with knowledge of a language that is great for text processing and work on the web. These can give you a return on your learning investment almost instantly.
Example: A teacher friend of mine was doing WAY too much work analyzing multiple choice test results (CSV files) coming out of the scantron. The Scantron would say which answers were right and wrong, of course, but he wanted statistics: data pulled from the exams showing which concepts students were struggling with. I made a Perl script in a jiffy to do the grunt work for him, and soon he had learned enough to modify it to explore the data in different ways. That kind of positive reinforcement is priceless for giving people the motivation to keep learning.
So, what do other monks think about learning Perl first nowadays?