I completely agree that the most important thing is to have a concrete objective that you really want to achieve that you are moving towards.
However, I disagree that every language is equally hard. There are three challenges in learning programming: syntax, logic, and resource management. Those can be optimized for beginners:
Syntax: A syntax that is more natural and less symbolic will be easier to learn. There is a lot to be said about brevity for experienced programmers. For new programmers, it is completely wrong.
Logic: While certain, highly mathematically-inclined people may be different, most people understand the concepts involved with imperative programming (I do this, then this, then this; if I do this thing a lot, I can abstract its concept; etc.). Functional programming, "pure" object oriented programming, etc., are concepts that add impedance.
Resource Management: Whether memory, pixels on the screen, or bytes to a network connection, you've got to interact with the hardware at some point. Different languages approach this in very different ways, from manage everything directly to nearly complete abstraction.
Trying to learn all three at once for any but the most highly motivated is a recipe for frustration and, ultimately, failure.
On the flip side, it really makes little sense to learn a language that is useless for what you want to do. If what you really want to do is program a microcontroller, it is my opinion that PHP or Python would be a very poor choice in first languages.
Having never done embedded work, I don't have an opinion either way. There are people successfully doing embedded work with Python, though (http://stackoverflow.com/questions/240996/anyone-using-pytho...), though I would probably choose Lua over Python in most cases.
If I were teaching somebody who wanted to do embedded work (and Python/Lua/<insert "easier" language here> really wasn't a deployment option, which is very feasible), I would start them with Python to get them to the point of understanding how programming works, then switch them to a more appropriate language for the project. Teaching the algorithms in Python, then converting them to C is a great way to learn the difference between the languages and to introduce the resource management that occurs.
That is also why I prefer Python - I'm not a computer scientist, I am a business owner who uses programming as a tool to achieve my goals. Sometimes it's 2 weeks or more between writing code and Python is by far the best language that fits into my workflow.
NASCAR isn't a legitimate sport, it's a spectacle. Any time one car gets too far in front of the others a restart is issued. Various owners have openly admitted they do this "for the fan's excitement".
To make it easier for a newbie: Choose Python if you want to learn programming for yourself - lean, lots of bindings for C-Frameworks, not much surprises and a big community.
Absolutely true. If you have a certain task to do (programming a wordpress plugin, etc.) - the programming language chooses itself :)
If you don't know yet, Python would be my best bet.
My first language was QBasic i think, been through VB since then but i can't remember anything. I then began learning C/C++ which i still understand to this day but i keep a book close. Since then mostly Python and Ruby but really only Ruby since 2007 or so. I feel i have good understanding of code now at 22, still without CS education. I helped my friend with Java problems his second year in CS without having used Java past hello world, i know there are holes in my knowledge based on lack of experience but i feel i can read most languages without much trouble now. I think the main objective of learning to code should be to learn how to think as a programmer, learn how to understand code and really most importantly learn how to search the web.
Once you can master understanding programming syntax regardless of language, how to write good code and how to solve problems then you are well on your way to becoming a good developer.
Probably some people would kill me for that answer but i would say you should learn PHP.
PHP is simple, good documentation and great community.
Facebook is built on top of PHP so as Drupal and Wordpress.
But the main point about my recommendation is that PHP is installed everywhere, you don't have to spend much time configuring and doing sysadmin stuff to make it work.
I started with Qbasic and did my first more ambitious projects in PHP. I agree that it is really easy to get started, but the horrible security holes I created are the downside;-)
It really depends on your goals and background I would say. At my school (education school) the point isn't to create students who can compete with computer science majors next door. Rather, we focus on getting students to 1) be able to understand the basics in order to communicate with more experienced developers and 2) quickly be able to create interactive visual programs for pilot research and the classroom. For us, the purpose is split between programming theory and folding in their learning and instructional theory into design. I used to teach Java which is great for focusing on OO concepts but the end products that students were able to create didn't necessarily match their visions. This discouraged a lot of students and turned them away from code. So sad!
Currently, we use Flash with a focus on OOP with ActionScript 3 (not timeline based loose junk). The advantage of this is that they can easily create rich assets in a simple and familiar environment to make the code part more genuine and purposeful for them. I've found that if you teach it this way they are very motivated to learn the programming concepts to realize their visions which are usually heavily tied to the visual and surface levels of a project. Gotta admit things you directly see are pretty sexy to many people. Once this "wow" moment is satisfied, it's much easier to point them in directions that go back to the programming theory to improve the depth of their work.
If you have a purpose and drive to want to accomplish something concrete you'll stick with the ups and downs so a programming language that supports that goal I think, is an appropriate language. It works well for us, the class is immensely popular and many of my students are very curious now of other languages like JavaScript, objective C, etc. The concepts transfer well too and some have even transitioned toward development. You can always learn new languages later although one commenter poses a good question of how one's starting language influences thinking. Don't have an answer for that one. But, my take is just try to get a good foundation with a language that supports what you want to do.
NOTE: I learned to program myself, and sought out specific programmers I admired to teach me so I don't have the experience of what a typical compsci program and curriculum is like. You might seek those opinions too. I would consider myself pretty darn good at understanding education and learning matters though so if you want any pointers, advice, or questions I'd be more than happy to discuss on this thread. I'm excited that you want to dive into programming. :-)
Could always do it the academic way.... C, then C++, then Java, back to C++, back to Java. Once you graduated you will have learned no language mastery, just how to to think like a programmer... If that is what you want
At my school, CS classes started in C, did a touch of PHP/JS, then a functional language (was scheme, now OCaml), and then a giant hodgepodge of whatever you/the professor wanted.
We started with Scheme, then in the second year C++ and some Common Lisp. Later Smalltalk. You learned Java on your own, which is near trivial if you know C++ and Scheme.
Once you graduated you will have learned no language mastery, just how to to think like a programmer... If that is what you want
Which, honestly, isn't necessarily a bad thing. If you know how to think, and you have experience with a language that's at least something like what you want to learn, you can pick up almost anything quickly.
Classic question, classic answer. Buy SICP and learn Scheme. You probably will never build any "production" software with it, but you will learn a solid base for the rest of your carreer.
Although I never learned Java, I would point you to that language. I would also suggest C# or Objective-C. Really anything with a gui or IDE will work just fine for beginners. Contrary to most folks, I view being able to write efficient and fast scripts with python in a plan-text editor quickly, as much more advanced than using something like microsoft visual studio to help code. Of course, I code this way so I have my biases :-D
I started with Delphi in High school but moved to Python. In retrospect, starting with Delphi was a good thing, but using it for more than a year was a very bad thing!
Now I'm into PHP, Java, C++ and other weird languages in addition to Python which is still my favorite
If one is just dipping one's toes in the programming waters, then Delphi is a good start for native Windows development. It allows one to see positive results very quickly, which is important for beginners.
I'm really curious about how the first language you learn influences your way of thinking about programming. I suspect that over the long term, it doesn't matter, but I wonder if it might make a big difference in the first few years.
For example, I started with BASIC, and then moved to C. Thinking in loops was really hard for me at first (as opposed to using goto).
What would be like if your first language was a Lisp?
Less seriously, what about Unlambda? Or Brainfuck?
I'm going to break the rules here and answer two languages.
First, you should learn one of the easy dynamic languages. This means Perl, PHP, Python, Ruby, Lua, Clojure. I think Ruby is a good choice because it has a lot of cool concepts built in to the core language that the others lack, and so it can be a foundation for learning many different styles of programming -- it does this, in my opinion, better than Python, and has a nicer syntax than Perl. _why's poignant guide to ruby is a bit outdated but still a pretty awesome and cool introduction.
Second, and this might come as a shock, some form of basic assembler. I recommend LC-3 assembler. And the main reason here is that a decent understanding of the memory model is going to help you a lot when it comes to dealing with pointers, complex data structures, or anything, really. You'll probably never write a program longer than 100 lines in LC-3, but the short things you do write will give you a deeper understanding of your code everywhere else.
There may actually be a newer "learning assembler"-styled language out there, but I am not aware of it. LC-3 is showing its age, but it was great when I learned to program, and I learned as much programming for three months in LC-3 as two years prior in Java.
That said, you should definitely familiarize yourself with control structures prior to jumping into assembler or you could break your brain.
Learning some assembly should be required for anybody who wants to make a career writing software and is very valuable for hobbyists. I don't know that I would start there, but at some point along the way, understanding what that nice, high level language is really doing down at the metal makes for much better engineers.
However, I disagree that every language is equally hard. There are three challenges in learning programming: syntax, logic, and resource management. Those can be optimized for beginners:
Syntax: A syntax that is more natural and less symbolic will be easier to learn. There is a lot to be said about brevity for experienced programmers. For new programmers, it is completely wrong.
Logic: While certain, highly mathematically-inclined people may be different, most people understand the concepts involved with imperative programming (I do this, then this, then this; if I do this thing a lot, I can abstract its concept; etc.). Functional programming, "pure" object oriented programming, etc., are concepts that add impedance.
Resource Management: Whether memory, pixels on the screen, or bytes to a network connection, you've got to interact with the hardware at some point. Different languages approach this in very different ways, from manage everything directly to nearly complete abstraction.
Trying to learn all three at once for any but the most highly motivated is a recipe for frustration and, ultimately, failure.