I appreciate that this forum is rather inappropriate for this question, but since i know some of you are programmers: i'd like to learn a programming language, but am rather confused by the large number of languages available. What would be a worthwhile programming language to learn?

It really depends on what kind of programming you want to do.Java and C++ are better for game programming, while C# is more of a general purpose language. Python is another general purpose language that is pretty good, and it's open source.

As with "should I start with Greek or Latin" the answer to this question must be determined by your goals.

If you are simply interested in an introduction to the craft of programming I would probably recommend Python. It is available on all the major platforms; there are plenty of good books and web resources, including some just for people who haven't done much programming before; it won't instill wretched habits which will cause you problems in the future; it's not the top of the list of popularity, but neither is it too far down.

This is most likely an incredibly stupid question that will reveal my utter ignorance of computers, but: once I download it, is it something i put on my thumb drive and take along to work so I could study/use it in my lunch break?

Kasper wrote:is it something i put on my thumb drive and take along to work so I could study/use it in my lunch break?

Probably not without badly irritating the IT staff at your place of work. I'd save reading for lunch breaks and coding for your own computer. And depending on the OS it might not work very well at all.

I can't remember why I chose it over Perl, but I third Python. William being his objective self didn't even mention ancient Lisp. Unfortunately, I have always been distracted with language and historical linguistics in the past few years and I always had false starts with computer languages. Now that I have decided to get into data mining and finance, it seems that I have to go shopping again. When you feel comfortable with Python, you will probably want a more specialized language for different purposes. You might want to get into XML for the purpose of linguistic work... Once I go through calculus and statistics, I am going to go with the R programming language for statistical analysis and (as a component of) data mining. Hopefully, R will be useful in the future for my own personal linguistic work.

Here is a link about computer language popularity. In some instances, Python seems to be quite popular.

1%homeless wrote:I can't remember why I chose it over Perl, but I third Python.

I fourth Python, as a good learning language. I don't like the "offside rule" (indentation level specifies blocks instead of curly braces) in Python, but that's personal taste because I learned programming with C.

Perl is a horrible learning language; it's a read-only language.

[edit]Oops, I meant write-only.

Last edited by Lex on Sat Feb 28, 2009 2:26 am, edited 2 times in total.

I, Lex Llama, super genius, will one day rule this planet! And then you'll rue the day you messed with me, you damned dirty apes!

Because he doesn't think it's the best language for a beginner to learn from?

I would be interested in what he thinks is a good book to learn Lisp from, especially one for a person who is already familiar with procedural and object-oriented styles but not so much with the functional style.

I, Lex Llama, super genius, will one day rule this planet! And then you'll rue the day you messed with me, you damned dirty apes!

Because he doesn't think it's the best language for a beginner to learn from?

I do actually think it'd be a fine language for a beginner to learn from, but it's a little bit harder to find good free lisp systems that run on all platforms equally well. Also, while there is no doubt in my mind that Lisp is a superior programming language — they don't call us smug lisp weenies for nothin'! — neither do I have any fantasies about how popular it currently is.

I would be interested in what he thinks is a good book to learn Lisp from, especially one for a person who is already familiar with procedural and object-oriented styles but not so much with the functional style.

Peter Seibel's Practical Common Lisp, which is available both online and in a dead tree format. It isn't pure functional, though, for which you're probably better off going straight to Haskell or OCaml. You might find Common Lisp's approach to OO eye-opening.

It was some of my own Perl code that finally sent me screaming to Python. If Perl 6 development doesn't produce something usable and stable in a few years I expect Perl to die, living on only in the DNA of Ruby, that mutant love-child of Perl and Smalltalk.

1%homeless wrote:I can't remember why I chose it over Perl, but I third Python. William being his objective self didn't even mention ancient Lisp. Unfortunately, I have always been distracted with language and historical linguistics in the past few years and I always had false starts with computer languages. Now that I have decided to get into data mining and finance, it seems that I have to go shopping again.

