Let's start with the first and most important rule of learning to code. Read everything and understand what you're reading.
Do not skip or skim words or communication of any kind. Don't read something assuming you know what it means; if you don't understand it, look around, ask someone, or google until you understand what you've just read. Then, you can move on.
The reason for this is that programming involves comprehension, not knowledge (more on that below).
Failure to follow this will make you a sucky programmer. You'll write buggy code. You'll piss yourself off when you think nobody wants to help you. Then, you'll end up really pissed because everything you thought you knew how to do falls apart, and you finally realize you're a bad programmer. This happened to me about 7yrs ago -- so, I'm trying to save you the trouble. After I realized this, and, after I learned how to program, not only did I quickly become very good but everything was 10 times easier and I enjoyed programming far more than I did before. Bad programming is exciting -- good programming is a party.
First, I want to tell you that learning a programming language and learning how to program aren't the same thing. A very simple metaphor to this is driving. You can learn how to drive, but, driving an automatic transmission sports car is completely different than driving a manual 18-wheeler. They both move on wheels and function the same, but, are very, very different. Also, if you were getting started, it would be easier to learn with a small automatic car than an 18-wheeler.
Programming and driving, however, are very different. Whereas driving is a mechanical task, which uses one part of your brain, programming is comprehension. When you're programming, you're not the driver, you are the mechanical engineer who invented fuel injectors, or the chemical engineer who invented run-flat tires. A programmer uses comprehension to write logic which instructs machines to create something material and useful.
The key when learning to program is that you create; bad programmers only know how to drive while good programmers know how spark plugs work.
So, I will share with you several things:
1) IMPORTANT: What NOT to do and why
2) How you should go about learning to program
3) About Java, Microsoft, and Enterprise
4) Failure and Practice
5) About Hacker News
1) IMPORTANT: What not to do and why
Often, when we read sites, books, etc., we're interpreting what we're reading and creating a story (perception) or associating it with something we already know. No matter what you already know from previous experiences with computers, learning to program is new -- it's like learning how to write -- you know the letters, you've seen it all, but getting your hand to draw such concise letters, words, and sentences, is a completely new experience. This is how you should take in programming; coding should be elegant, concise, and flow. Programming isn't glueing things to form a collage or mocking what you've seen. Just as you can't pretend to speak in a foreign language, you should never write code unless you fundamentally know what it does.
There's a lot of crap out there. Rails, most of PHP, a lot of Java, and most of what Microsoft developers come up with are pieces of crap cobbled together to make something which somehow works. The problem is all the people who are SOOOOO excited and exuberant about their crap. Some things, like Rails, started out awesome and are crap now. Unfortunately, people forget that Rails is just a tool; instead, they use it as a crutch -- even though it's now very worn and rusty. Don't trust or use something just because it's popular -- chances are it sucks. By sucks, I mean, it bites you in the ass a lot and/or forces you to do stupid things which waste your time.
Which brings me to my next subject of Tools. There's a saying "when all you have is a hammer, everything looks like a nail". This is one of the many reasons you should learn a language FIRST and not do anything else first. Otherwise you will end up wondering why you're "hammer" isn't helping you with glue or screws. So, remember to use the right tool for the job.
Want to write iPhone apps? Learn Objective-C.
Want to write Android apps? Learn Java.
Want to use Rails? Learn Ruby.
Want to use Django? Learn Python.
But before you do all of this, learn one language first. The language I'm going to suggest you learn is Python, and there's a really good reason why.
The book I'll be referring you to is "how to program" and teaches with Python. As per the rule above, don't skip the introduction; read and do exactly what it tells you. I picked this book because it's excellent at teaching you how to program, and it's modern. The fact that it's free is just a perk. This is why I picked Python -- this book is awesome.
2) How you should go about learning to program
i) Start with Python. Learn Python by using this book: http://learnpythonthehardway.org/index
ii) Learn how to write a basic Objective-C or Java program
iii) If you learned obj-c, install the iPhone SDK, If Java install the Android SDK
iv) Write a mobile application
v) now, you're prepared to explore other languages, platforms, etc. (java, jquery, rails, databases)
Unless it's required (for classroom or work), don't touch anything else to do with writing code until v).
Regarding steps ii) and iii)
This of course, is the hard way, but that's a good thing! You can't use Python with the Android or iPhone SDK (Software Development Kit), AND you'll never be able to create a web application with them. However, the Android and iPhone SDKs don't suck and are VERY pragmatic (pragmatic is a good thing!). These SDKs make it easy for developers to create mobile applications -- this is an amazing thing because mobile phones have limitations which servers and desktops don't have. They have limited battery life, a slow network connection, less memory, and a slower graphics processor.
By learning how to develop on one of these platforms, you'll learn how to do something with requirements and limitations, and, you'll learn how to apply you're knowledge of programming to a new language. Best of all, you'll write something you can use on your phone, anywhere -- way better than a web site.
Once you can work through writing an android or iphone app (which isn't that difficult, trust me!), then anything to do with web applications will magically become a no-brainer for you.
3) About Java, Microsoft, and Enterprise
The way you're going to learn how to program is completely different than the world of Java, Microsoft, and enterprise systems. It's different because these worlds are built on "information technology" and not on productivity. They're built to provide solutions, not solve problems. As a result, everything in these worlds are convoluted, complex, or expensive. Learning to program without these technologies will equip you if you ever need to work with them. In which case, you will better at understanding how the IT components in Enterprise are separate from the programming components. In short, you'll be able to see the forest from the trees whereas others do not. Most just get lost and try to find a corner they can hide in.
4) Failure and Practice
Programming is trial and error. You have to LEARN. Last, if you don't have good comprehension skills, it might not be for you. That doesn't mean you can't learn how to program well or be productive, but, you may have to work harder and might not enjoy it as much -- it could take some time for your comprehension to get up to par. This of course, is what practice is for (which is also covered in the book).
5) About Hacker News - http://news.ycombinator.com
If you want to program and develop software you should follow Hacker News. It's kind of addictive so be moderate. Hacker News has become a sort of "pay it forward" community where it's discouraged to put people down and you should always try to make positive contributions.
Between then and now, I've learnt a lot of theory, and I think the key to good programming is just to keep applying what you learned to your software and to keep evolving.
Microsoft Languages and Frameworks don't suck. They made design decisions based off a lot of legacy stuff - they didn't have the luxury of being able to create a brand new SDK. The attempt they made (.NET) turned out pretty alright. The .NET languages and frameworks are pretty good and consistent.
Python is a good short start, equivalent to learning to develop with C on the console, but once you graduate this level, it becomes horribly limited. Making a GUI with python is a convoluted and painful process. So python may be suitable at the start, but one should quickly graduate into a native SDK for the platform you are working in.
And I don't think either of the two mobile SDKs is really well suited for beginners. There is a lot of non-language things to take care off when developing for mobile.
I personally think the best programming way is : C on the console -> .NET or Java. Those will give you a good grasp about what most programming is about and then you can specialise in whatever you want to do.