One summer, I and a couple of good friends were working on a project. The friends decided to do it in a
language I didn't know. So, I borrowed a book from the library and learnt the language in roughly 17-18 hours spread over a period of three days. My friends were stunned because they had taken a 60 hours one month course from a good institute in that language and yet I had a better understanding of the language.
It is not so tough and I am not a genius. I will tell you how to do it.
Day 1:
1. The Preparation: Empty Your Mind

First, finish all your pending tasks and make yourself free. Otherwise, these pending tasks will keep bugging you and you will lose concentration. Turn off your computer (at least for now) and cellphone. Get a good book, ask for recommendations from those who know the language and go for something similar to
Schaum's Outlines series or
For Dummies series books. Do not use ebooks (unless if you have a ebook reader like
Kindle) and online references for now. It is alright studying on a computer if you have super-human concentration, but I get distracted by IM popups. Already knowing a language helps. And if you can read fast then better. Find a good place to study like a library or your room with a "Don't Disturb" sign outside. Be prepared to commit 7-8 hours per day.
Caffeine will keep you alert but too much caffeine will make you jumpy and upset your stomach. Music also helps, but instead to listening to new tracks, listen to what you have heard a hundred times and feel pepped up with. I usually listen to
post-grunge (
Breaking Benjamin,
Default etc.). Use earphones, it blocks out all distracting noise (my neighbour had a big dog). Take
power-naps or walk around a bit after every 2-3 hour. Keep some food and drink within reach because hunger and thirst are also big distractions. Install the
compiler/
interpreter and
IDE recommended in your book. You may switch later, but for now use whatever the book says or you'll face problems in the execution of programs.
2. The Beginning: Data Types and Variables
Find out a little bit about the language (is it
compiled or
interpreted, is it
object oriented, etc). Then, check out the
"Hello World" program to find out about the basic output statement and program structure. Find out the fundamental
data types (
integer,
floating point,
boolean,
character etc.), how
variables in each type is declared and defined. Now do the same for derived data types (arrays, strings, structures etc.). If the language supports
functions (or subroutines) and
objects, leave them for later.
3. Manipulation of Data: Operations, Expressions and Statements
Find out the types of
operations supported by the language and learn to use them. Basically, learn addition (+), subtraction (-), multiplication (*), division (-), modulo (%), power (^), increment (++) and decrement (--). Then, learn to combine these into
expressions and how
type conversion takes place. Learn how to store the value of an expression in an variable (assignment operator). Check out basic
logical connective (AND, OR, NOT etc) and
comparison operations supported (like > , < , == , != , <= , >= etc). Learn the basic
statement formats for manipulation of data.
4. Talking to the User: Input and Output
Learn how to get input of different data types from the keyboard, store them in corresponding variables and display them on the screen. Thus, you must know about the basic input and output statements (both formatted and unformatted). Try to solve and execute some of the exercises provided in your book on input/output. This should be the first time you turn on your computer.
5. Flow of Control: Conditional Statements and Loops
Learn the basic
conditional statements (if then, if else , switch etc.). Learn how you can construct a
loop (while loop, for loop, do while loop etc.). The for loop is the most important one, understand it properly. Now turn on the computer and try out some programs.
Day 2:
6. Avoiding Repeated Statement and Hiding Data: Functions and Objects
Learn how functions are declared, defined and used. There may be something called
scope rules, check that out.
Objects are user-defined data types that combine data and functions that operate on the data. Most modern languages support objects, so find out about their declaration, definition format and usage. Now try out some programs using these concepts.
7. Bells and Whistles: Libraries and Stuff
Most modern languages provide
libraries to make the life of a programmer easier. Learn how to use a library. Some languages like
C,
C++,
Java etc. are entirely based around libraries. Also, you may have reached this step without learning anything about libraries, if you are learning something like
JavaScript. Find out the librabries most frequently used, these are usually related to mathematics, graphics, audio, hardware and process threads. Most languages provide some features that make them unique, check them out. Now practice using the libraries.
Day 3:
8. Practice, Practice and Practice
Yes, day 3 is all about practice. Find some challenging problems that force you use all the concepts learnt so far and grill yourself down. If you already know some languages, you have probably already written such programs, so now try them out in this new language that you are learning. You probably have gathered a lot of doubts by now, check them out online.
Now you are ready, now you are a novice not an expert. But you can solve the most common problems, read and understand others' codes and impress your friends that you learnt an entire language in 3 days.
Since you are learning on your own, you are bound to face some teething problems. So check them out in the documentation provided with your software, or check in the forums. Here are a few programming sites/forums that I frequent:
www.reddit.com/r/learnprogramming(subreddit for programming)
www.stackoverflow.com
www.webmonkey.com(for web development)
Learning a language is not enough, good programming practices and style are also important. Always
comment your code, especially explain what each function and object does. Use
meaningful variable, function and object names.
After all this, do not consider yourself an expert in the language, keep track of new releases and development.
If you don't know any programming languages then I recommend start with
Python or
JavaScript.
And finally try to use open and free software (like
GCC,
Mono etc.).