Well, like spoken languages, programming is a "use it or lose it" proposition. Unless you have something you need to program, no amount of study is going to stick.

annis wrote:I do actually think it'd be a fine language for a beginner to learn from

Well, it would definitely be better than learning from old line-numbered spaghetti BASIC! *shiver*

annis wrote:but it's a little bit harder to find good free lisp systems that run on all platforms equally well.

Hmmm... yeah, but a beginner would only have to get it up and running on one system. gcl is easy enough to install on Linux (even with the Slackware distro), and getting Lisp-in-a-Box running on Windows is a piece of cake. No setting up MinGW or anything.

annis wrote:Peter Seibel's Practical Common Lisp, which is available both online and in a dead tree format.

OK. I had seen that book, but saw a few bad reviews that made me wonder. But I also saw a lot of really good reviews on it, too, and yours is the clincher.

I don't really care if it's purely functional, as long as it allows that style of programming. In fact, I don't really care for languages that force you into one style of programming, like Haskell, Ruby, Smalltalk, C#, Java, etc. That's one of the things that attracted me to Lisp; it will apparently let you mix and match whatever concepts fit the project you are working on.

annis wrote:You might find Common Lisp's approach to OO eye-opening.

Oh yeah? What in particular do you find so neat about it?

annis wrote:It was some of my own Perl code that finally sent me screaming to Python. If Perl 6 development doesn't produce something usable and stable in a few years I expect Perl to die, living on only in the DNA of Ruby, that mutant love-child of Perl and Smalltalk.

Hehehe.... Perl is OK for what it was originally intended to be; a shell scripting language on steroids.

I, Lex Llama, super genius, will one day rule this planet! And then you'll rue the day you messed with me, you damned dirty apes!

Lex wrote:Well, it would definitely be better than learning from old line-numbered spaghetti BASIC! *shiver*

True. An awful lot of people these days are coming to programming via the domain-specific languages embedded in MMOs and virtual worlds. I bet there are more people in the world this instant programming LSL, the truly ghastly scripting language used in Second Life, than there have ever been Smalltalk programmers. I sort of understand that LSL is ghastly for performance reasons (each simulator machine may have 3000+ concurrent scripts running at any moment), but it's still very icky. It's like FORTRAN days — parallel arrays instead of structures, etc.

Hmmm... yeah, but a beginner would only have to get it up and running on one system. gcl is easy enough to install on Linux (even with the Slackware distro), and getting Lisp-in-a-Box running on Windows is a piece of cake. No setting up MinGW or anything.

I have heard of troubles with Lisp-in-a-Box, but I'm pretty ignorant where Windows is involved. If I ever needed a professional Lisp implementation, though, I'd probably go with Lispworks, a hobbled version of which I believe powers lisp-in-a-box for Windows. On the other hand, SBCL has had so much work on it done by the Orbitz people, I'm not sure I'd ever need a commercial Lisp.

annis wrote:You might find Common Lisp's approach to OO eye-opening.

Oh yeah? What in particular do you find so neat about it?

This might be hard to explain before you've had a browse through Seibel's book. CLOS (the Common Lisp Object System) focuses its attention on the methods — generic functions really — which leads to some interesting deviations from the class-centric approach most people are used to. I frequently use the type dispatching mechanism of CLOS without ever creating a classes. Using keywords with EQL-specializers is a special joy. The :before, :after and :around methods can be very useful. Seibel's "Object Reorientation" chapters will probably be mostly comprehensible to you now.

annis wrote:(each simulator machine may have 3000+ concurrent scripts running at any moment)

Funny you mention 3000 concurrent scripts; I am trying to learn more about functional languages mainly because I believe they'll have a place to play in the future as we get more massive parallelism with multicore computers. I don't think the traditional methods will cut it, and the mainstream is due for another paradigm shift soon. Even Microsoft is into it with F#, their "mutant lovechild" of OCaml and .NET. But unfortunately, I'm spending most of my studying time right now with more mundane things like C#. My jobs have required mostly Windows and old-school tech like C, C++ and VB, so I'm catching up even on C# and .NET.

