views:

1309

answers:

22

Each programming language comes with its concepts, best practices, libraries, tools, community, in one word: culture. Learning more than one programming language will make you a better programmer, for the more concepts you learn, the faster you will feel comfortable when the next language or technology will come.

Mine, so far, are C, some C++, and Python, and many times I read that it would be worth learning LISP, for "the profound enlightenment experience you will have when you finally get it" (quoting Eric Raymond).

My questions are: Which is the next one you would consider a good investment to learn? Of the many programming languages you have learnt and worked with, which ones do you consider to be an essential part of one's CS culture, and why?

EDIT. Further question: is there any language you would sincerely advise to avoid as a waste of time? (The famous, and questionable, slatings in this letter from Dijkstra come to my mind.)

+3  A: 

SQL and C#

BoltBait
Those are my bread and butter, but knowing some C and/or ASM is useful so you know whats going on under-the-hood.
Nate Bross
+21  A: 

C. The world's most portable assembler. Speaking of which, at least one assembly language. And for bonus points, grow a justifiable opinion as to why you like it or not! (I like ARM: all conditional instructions, all the time)

bog
+1  A: 

I would suggest Java and PL/SQL
But you have to ask yourself what would you like to do with your knowledge. :) Which kind of application do you want to write...

Node
+6  A: 

For me it's:

  • C: I didn't really understand computers until I learned C well.
  • sh: I couldn't live without the ability to quickly automate small tasks.
  • Perl: Because sometimes shell just isn't enough.
  • SQL: Databases need to be accessed by everyone.
Chris Boran
+1 from me, but s/Perl/Python/ ;-) "Easy as Perl and powerful as C."
Dan
I have found Perl more useful to know because it is more prevalent. I do like Python better than Perl, but pretty much every place I have ever worked, I have been the only one to really 'know' Python, while Perl is everywhere I go, making it more useful IMO.
Chris Boran
+3  A: 
  • Assembly (probably not x86) - Then you'll never forget what's really going on
  • SML or another functional language - It gives you a sense of perspective and reminds you that procedural/OOP isn't the only way. Helps with lateral thinking.
  • You've already got a good grounding in "everyday" languages
  • Ruby if you want something of more immediate use
Draemon
Because x86 assembly is a mess, filled with legacy instructions you should never use anymore and an opcode pattern developed for 8-bit machines and extended in more and more wasteful ways to 16 and 32 bits. Now the instructions need to be ordered to match a new predictive RISC-style (but not RISC).
Brian
Yes, but it's the old 8-bit stuff that will show you 'simply' how the machine does what it does.
Lance Roberts
Brian's right. It's actually the segmented memory model that makes it a pretty daft language to learn for learning purposes. Nothing wrong with 8-bit assembly, but 8-extended-to-16-extended-to-32-extended-to-64-bit?
Draemon
+31  A: 

Regex.

It's a language in and of itself. So much better than using tons of indexof/substring functions to accomplish the same thing.

Kibbee
Of course I agree.
Federico Ramponi
If only regex's could be commented :P
TraumaPony
Most languages support comments in regex. Although I usually find it easier to put the comments outside the regex pattern definition, the way you would comment anything else.
Kibbee
Unfortunately, it's not a very consistent language... regex(3) != Perl 5 != PCRE != Perl 6 != Python != C# != ...
ephemient
Yeah, the syntax may not be compatible, but most of the base features are similar across all flavours. I guess it's kind of like SQL in that regard.
Kibbee
There are many similarities in the expressions, with the exception of Perl6 Grammar engine. There is also quite a few things in Perl 5.10, that have not yet made their way into other Regexs.
Brad Gilbert
+21  A: 

Javascript is probably the "glue" that holds the client side of the web together today.

A few years ago it was considered a toy language by many. However today the work at optimizing performance by Mozilla, Google and even Microsoft means people are seriously talking about it matching output from an unoptimized C compiler for performance in the next few years.

It's object oriented capabilities are much more powerful than many programmers expect for a scripting language.

You ask about the "next" language to learn, right now I'd say Javascript, particularly when combined with a library such as JQuery, Prototype, Dojo, is an obvious choice.

By the way, regular expressions are a core part of Javascript too.

