What languages would you suggest a programmer to learn, not because they will have a lot of use of the language (but they may have), but because it will improve one's programming skill in general and let one think in a different (and possibly better) way?
It has OO features that are not your usual OO features. It is well-suited for higher-order functions and closures, and you routinely use these. It allows for many functional programming tricks. It is enormously flexible.
And it's practical, because every serious browser has it.
(Of course it has a number of unpleasant quirks, too. Few practical languages don't)
I would suggest Scheme.
It's a functional programming language derived (most actually think it's a dialect) from Lisp. The main difference with Common Lisp is, its approach is very minimalistic - extremely so. For instance, in a normal distribution of Scheme (any scheme < R5, or Mit/GNU/Scheme) you won't find a loop implementation: you'll have to make your own using tail recursion.
It's really expressive and its syntax is great to learn something new about programming, as in: just looking at the code, you get an idea of how the compiler/interpreter will work its way trough it.
Plus, it comes with the Best Programming Book Ever, Structure and Interpretation of Computer Programs, freely downloadable on the MIT's website.
Here are some video lesson that, I hope, will immediately get you interested in this fascinating language - the speakers are the authors of SICP: http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/
LISP, preferably Scheme in combination with Abelson & Sussman's "Structure and Interpretation of Computer Programs", will teach you to think in terms other than those imposed by C/C++.
FORTH, specifically a block-oriented FORTH, not a file-oriented one (such as D85) will teach you to curb your loquaciousness. When you cannot under any circumstances whatsoever write a routine longer than 16 lines of 64 characters, you are forced to abstract and factor.
Java is one of the languages taught most at universities worldwide and there's a reason for it. Though it's often Dinosaur-like, it gives everyone a very good overview of the Concepts of modern programming. It does NOT show you how the computer itself works like Assembler or even the already-much-much-more abstract language C. But Pilots have to be able to fly and not to be able to Build an Airplane on their own - go learn JAVA as a good Basis for any Code you'll write in the (for a reson) most common languages nowadays: Java, c++, php, c#, ruby(on rails) python and so on...
Hands down, I would say Haskell. And for two reasons:
- It's simply the best way to learn functional programming. Just about every other language allows side effects by default, but can do things functionally (and yes, this includes the MLs and Erlang: see this talk for more info). Haskell is functional by default, but can be made to use side effects when you need them.
- It's definitely a language that encourages you to think before you code. To be honest, this has never really been a problem for me (if anything, it's the exact opposite). That said it seems like I'm a minority. Most of the programmers I've run into seem to be more of the "code first, ask questions later" mindset rather than the "ponder your problem for days before coding the solution in 5 minutes" mindset (which tends to be my mindset). Therefore, this kind of language can provide valuable experience to most programmers.
I would suggest Scala if one is come from C/Java world.
It is not purely functional programming language, but it use OO to simulate some functional programming features (ex. Using object to simulate first class function and high order function).
So if you are familiar with OO, Scala uses terms you already knows to explain the functional world.
I found it is easier for me to understand functional programming in Scala rather than dive into a more functional programming like Haskell, List...etc.
The functional languages are the ones that I feel helped bring me to where I am today. Even though I'm in web application development, the concepts learned from functional languages help me see solutions to problems that I otherwise wouldn't have seen. Here are the languages I worked with in my university:
- C++ (Not functional, but concepts like pointers and memory management are invaluable)
- Dr. Scheme
- ML/Ocaml (We wrote another language using ML/Ocaml!)
Learning these languages will help you understand the world of abstractions, and how to build blocks of code that encapsulate other functionality, hiding the low level details so you can focus on the high-level business goals.
There are a number of programming languages that will require that you think about a problem in a new way (relative to what you are used to of course.) The most common languages to learn having been taught a imperative language, is a functional and a logical language, for instance prolog and lisp.
Some languages are heavily influenced by category theory, like ocaml and Haskell and some are cross breed languages like Curry (functional and logical). Curry is probably the most mind blowing language that I know of, not just because it got all the mind blowingness of Haskell with logical programming, but also because of the integration with constraint based programming.
A well-rounded programmer has several bags o' tricks up his/her sleeve, and these include:
- Assembly, for learning how the guts of a computer works.
- A procedural language such as C or Pascal.
- A functional language such as Scheme.
- An OOP language such as Squeak.
These all teach you slightly different ways to think about and approach problems.
you won't learn correctly any programming language without a clear target. Knowing what you want to do with it,then you can decide which program suit your needing.
For example, let's say about c#.
C# can do web program, console program, stand alone executable, gaming program, silverlight program and mobile program. While the syntax is equal in almost every case but it works differently in every scenario. For example, a stand alone executable keeps their information until it is unloaded or the program is finished, while a web program, the information is destroyed every time you load a page, and in silverlight, you will spend most of the time, struggling with a xml file.
And second, don't spend your time with exotic languages (Haskel for example), corporate speaking, there are very few program worth your effort :java (king of the hill), c#/vb.net, php and sql.
There's a very simple program for writing Java Applets called Processing
This language will give you a very basic understanding of variables, loops, and that sort of thing, if you're just starting out.
Some great suggestions here. I'd probably go with C or C++ personally. They force you to deal with a lot of concepts that matter greatly in understanding how things work, but that tend to get obfuscated in other languages. Just understanding how things are really working is going to help you as a programmer even if the language you're using later hides some of the details.
Assembly is fun if you want to dig in even a bit lower level then that, but don't expect to get a lot done with it. :)
I would recommend Ruby. Ruby doesn't demand that you change paradigms, but it encourages you to work in multiple paradigms. I think that advantage of this is that instead of being frustrated with not being able to work they way you are used to, you use a different paradigm out of frustration with the limitations of doing things the way you are used to.