annis wrote:I have heard of troubles with Lisp-in-a-Box, but I'm pretty ignorant where Windows is involved. If I ever needed a professional Lisp implementation, though, I'd probably go with Lispworks, a hobbled version of which I believe powers lisp-in-a-box for Windows. On the other hand, SBCL has had so much work on it done by the Orbitz people, I'm not sure I'd ever need a commercial Lisp.

Well, I haven't played with Lisp-in-a-Box much yet, but I have installed it. The installation was unproblematic, at least on Vista. I don't expect it to be production quality, just able to get me through Seibel's book when I have the chance. It only supports either GNU CLISP or Franz Inc.'s Allegro CL, though, at least on Windows.

annis wrote:This might be hard to explain before you've had a browse through Seibel's book.

OK. I'll not bother you any more til after I've put some effort into the book.

I, Lex Llama, super genius, will one day rule this planet! And then you'll rue the day you messed with me, you damned dirty apes!

annis wrote:(each simulator machine may have 3000+ concurrent scripts running at any moment)

Funny you mention 3000 concurrent scripts; I am trying to learn more about functional languages mainly because I believe they'll have a place to play in the future as we get more massive parallelism with multicore computers.

Then you might find Clojure interesting, a purely functional dialect of Lisp intended for concurrency, sitting on top of the JVM: Clojure. The inventor appears to be brilliant.

OK. I'll not bother you any more til after I've put some effort into the book.

Do. You're more than half-way to being one of us anyway, but just don't realize it yet.

annis wrote:You're more than half-way to being one of us anyway, but just don't realize it yet.

Oh noooo.... I'm about to become assimilated!

Actually, I'm up for studying anything that makes me a better programmer, and I've found the best things for that are things that teach me how to think about programming differently. That way, my conceptual arsenal is increased. I remember when I first learned C++ and OO; at first, I didn't get it. I thought classes were just structures and methods were just an unnecessarily strange syntax for making function calls. Once I grokked it, though, it helped my C programming; I structured programs more cleanly. I'm hoping to get something similar out of Lisp. Even if I don't use Lisp for production code, it could still help me look at programming differently. Your teaser about OO in CLOS leads me to believe I am right.

I, Lex Llama, super genius, will one day rule this planet! And then you'll rue the day you messed with me, you damned dirty apes!

Jeez, this thread geeked out quickly, but I thoroughly enjoyed the discussion. I had a chance to quickly browse through a Lisp book today and it tried to debunk the myth about the horrid abundance of parentheses. Even after the reformat of the code, you still get that )))))))))))) at the end... I was puzzled when I recently saw this in R code. It was just a coincidence that the R language was described as syntactically similar to C but semantically like Lisp/Scheme. I hope this is due to programmer sloth and that there is a better way to structure the parentheses for readability...

annis wrote:I do actually think it'd be a fine language for a beginner to learn from

Well, I somewhat agree with Lex about his disposition with BASIC. From what I can barely remember in school, it wasn't all that bad though. I used QuickBasic and I don't think it was line numbered. I can't really say much about Lisp being the first language for a programming virgin. Is Lisp as easy to learn as Python? Someday, you have to write an essay as to why Lisp is the most super-duper best language in the world so you don't have to repeat yourself about why you like Lisp so much.

1%homeless wrote:I had a chance to quickly browse through a Lisp book today and it tried to debunk the myth about the horrid abundance of parentheses. Even after the reformat of the code, you still get that )))))))))))) at the end...

1%homeless wrote:From what I can barely remember in school, it wasn't all that bad though. I used QuickBasic and I don't think it was line numbered.

QuickBasis is a more evolved dialect. Check out GWBasic, if you can find anything on it. It's old-school! It has a GOSUB command, which is a very primitive sort of function call, but a lot of code back then used GOTOs for most everything, and the code quickly became undecipherable even to those who wrote it. Anyway, it's a horrible way to teach programming.

