This article was first published on Quora by Danish Dewani, https://www.quora.com/How-should-I-start-to-learn-hacking-and-what-are-the-prerequisites-like-programming-languages-networking-OS-etc
First of all do not expect to be able to write “apps of all sorts” after your first programming course. Most college grads that I have worked with are still unable to write an app let alone apps of all sorts, and that is after 4 years of course work.
Your first programming language should help you to understand the fundamentals. What is a variable, what is an array, what is memory, what are looping and flow control constructs. Moving on to what is a function, what is a class, what is a method, what is difference between a method and a function. Then deeper to what is inheritance, polymorphism. And with any luck it will expose you to patterns (If it doesn’t, expose yourself
That is the goal of your first course. You may write a very basic app in the process of that learning, but it will be a very guided process. This may be disappointing to the student hoping to write the next Angry Birds or 2048, however, without those fundamentals solidly in place you wont be able to move on, and eventually get to the point where you can write your own code.
Whatever your first language is, it should be strongly typed and object oriented. This is the reason that most schools today start with Java, though there is a bit of a resurgence in C++. Both are great choices. However, shortly after learning this type of language you should expose yourself to other options such as functional programming.
If you are really wanting to write your first app however, a course is not what you want. Instead you need to turn to Google and find a tutorial on writing the type of app that you want to write. Follow the tutorial and as Graham Luke says “Google Like Mad”. Whatever you first write will likely be cruft, with poor form, and very unmanageable, largely because you skipped learning the fundamentals. That said, you will be in a far better position, than your fellow students.
I started by typing every bit of code found in a basic manual and running it. From there I started using code to answer my questions, solve homework. Through this process I gained a solid understanding of the core concepts. School filled in the gaps.
The real secret is that the only way to learn to code is to write code. Write as much code as you possibly can. Limiting yourself to completing the exercises of a course, will short change your growth. I often wrote at least two separate/or very derivative solutions to any college assignment. I solved the problem once, and then I started asking what if. What if instead of using recursion, I wrote this flat. What if I used multiple processes instead. What if I used threads. Write code, no need to wait for college.