Ash
+6  A: 

Indispensable?

  • Perl for data analysis & being able to work with...

  • SQL for data storage

  • C++ for the Ultimate Programming Chainsaw Lingua Franca

  • x86 assembly.

Know those 4, and you are a good 80% of the way to being functional in any other language, barring the syntax/libraries/subtleties.

(It's a debatable list, but those encompass the functionalities of Java, C#, LISP, Ruby, shells, regexs, Javascript, and so forth)

Paul Nathan
Well put....(15 chars)
Nate Bross
+6  A: 

Lua or Tcl (or Lisp), to get an appreciation for what you can do in a language with minimal syntax. Smalltalk, because "everything is an object" is a pretty cool place to visit, as well.

Mark Bessey
I'm told that Smalltalk is rather more radical than Python with respect to "everything is an object". Is it?
Federico Ramponi
It really is. From a programmer's standpoint, there's no way to tell that an integer is actually a primitive type, for example. There's a short comparison here: http://www.python.org/doc/essays/comparisons.html which misses a few other crucial differences.
Mark Bessey
One additional thought about Smalltalk: The object hierarchy is incredibly layered, in a way you don't see in most OO languages. So, integer derives from ordinal, which derives from number, which derives from value, which derives from comparable...or something like that.
Mark Bessey
forth (or something derived from it) might be another choice for minimal syntax/language redefinition
jk
I like TCL! In TCL, datatypes don't matter... a string is a list is an array is a map... :-)
Ralf
+1  A: 
  • C++ and C# for "regular" programming
  • SQL - no better for database queries
  • Regular expressions - no better for messing with strings, despite not being what's traditionally considered a programming language
  • OCaml or F# for "expanding your mind" and picking up a new programming "paradigm"
  • Lua, Ruby, and Python for dynamic languages
Chris Charabaruk
+3  A: 

For me, C++ is essential if I had to pick one language. At the low level it encapsulates the machine-level manipulation which is essential for understanding how the computer functions. At the middle level it allows both linear programming (C style) and OOP. At the high level, it has a lot of meta programming possibilities, enough to make almost anyone's head hurt. It also has the most code written for it, the most real-world apps written in it, the most library support, and probably the most money tied to apps written in it.

Other languages certainly emphasize other aspects of programming better, but if I had to pick one for someone to really understand, it would certainly be C++.

Nick
A: 

C++ and x86 assembly language are the only indispensables. If I had to choose just one then definitely x86 assembly for me, because I have to do a lot of reverse engineering and when you don't have the source code there's nothing at all you can do unless you know assembly.

Gerald
+7  A: 
  1. C and some assembly. I also think that non-x86 is better for this.
  2. a mainstream OO language: C++ or Java
  3. a nice scripting language: Lua if you appreciate design, Python if you want 'batteries included'
  4. LISP and/or Scheme
  5. a modern functional language, Haskell, Erlang

You can certainly get most insights with just 1,2 and 4; but in my case i tried several times to get any LISP, and failed miserably. after mastering Lua, it was really easy to get Scheme, that's why i put it in that order.

i still haven't find time for 5....

Javier
@Javier: I've done 6502, 68x00 and x86 assembly. Why would non-x86 be better?
Webinator
it might be a personal preference; but x86 has accumulated so many generations, of half-compatibility that it's currently a huge mess. For educational purposes 68x00 is the nicest I know. 6502 is also a very interesting example of clever design to make best use of extremely limited hardware capabilities.
Javier
+3  A: 

C: as the granddaddy of most current languages. It's like learning Latin, even if you don't use it yourself, it helps you learn other languages.

Python or Ruby: provide great languages that force you to work in a non-C-like syntax.

Everyone should have some time with LISP to be forced to think about the fundamentals of the logic involved in programming.

Some kind of assembler, to force you to think through the details of how the machine actually works.

acrosman
+1  A: 

Wow, talk about a subjective topic. Hmmm ... for my part I'm really glad I learned assembler (I started on 8080), an xBase dialect or two (in my case, dBase II, III, IV and Clipper), various BASIC dialects (too many to list), and Pascal. I've also got a place in my heart for VBScript and, drum-roll, SNOBOL-4.

In terms of string handling and pattern matching, there's nothing better than SNOBOL-4. It's concise and powerful. And I got my current job partly because I knew about it and had written some. It's pooh-poohed these days because it's not 'structured', but it really does deserve more press than it gets.

I've used lots of other languages, including COBOL, Fortran, Ada, Perl and Tcl, but am not as enamoured with them as with the aforementioned.

boost
SNOBOL - now there's a blast form the past. I remember it from college, but all I remember was that it handled strings much nicer than anything else (at the time), and it had a nifty name.
Michael Burr
A: 

The .NET Common Intermediary Language (CIL) as .NET languages are increasingly becoming wrappers for this shared base language. In that way it should be easier to grasp the more subtle details of any new .NET languages.

One way to go would be to read the popular CLR via C#.

Morten Christiansen
+3  A: 

For me:

  • C, probably the most widely understood and portable, always a handy tool
  • Assembler, get some understanding of what your compiler/program actually do (I have even used some embedded in C on an RTOS project)
  • Python, great for testing an idea, writing test code or prototyping something (mostly due to allowing different styles of language)
  • C# (formerly VB), always nice to have a language which makes GUIs quick and easy to generate (at least simple ones anyway)
  • RegEx, I have to agree with Kibbee, besides when you release how many programs support it for searching in text files you really appreciate it
  • Lisp, I know most people hate functional programming, but as a hobby language I find writing functional code more natural then procedural or OO

If I had to pick just one though it would probably be Lisp, since you will see procedural and OO code everywhere, it is worth learning a language that makes you see the problem from another angle (same could even be said for assembly).

DrHazzard
+1  A: 

In my experience, C/C++, SQL and the .Net Framework (mostly C#) (roughly in the order I actually learned them, and applied them commercially) have been the most valuable and/or indespensible.

C++ introduced me to many "modern" programming concepts such as object oriented design, abstraction, polymorphism, et al and also taught me a lot about how software can be very well designed and written as well as very poorly designed and written. I think this distinction is an especially important one in the commercial world, and underscored especially in C/C++ applications (memory leaks anyone?). Debugging, threading, tracing, exception management and profiling all came as standard side orders, not too mention cross platform work.

T-SQL introduced the essentials of database querying and in particular thinking in a relational fashion. Normalization is an important concept to learn when it comes to data storage, so picking up the fundamentals of proper querying had the inverse effect of teaching proper schema design.

The .Net Framework introduced me to garbage collection and memory management which I was unused to coming from the world of C/C++. The major benefit I think here is the introduction of real world rapid application development (thinking commercial implications) which I'd not experienced in other languages/platforms at that time. There are a lot of patterns from C/C++ which are reused in the Framework (and .Net development practices in general) so it was a logical leap forward.

RobS
+1  A: 

I would say you're not missing much, except maybe assembly language. I would learn both MIPS (so you see how machine architecture is done right) and x86 (so you see how it's "actually" done, and the kind of mess your compiler has to deal with when generating code).

There's an interesting meme on Planet.python.org making the rounds where people talk about what programming languages they learned and in what order: http://feeds.feedburner.com/~r/glyph/~3/421073961/programming-and-markup-languages-i.html

My personal list is here.

Dan
A: 

To my opinion, C is a must since its syntax has been "exported" to multiple languages C++, Objective-C (required for native iPhone programming), C#, Java, ... Is like the "Latin" of most european languages!

For scientific purposes and HPC techniques (such as CUDA) I would highly recommend you put an effort in C++

Also it is interesting to know other programming paradigms such as Ruby (a must if you want to quickly develop web applications with Rails).

I have to say though that the triplet :

awk - shell scripting - sed

is quite powerful for fast processing not only big data files but day-to-day activities...

Tryskele
A: 

bash : Once you've finished constructing your beautifully crafted application with layers of abstraction, polymorphic inheritance, and other language bells and whistles,
then you still need to be able to run it in a clean environment.

crowne
+1  A: 
  • Some Functional Language (Scheme, Lisp, Haskell) - to get used not to rely on side-effects.
  • C - To get a clear understanding of pointers.
  • Smalltalk or Ruby - to get in contact with a decent Object System
  • Some Assembly like language - to get to know what's under the wood.
Pedro Morte Rolo