I will probably start with C and then Lisp. Although I started programming in C, I did not program in it as much as I want. It's fun working with the low level stuff. Learning C helped me a lot when I started working. I've only started learning Lisp now and I found it amazing that the concepts it supported from the very start are still very relevant today. Well I think it's better late than never.
views:
575answers:
14I dunno if I would have learned it FIRST, but I would have liked to learn Ruby a long time ago... it's such a fun language to use!
I would have started with C. After 8 years of programming, I still think C teaches things that higher-level languages simply can't. Mucking around with pointers is frustrating and difficult at first, but it teaches you a lot.
Even if you never use C again, it's worth learning because it gets you so much closer to the machine. (I think assembler is a step too far, because it gets you so close to the machine that it's difficult to get anything useful done, especially for a beginner.) C is also still the lingua franca of programming, and will likely be for a long time.
After C, I would go with either an object-oriented language (for learning OO) or a functional language (for learning recursion).
I learned Pascal, C++ and Java first, but I remember how hard it was getting all the syntax correct in the beginning. When you first start learning you shouldn't have to worry about public/private method declarations or final and static modifiers. It takes a lot of patience to accept the explanation "you'll learn what those mean later".
I would say the better languages to learn are the ones with the least syntax and fewest declarations. I would say Python or Scheme would be languages I would want to learn first. They are not kid languages and have plenty of power when you've learned new techniques.
For example, what would be better for someone who has never seen code before?:
In Java:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
In Python:
print "Hello World!"
In Scheme:
(display "Hello World!")
Well, for my FIRST language, I would learn something simple. A 4GL is fine, to get the feel for what programming is all about. Then I'd learn C/C++ for the nuts and bolts. Followed by C#, Java, or another high-level language for the productivity.
I concur with the C recommendation. You can get your hello world app compiled and running in a couple minutes even if you're a total novice. After that, any concept that's central to data structures and programming can just be tacked on bit by bit -- pointers, classes, exotic data structures, interesting algorithms. IMO, syntax in most languages is really a non-issue (perhaps some significant whitespace issues excepted). You learn more about what's going on under the covers, and it's easier to learn about the importance of efficiency. Starting with a higher-level language adds a lot of mystique to the equation, and I think it would be ultimately harder to solve real problems in that language if you don't have the fundamentals. With a knowledge of the lower-level stuff, you can better appreciate how the higher-level languages can make you more productive for specific applications, and you can better decide which application is best suited for which language/framework.
I wish I learned Pascal first. It taught me structured programming in a way that Amstrad BASIC and CP/M Assembly really failed to do. I had an easier time making worthwhile programs with it than I did with C too. Ruby is definitely in there but I still wish I'd learned Pascal first.
I'm not sure if the exact languages to learn are important. In the beginning it is important to learn the concepts and get an idea what programming is about. When you know the concepts, learning a new language is easy.
I would pick one low-level language to learn the nuts and bolts and one high-level language with nice framework/API to learn OO and advanced programming concepts.
For low-level languages there aren't too many candidates that would be of help in the real world. C is the safe bet.
For high-level languages I would pick one that would match with your future interests; C# for Windows guys, Java for J2EE backend work, C++ for Symbian or Ruby/Python for the admin-oriented script wizard.
I would start with a functional programming language first (e.g. OCaml, Haskell,...). If you start with C or even worse Java (like I did), you will start thinking that imperative/object-oriented programming is the only way to solve a problem - even if the solution is more intuitive in a functional programming language.
Hence, I would recommend the following order:
- OCaml -> functional programming
- C -> pointers and memory allocation
- Java -> object-orientation
or probably
- C
- Scala -> integrates features of object-oriented and functional languages
My first class was a level 400 C++ class. Don't ask me how I managed to wind up in there, I'm still trying to figure that out.
Since it was my first class, I had no idea what anything was(no loops, no statements, nothing!). I managed to just pass with a C-, but I wouldn't trade it for the world.
In fact, if I could go back, I would pay more attention to the data structures and design pattern units.
Python, because is a simple and straightforward way to start learning programming, and at the same time a tool for writing real-world applications.
Definitely not C because is to complicated for a first programming language as Peter Norvig in Teach Yourself Programming in Ten Years and Eric Raymond in How To Become A Hacker said it.
Personally as a database specialist, I wish more deveopers would learn a flavor of SQL first. I see far too many pretty user interfaces that display the wrong data or are slow becasue the developers don't know SQl well enough to performance tune it or to determine if they did get the correct result set.
I'm surprised with people selecting C as the very first language. I don't remember many things from C, but I don't see any advantage in using a language which doesn't have classes.
I would start with a pure OO language. Eiffel would be my choice. I think this teaches the student the most important concepts in a very clear way. Later, yes, in the context of a broad learning list for a Software Engineer, I'd certainly learn some low level language. But not as the very first learning subject.