Programmers! What language for a total novice?

I work for a tech firm but I have no background in programming whatsoever.

As an intellectual stretch I’d like to try learning some basic programming, just to see what it’s all about.

Looking around there seem to be a load of different languages commonly used… java, C++ etc

I’m tempted to start with Python, as I’ve heard it’s a reasonably straight-forward way of programming.

Any one got any better suggestions though?

I wouldn’t start with Java, C++, C# etc. because right from the start you would have to deal with object-oriented concepts, which would be pretty heavy stuff for a novice. Python is a good choice. Usable for everything from simple throwaway scripts to big, serious applications. It’s ease of use might spoil you when you move on to other languages though! The other thing against it is that its syntax is slightly different from the Algol-style syntax common to most of the other popular languages. That’s no biggie, though.

There have been quite a few threads on this subject, btw.

Cheers, I’ll have a look in the archives.

[Mod mod]Pluralized “Programmer” in title per request of OP.[/Mod mod]

I agree. Python.

I agree with Python as an excellent starting point, it only takes a few hours to get started, it has a robust MVC/ORM framework for developing web applications(django), fully featured science and math support with scipy and numpy, and a great charting/graphing api(matplotlib). It can also live inside of a jvm web container like jetty or jboss thanks to the jython project.

If you want to learn just a little bit of java you can try writing some Android apps, its small enough sandbox, so you won’t get lost as long as you stick to the tutorials.

Python or PHP. PHP is easier to learn, IMO, also tightly integrated with web stuff, but Python is more powerful and more useful in the long run.

BDoors, I think it’s a *good *thing to start with objects right from the start.

PHP is a scripting language as opposed to Python, which is a high-level programming language. The two are not the same.

I think the OP wants to dabble in programming, not scripting.

Before you even know the real basics, like what a variable or a loop or a conditional is?
Maybe I’m biased because when I started, there weren’t no such thing as objects. I still view them with some suspicion :). You can do a hell of a lot very nicely with good old procedural code.
But true, if you have any aspirations to be a serious coder, you do need to be comfortable with OOP.

I personally think Java or C#, Object Oriented programming is pretty popular now. It’s a little more difficult to start off with than straight procedural, and you’ll probably make a few errors that make your code slower because you don’t know the procedural stuff. However, in my experience the people who started off with something like C and other procedural languages tend to get confused with Object Oriented languages, whereas people who learned Object Oriented languages tend to simply think of programming in C and Assembly “the longer to code in, but faster to run way.”

However, Python is a good enough language that’s kind of “hybrid” procedural and Object Oriented that it would be a good place to start in my opinion, my only worry is that you’ll be lost if you try to move to a language with strict, static variable typing (which is most of them).

I will suggest Javascript. You already have it in your browser, you don’t need to install anything or work in a special enviroment. It’s simple, easy to learn, and easy to work with. It is also a useful and marketable skill. Personally, I find Python to be a little odd, but my perspective is colored by decades of programming in many different languages (some much odder than Python).

A big factor in your choice would be who you know that is adept at using the language. Beginners can get stuck easily on a simple non-intutive operation that a friend can get you past quickly. There are similarities between writing programs and writing in human languages. You need to develop some proficiency in spelling, punctuation, and an expansion of vocabulary and phraseology. Getting stuck on minor technical points will not help in that regard.

Learning programming will probably take you through several stages (not necessarily in this order):

  1. The basic steps to creating and running the simplest of programs. This involves using an editor or studio to code in, saving and running the code in some environment.

  2. Learning the primary commands, functions, and expression operators and operands and the syntax rules. Then using them for basic operations.

  3. Learning the fundamentals of programming that involve the use of variables, arrays, subroutines/functions/methods, parameter passing, inheritance, etc. that make the difference between ‘hardcoding’ and ‘algorithmic coding’.

  4. Learning how to organize and debug code (these tend to go together).

  5. Learning more advanced techniques. This ranges from simple things like data conversion and i/o interfaces to more complex matters like recursion and abstraction.

  6. Learning to utilize these skills in a practical manner. This is largely about creating ‘user-friendly’ interfaces, but also involves certain types of high-level optimization and project planning.

  7. Staying up all night implementing techniques and tricks you learned in a really cool program. This is followed by a general degradation in personal grooming and communication skills. Then you want to do it for a living because why shouldn’t you get paid for having fun instead of working for a living?

I’d say Java or C#. C# is not good if you want to use any OS other then Windows (in theory it should be cross-platform, but nobody’s buying into their runtime).

In my experience, C# is very elegant and well thought out. Java grew like Topsy and can be a pain, but not too bad once you get used to it.

Anyway, why go to some limited language when, without significant extra trouble, you can use a full-featured one. There’s no law saying you have to delve into the subtleties of the language, but their there when you feel like it. The alternative is to reach the limit of what you can do with a more limited language, at which point you have to learn another one.

I wouldn’t recommend either C or C++. They’re more difficult. You would get a better idea of how programs work from C (it’s quite low-level, about as low as you can go above assembly), but I doubt that’s what you’re after.

Haskell. You can start off using the language merely as a calculator and get more and more complex. Read Learn you a Haskell for Great Good! for a good tutorial.

I’ll toss out another idea, which is find a somewhat chatty programmer (they do exist) at your workplace and ask them. Pick that language, you instantly have a buddy to talk shop with.

If you do pick Haskell (and, let’s face it, who wouldn’t?) there’s a very active mailing list dedicated to beginners which you can sign up to here.

SmallBasic, from Microsoft.

Quite aside from language choice, what do you plan to do with the language? You don’t learn any language until you code something in it, and writing “hello world” programs can get old fast. If you want to do a website with some nice functionality you’ll need a different language from what you would need for some large scale data manipulation.

Also, if you want to change careers it might make sense to start with C++ or Java, but if you are doing it for fun these might be too complicated. In any case, you’ll appreciate their benefits much better after you get tangled up in data structure access.

This is a nonsensical distinction. PHP has the same capabilities as Python.

That said, PHP is a giant ball of shit and should be avoided at all costs.

I’m going to go against the flow here and say it doesn’t matter: I’d pick C++ or Java just because they’re the most generally used, and folks tend to prefer the language they start with.

Learning programming is a process of learning decomposition of problems into algorithms, how data and information flow through a process, data structures, encapsulation, and modularity. It’s the process of learning to think in a step-by-step model about how to do things, then implement that.

I’ve taught a lot of programmers to program, and the above is the hard thing to learn. The syntax of a language is almost irrelevant: from the hurdle of getting from “not a programmer” to “a programmer,” the language choice is a blip – the hard part is learning to turn a word problem into a program.

The only languages I’d stay away from as a beginner are the “academic” ones like Haskell, ProLog, and the various Scheme/Lisps. They use a fundamentally different breakdown of problems into algorithms, which makes it hard to transfer the skills from them into other languages. They’re explicitly designed to allow you to solve certain problem types by “hiding” the complexity of something (data structure manipulation for Lisp, constraint searching for Haskell/Prolog) from you. That’s fine if you only care about the specific problem domain they’re built for, but doesn’t help much for general-purpose programming. By all means, learn them, but do it after you’ve got the basics of a standard procedural language.

PHP is very popular and will get you a lot of work. But let me tell you something, I used to work in computers and I’d have to contract out for a programmer and if I had something that had to be written in Python it was A LOT more expensive, 'cause there are fewer Python programmers

I would say PHP is the best place to start if you’re learning on your own, simply because there is so much information and so many forums where people can help you. Python is a good second choice.

Eventually C++ or C# will be usefu