Okay, I did some searching and surprisingly didn't see any thread devoted to this topic. Considering that this has broken out in two threads in coding in as many days, I figure it probably deserves a thread here.

Where to start learning? Something very high-level like Python, Lisp, or Ruby; the standard educational choice of Java; the old workhorse C; or it's younger brother, C++? [List not meant to be exclusive]

All of them. You should know at least three languages after six months.

As for the very first, I'd go for a dynamic interpreted language like python that lets you do the simple "Hi, what's your name?" stuff and various algorithms without getting too much in the way. Don't dwell on it too long, however, and switch to a statically typed language soon. Stick with it for a while. You don't want to become too spoiled, and the bondage and discipline inspires rigor. Do both "enterprise application" and "problem solving" type excercises. One teaches development and design, the other, uh ... problem solving.

It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

For a young child or even someone who really doesn't understand computers the right place to start might be Lego's visual programming blocks used with Mindstorms or something equivalent. A very simple tool that introduces simple ideas like loops and counters.

For someone who wants to know how a computer works the right tool might be to start with C or an assembly language so they learn what the processor and memory are actually doing.

For someone who wants to be able to manipulate a UI the right tool might be a high level language with easy GUI creation tools or an environment like Flash which allows them to get visual results quickly.

For someone looking for an introduction to computer science I'd suggest starting with a high level language which allows them to focus on algorithms and the basics of data structures. Have them switch languages as frequently as they can to get them away from one specific syntax and introduce, functional, procedural, and object oriented languages.

I would actually favor starting on a statically typed language because it allows you to inspect the types you are working with and what they contain. I think dynamic languages just add confusion at first because it is not clear to a new programmer why a statement works sometimes and not others if they are not aware that different types are being used. I'd also want someone to start with an editor that can show them when they make a mistake and not have to wait until run time to find an error if possible.

In case some newbie actually looks here for advice, I find it best to provide some help, and not just a language fight arena:

How to determine the best language for me, a non-programmer, to learn as a first language:What better way to determine the first programming language than to do a programming language to do so for you? This is a step-by-step guide on how to do that.