1%homeless wrote:Coming from a neophyte shopper of languages, I actually prefer the indentation because it does make the code more readable -to my eye at least.

Yeah. I played around with Python about 6 months ago, and I got used to the indentation after a while.

I, Lex Llama, super genius, will one day rule this planet! And then you'll rue the day you messed with me, you damned dirty apes!

1%homeless wrote:Jeez, this thread geeked out quickly, but I thoroughly enjoyed the discussion. I had a chance to quickly browse through a Lisp book today and it tried to debunk the myth about the horrid abundance of parentheses. Even after the reformat of the code, you still get that )))))))))))) at the end...

I'm afraid I'm inclined to view complaints about parenthetical pile-ups in the same way I do people's complaints about Python's enforced indentation. It is all too often from people with minimal experience in the language. The closing parens should never be a hinderance to readability. Let's compare. Here's the end of some Javascript I recently banged out for Scholiastae.org,

If that were all on the same line you'd get a similar pile-up of blocking mechanisms. However, someone reading the code isn't going to care about them, because the programmer should have indented the code sanely. If you do have to stare and match braces, the programmer needs a whack with a clue-by-four. And here's the piece of code with the biggest bunch of final parens in my SVG library:

The experienced lisp programmer won't even notice those final parens, because the indentation makes all blocking completely clear. The start of each line says a lot more about the code. And when writing code in any language, so long as you use an editor that knows the language you're using you shouldn't even have to worry about counting braces or parens or whatever yourself — let the editor help you.

Someday, you have to write an essay as to why Lisp is the most super-duper best language in the world so you don't have to repeat yourself about why you like Lisp so much.

Well, I'm not sure that's needed. Lots of people have made very good defenses of lisp already. I have nothing new to add.

And when writing code in any language, so long as you use an editor that knows the language you're using you shouldn't even have to worry about counting braces or parens or whatever yourself — let the editor help you.

Thank the Gods almighty...

Well, I'm not sure that's needed. Lots of people have made very good defenses of lisp already. I have nothing new to add.

Any links besides Seibel's introduction chapter? Or does that says it all (or at least mostly)?

annis wrote:I'm afraid I'm inclined to view complaints about parenthetical pile-ups in the same way I do people's complaints about Python's enforced indentation. It is all too often from people with minimal experience in the language.

While it's true that I only have minimal experience with either Python or Lisp, I think the reason I instinctively recoiled from this aspect of Python at first was more because I had experience in curly-brace languages. It just seemed morally wrong to not be able to lay out the code however I wished. This was especially the case since I learned C from K&R, and prefer their layout style, with the closing brace on the same indent level as the opening if, for, or what have you.

Regarding "parenthetical pile-ups"; you're right. Logically speaking, the indentation and a good editor should make that a non-issue. But, they're just .... so ugly. It's just an aesthetic thing.

I, Lex Llama, super genius, will one day rule this planet! And then you'll rue the day you messed with me, you damned dirty apes!

1%homeless wrote:Any links besides Seibel's introduction chapter? Or does that says it all (or at least mostly)?

I found this. I haven't finished reading it yet, but it is interesting so far.

Seibel and that essay are probably enough. This email (though a bit vulgar, and the last set-sqrt macro is sloppy). Paul Graham has quite a few rather eccentric essays about nearly every subject under the sun, including Lisp, which often include good history.

In case you're interested, 1%, I've found free PDF copies of Graham's ANSI Common Lisp, Norvig's Paradigms of Artificial Intelligence Programming and Russell & Norvig's Artificial Intelligence: A Modern Approach on http://www.scribd.com. You have to sign up to download them, though.

I, Lex Llama, super genius, will one day rule this planet! And then you'll rue the day you messed with me, you damned dirty apes!

I also just found this book, How To Design Programs, which claims to be an improvement on SICP. It is based on various teaching versions of a dialect of Scheme, which is freely available through the site.

I, Lex Llama, super genius, will one day rule this planet! And then you'll rue the day you messed with me, you damned dirty apes!