Load up a python interpreter. In most Linux distributions it's already included, and you can just type "python" in the shell to start it. On windows, you'll have to download it yourself first. If you're too dumb to figure out where and how, you're too dumb to program.Anyway, at the interactive prompt, write "from random import choice". Without going into too much detail (you haven't decided to specifically learn python yet), this means that you load the function "choice" from the module "random". A module is just a collection of similar functions that work on a specific problem domain (the "math" module, for example, contains many math functions, like square root, log or sin). The "random" module is just a module of random functions; things that didn't fit in any other modules. The "choice" function reads a list, and based on an internal database determines what exactly the choices are, and thusly what the question is. It then evaluates the choices, weighing them against each other, and returns the best choice. It might seem like magic, but really, it's full of holes. For example, when asked to choose between "Trance" and "Techno", it usually comes up with "Trance" (the answer might vary, depending on the music library on your computer) when clearly the answer should be "Death metal". When it comes to programming languages, however, it's pretty solid. After all, it's written by programmers, and if anybody has thorough knowledge about programming languages it's us. Therefore, depending on the list of languages you enter, it will determine what you're using this language for and figure out the best language for you to use in that specific case. The best first-language has been debated to death over the last forty years, so we're pretty sure about the answer at this point. You just need to provide a list of possible candidates. To do this, you just type "candidates = " into the prompt and NOT PRESS ENTER. You need to enter the candidates in as a comma-separated list first. Find a list of languages (this is a good source, wikipedia is too). Now enter every language in between two quote marks and separate them with a comma, like this <"language1", "language2"> (omit the <>). Now you have your list and it's safe to press enter, you just need to use the "choice" function. You do this by writing "choice(candidates)". The best language should be written to the screen. If nothing happens, not even a newline, this is choice's way of saying that you should probably find something else to do, like play table-tennis and go for long runs, as programming might not be for you. Don't worry, as you can always invest in Apple Now that you know the language you should start in, ignore it and find a python tutorial. You already know some of the basic syntax and have it installed.

TL;DR:As mentioned in the wall of text, this is a good resource for beginning languages. Programs written in Malbolge are especially impressive, and is a unique experience to behold.

It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

If you want to learn how computers work, you must start with C, then dabble in assembly, and move to C++ as you make larger projects. There are no substitutes for C here, because with C, especially with a passing knowledge of assembly, you can always see just what the computer is doing. C also provides a great platform for learning about object orientation, because the progression from C to C++ is so straightforward. The downside is that if all this understanding of what's actually going on doesn't interest you, you'll give up before learning much -- pointers are hard, let's go shopping!

If you don't care what's going on and just want to do something useful, you should learn Java or Python, or really any other high level language - choose whatever is best suited to the types of programs you want to write. You'll have no idea what the computer is doing, but you don't care. You'll also be introduced to OO in a sink-or-swim fashion, without really knowing why it's helpful, but again, your goal is to do something useful quickly, not to learn for the sake of learning.

If you're interested in the theory of computation, you need to learn some non-imperative languages. I personally like OCaml - clean syntax, and it actually performs okay. Type inference is really cool. You typically won't be doing practical things, and it's difficult to understand what's going on behind the scenes (hint -- lots and lots of singly-linked lists), but your programs will have a kind of elegance about them, and you might even understand lambda calculus.

Now, if you're in it for the long haul, you will ideally do all three. I put myself in category one, and while my first introduction was to QBASIC (an interpreted non-OO language), I moved on to C, where I actually started to understand how the computer worked. I've also done some things in higher level languages, and used OCaml at my university.

I think something lisp-like would be a good starting point--the machine would be abstracted away to a large degree so they can focus on programming. Later they can move to something lower-level to get a better feel as to what the computer is doing. Then they can move to Lisp

I learned to program in BASIC on the TI-83 first. The programming syntax was the same as the mathematical syntax on the main screen. This, and the fact that it was an interpreted language, made it easy to write little formula-helpers and cements the concept of programming as statically typed math. For the first few days/weeks, keep the manual around, because the error catcher is very unhelpful. The combination of the weak error handling, clunky manual, and simple syntax, teaches you how to debug programs without it listing every mistake, as well as teaching you to get it right the first time. All variables are initialized by default, and variable identifiers are limited to single letters. Lists are 5 letters prefixed by a subscript L, so you can learn to make a program without having to fight the program. It also lets you initialize variables outside the program, introducing the concept of file IO, again without fighting the language/OS/other processes. The last benefit is that it is abominably slow, so newb programmers don't get too ambitious, or if they do, they can still see what is happening.I personally learned to program like this, then learned how computers work before learning a computer language (Java in my case).It effectively teaches you to program without teaching you a language, so when you do learn a language, you can start with some knowledge of programming, as well as having a few of your own programs for you to practice translating.

<quintopia> You're not crazy. you're the goddamn headprogrammingspock!<Weeks> You're the goddamn headprogrammingspock!<Cheese> I love you

Micron wrote:It really depends on the noob and what they want to learn.

I second this.

My first ventures into programming were with BASIC and I got nowhere with it. It wasn't until I stated making websites for fun and played around with JavaScript that I honestly considered myself any good at programming. I absolutely loved being able to think up problems and solve them, and being able to see my results pretty quickly. Plus, the knowledge I got from JavaScript helped me considerably when we were taught Visual Basic at uni. I didn't bother studying for written VB test because I already knew JavaScript and I could work my way through the code

I think, more than the n00b or what they want to learn, it depends more on what they want to do. Learning C or Python would seem completely useless if they wanted to make websites. Equally, JavaScript or PHP would seem pointless if they wanted to build executable files

I have to agree with Berengal that if you want to be a programmer, you need to be insatiable in your thirst for languages (assuming a baseline for quality thereof; brainfuck would not count). However, the first language you learn is indeed crucial to how you learn other languages.Allow me to put all languages in the following categories:

I strongly encourage everyone to know at least one language out of each category and as a minimum, two to three in the category of their preference.

Getting back to the topic at hand, I would choose a language that is flexible enough to be able to setup test apps and act as a base of knowledge for learning other languages. Most importantly, however, the language should engender strong fundamentals of computer science in the learner that a pervasive through every aspect of our trade.

Along these lines, I consider recursion to be an intermediate-level topic (unless the learner has strong fluency with recurrence relations or automata theory [but then you should know other languages anyway]) and so I would not suggest a functional language to start with.Similarly, I do not find scripting languages to be quite as vigorous as I would like in the CS department. Python probably would be the best of the bunch, but I don't know it well enough to make a definitive suggestion.Procedural languages are not a bad choice, but I find that starting with a language like C or C++ can be overwhelming to new coders (assembly is definitely not an option..) which would be counter-productive to learning other languages.So, to me, this leaves us with OO languages. I would again exclude C++ due to its complexity and lack of safety. I personally gained much of my CS experience from Java and don't regret any of it. However, after learning C#, I have to admit that the C# paradigms, practices, and structures are much more consistent; rather than having to explain the difference of primitives and classes, everything inherits from System.Object. Type checking and intelligent compiler errors allow for a quicker learning curve and the Visual Studio IDE, is, in my opinion, the best IDE on the market. For students, the full software is free via MSDNAA and also the Express edition is free to everyone else. C# also lends itself to functional languages through its own recursion and .NET allows you to mix project types of different languages in the same assembly, which would allow you to call methods in F# as if they were written in C#.

Basic procedural languages and scripting languages should not go unnoticed either. I find that scripting languages tend to be more compatible with functional ideas because of their dynamic typing. I also strongly support "getting close to the metal" with C/C++ and assembly.

The most important thing is making sure you have a lot of tools in your belt to choose from because for every project there are several options, but only one right choice, and having experience in every option makes making that choice a hell of a lot easier.

You forgot to mention Smalltalk in the OO list, which I find odd, considering it is the most "pure" OO language, and was originally designed with the beginner in mind. That said, I probably wouldn't recommend it, as it has never been well-implemented, and it gives an extraordinarily skewed view of programming.

I learned C when I was in third grade. Its an easy language simply because it has so few syntax elements and libraries. Now, doing complex things in it can be more difficult--but the basic concepts can be summed up in a couple pages.

I'd say the best three newbie languages are C (NOT C++), Java, Python, and Scheme, depending on how you want to approach the problem of learning programming.

It was designed to be both easy to learn, and to teach good programing habits. It's interpreted, meaning you don't run into the sorts of confusing errors compiled languages can give. It also is used in many real world applications. For the average person wanting to get into programming it's the best first step, and it can produce very useful results if it also is the only language learned.

Now, if you're an electrical engineer for instance I'd recommend C (but only after you've learned an assembler), and there are other special cases that make other languages look better, but yeah, Python is the general answer.

Game Maker Language. It's the language for this program called Game Maker. It actually sets you up for coding really easily, it has everything you need, it's also more motivational cause you can create your own computer games. So it prepared me for C++ a lot.

-Summer Glau

P.S. Don't forget to check out the next season of The Sarah Connor Chronicles this fall on FOX!

I'm with one of Scheme, Python, or Ruby, leaning toward Python just due to the libraries that exist for it. Hell, it'll train you on non-language issues like respecting a coding style too.

After that, though, I recommend as many languages as possible. You'll want to know something low-level like C, because it's cool (if a bit messy) and useful for unix programming (plus math geeks like to pretend it's faster). You'll want something high-level like OCaml or Haskell or Lisp. You'll want to get *good* with at least one of these, because really wrapping your brain around a non-imperative language is excellent mental exercise. You'll want at least one of the web languages like PHP or Ruby because it's really useful and fun to do web apps! A few of the utility languages that go along with that (sql, html, css, etc) are really nice to have as well.

So, that's a lot, but you work through them gradually. I learned most of what I know about coding from the internets. I learned what *not* to do with coding from the internets too!

any of the modern scripting languages make a good starting place for a high level language, they offer the chance to see instant results and do something that a beginner can appreciate quickly (gui toolkits ftw!). you also want to look at a low level language (maybe not straight away but don't leave it too long) C is an obvious choice, but there are also a variety of assembly langauges that are much simpler and easier to learn and may be better if you are finding the high level language slow going.

implementation +environment is as, if not more important than language choice. e.g. if you want to learn C its worth making sure your compiler gives decent errors and warning. some very good, in terms of optimized executables, compilers skimp a bit on the diagnostics. also you will need some sort of ide and/or editor, its worth thinking about this as well as if its new to you you will need to learn that at the same time.

I don't think the efficiency and effectiveness of a beginner language really matters much, because if you're going anywhere then of course you're going to branch out to more complicated and useful languages. I think the main point of a beginner language should be that it's easy to code and understand and builds a passion for programming that can be taken towards a more confusing language, as well as introducing a lot of basic concepts. The point isn't to immediately pummel the new programmer with functionality and usefulness, because if they're going to be programming seriously they'll get to that in time.

To that end, I think C and Assembly (especially Assembly) would both be terrible places to start because the confusing aspects could turn off someone new to programming. Something like Python is friendly enough to tell the potential programmer "see, programming can be fun" which should be enough to motivate the new programmer towards learning more complicated things. But I don't think anything could turn off a potential programmer more than a complicated (even if incredibly powerful) language that makes learning programming a chore.

I strongly disagree with your opinion that complication and usefulness go hand in hand, which is what I take this statement to mean (if it's not what you meant, then just ignore).Python is simple yet incredibly powerful. Some, including me, would say that it's simplicity is what makes it useful. As for power, well, C is a more complicated language, but I wouldn't say it's more powerful. In fact, I'd say that if a language is complicated, then that's an indication that it's less powerful than a simpler language, because the complication stems from having to construct the tools the simpler language already has to do the same task.

It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

I strongly disagree with your opinion that complication and usefulness go hand in hand, which is what I take this statement to mean (if it's not what you meant, then just ignore).Python is simple yet incredibly powerful. Some, including me, would say that it's simplicity is what makes it useful. As for power, well, C is a more complicated language, but I wouldn't say it's more powerful. In fact, I'd say that if a language is complicated, then that's an indication that it's less powerful than a simpler language, because the complication stems from having to construct the tools the simpler language already has to do the same task.

So, If they are really into it, they can try to implement the same thing in different ways to learn the advantages and disadvantages of each paradigm.

IMO learning a language like Java and/or C++ near the beginning of you programming life is a good idea because it shows you the different ways of doing things. Then you can move towards a language (or stay with those) that has more of the features you like.

I loved the Object Oriented aspects of C++ compared to say writing the same program from a imperative standpoint.

C++ was the second language I learned (after BASIC) and IMO the language that taught me the most about programming. Now a days I prefer languages like Ruby, Smalltalk or Pyhton to C++ but depending on what I am doing I'll use C++ still.

ash.gti wrote:Starting with a multi-paradigm language IMO would be a good idea.

So, If they are really into it, they can try to implement the same thing in different ways to learn the advantages and disadvantages of each paradigm.

IMO learning a language like Java and/or C++ near the beginning of you programming life is a good idea because it shows you the different ways of doing things. Then you can move towards a language (or stay with those) that has more of the features you like.

I loved the Object Oriented aspects of C++ compared to say writing the same program from a imperative standpoint.

C++ was the second language I learned (after BASIC) and IMO the language that taught me the most about programming. Now a days I prefer languages like Ruby, Smalltalk or Pyhton to C++ but depending on what I am doing I'll use C++ still.

Given that you can use Python as if it were imperative or functional, it still wins

I strongly disagree with your opinion that complication and usefulness go hand in hand, which is what I take this statement to mean (if it's not what you meant, then just ignore).Python is simple yet incredibly powerful. Some, including me, would say that it's simplicity is what makes it useful. As for power, well, C is a more complicated language, but I wouldn't say it's more powerful. In fact, I'd say that if a language is complicated, then that's an indication that it's less powerful than a simpler language, because the complication stems from having to construct the tools the simpler language already has to do the same task.

I didn't mean that the two go hand-in-hand. I probably should have said "more complicated and/or useful languages." What I meant was that a beginner language doesn't necessarily need to be either of those things. The purpose should be ease of use above all else, so long as the language has concepts that can carry over into more advanced programming.

What I think is great about Python is that it is easy AND powerful, so it's useful as a beginner language and for more advanced programming. I didn't mean to imply otherwise.

zenten wrote:I'm pretty sure that C++ and Java can't be written as a functional language. They don't have anything equivalent to lambda for one.

A simple Lambda intupritaion for C++ would be Boost.lambda

Or you can use http://okmij.org/ftp/c++-digest/Functional-Cpp.html as a guide for adding in a lambda function (basically it uses macro's and preprocessing to generate the lambdas before the code is compiled, so its not a true lambda but it functions like a lambda)

Java... beats me, but I hear in the next 'big' release of java they are adding lambda's as a built in component. They are also adding in lambda's to C++ in the C++0x standardization but no compilers follow it currently that I am aware. see http://en.wikipedia.org/wiki/C%2B%2B0x# ... xpressions

ash.gti wrote:Java... beats me, but I hear in the next 'big' release of java they are adding lambda's as a built in component. They are also adding in lambda's to C++ in the C++0x standardization but no compilers follow it currently that I am aware. see http://en.wikipedia.org/wiki/C%2B%2B0x# ... xpressions

There are a couple of proposals for ways to add lambda expressions (closures) to Java. Unfortunately none of them are very good. There's an interesting discussion here you want to look into it or start a new thread here so we don't derail this one.

yes template programming in c++ is pretty pure functional programming (the syntax sucks ass though). i really wouldn't go for java or c++ as 'my1stlanguage' though, they are just to big and in the case of c++ UB issues cause no end of learning difficulties.

if i had to recommend a syllabus for all beginners i'd go for python and an assembly (a simple one rather than one which people actually use). but, of course, there is no need to have 'a one true way', if someone is interested in programming language theory i would recommend tcl over python and maybe an esoteric language

While I clicked my fav'rite bookmark, suddenly there came a warning,And my heart was filled with mournng, mourning for my dear amour."'Tis not possible!" I uttered, "Give me back my free hardcore!"Quoth the server: 404.

I think Scheme/Lisp is the best choice purely because you get to use HTDP as your learning book (http://www.htdp.org/2003-09-26/ , read the preface for why its so good) but Python certainly isnt a bad choice either.

Things like C/C++/Java/C# arent good ideas imo, the former 2 because they are too low-level and ugly, the latter 2 because they are ultimately languages geared towards large-scale corporate development and hence come with a lot of machinery which gets in the way and annoys you when youre just wanting to write programs (eg having to use OO for everything whether its a good idea or not). Ideally you should understand all the code you write as you go along, and telling someone to write

ultimately though most languages are fine for beginners as long as they arent either a) too low-level, b) geared towards corporate use, or c) Perl. You wouldnt go wrong with Scheme/Lisp/Python/Ruby/OCaml, whatever.

Besides, scripts can be written in any language. I've written scripts in java. Sure, it had to compile first, but really, how much of a hassle is that for a 20 line program?And you can write programs in scripting languages as well. Just look at stuff like youtube and EVE online.

(I define script as any short, single purpose program, usually writeable in a couple of hours. Programs are longer, take longer to write, and consists of several files, not all of which need to be executable (libraries))

I thought the most-used categories were imperative, object-oriented, functional and logic programing. Object-oriented doesn't actually DO anything, so you still need to combine imperative/declarative structures to get something working.

It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.