Determine your area of interest. You can start learning with any programming language (though some are definitely "easier" than others), so you'll want to start by asking yourself what it is you want to accomplish by learning a programming language. This will help you determine what type of programming you should pursue, and provide you a good starting point.
If you want to get into web development, you'll have a whole different set of languages that you'll need to learn as opposed to developing computer programs. Mobile app developing requires a different skillset than machine programming. All of these decisions will influence your direction.
Ad
Image titled Learn a Programming Language Step 22
Consider starting with a "simpler" language. Regardless of your decision, you may want to consider starting with one of the high-level, simpler languages. These languages are especially useful for beginners, as they teach basic concepts and thought processes that can apply to virtually any language.[1]
The two most popular languages in this category are Python and Ruby. These are both object-oriented web application languages that use a very readable syntax.
"Object-oriented" means that the language is built around the concepts of "objects", or collections of data, and their manipulation. This is a concept that is used in many advanced programming languages such as C++, Java, Objective-C, and PHP.
Image titled Learn a Programming Language Step 33
Read through some basic tutorials for a variety of languages. If you're still not sure which language you should start learning, read through some tutorials for a few different languages. If one language makes a bit more sense than the others, try it out for a bit to see if it clicks. There are countless tutorials for every programming available online, including many on wikiHow:
Python - A great starter language that is also quite powerful when you get familiar with it. Used for many web applications and a number of games.
Java - Used in countless types of programs, from games to web applications to ATM software.
HTML - An essential starting place for any web developer. Having a handle on HTML is vital before moving on to any other sort of web development.
C - One of the older languages, C is still a powerful tool, and is the basis for the more modern C++, C#, and Objective-C.
Ad
Part 2 of 6: Starting Small
Image titled Learn a Programming Language Step 41
Learn the core concepts of the language. While the parts of this step that apply will vary depending on the language you choose, all programming languages have fundamental concepts that are essential to building useful programs. Learning and mastering these concepts early will make it easier to solve problems and create powerful and efficient code. Below are just some of the core concepts found in many different languages:
Variables - A variable is a way to store and refer to changing pieces of data. Variables can be manipulated, and often have defined types such as "integers", "characters", and others, which determine the type of data that can be stored. When coding, variables typically have names that make them somewhat identifiable to a human reader. This makes it easier to understand how the variable interacts with the rest of the code.
Conditional Statements - A conditional statement is an action that is performed based on whether the statement is true or not. The most common form of a conditional statement is the "If-Then" statement. If the statement is true (e.g. x = 5) then one thing happens. If the statement is false (e.g. x != 5), then something else happens.
Functions or Subroutines - The actual name for this concept may be called something different depending on the language. It could also be "Procedure", a "Method", or a "Callable Unit". This is essentially a smaller program within a larger program. A function can be "called" by the program multiple times, allowing the programmer to efficiently create complex programs.
Data input - This is a broad concept that is used in nearly every language. it involves handling a user's input as well as storing that data. How that data is gathered depend on the type of program and the inputs available to the user (keyboard, file, etc.). This is closely linked to Output, which is how the result is returned to the user, be it displayed on the screen or delivered in a file.
Image titled Learn a Programming Language Step 52
Install any necessary software. Many programming languages require compilers, which are programs designed to translate the code into a language that the machine can understand. Other languages, such as Python, use an interpreter which can execute the programs instantly without compiling.
Some languages have IDEs (Integrated Development Environment) which usually contain a code editor, a compiler and/or interpreter, and a debugger. This allows the programmer to perform any necessary function in one place. IDEs may also contain visual representations of object hierarchies and directories.
There are a variety of code editors available online. These programs offer different ways of highlighting syntax and provide other developer-friendly tools.
Ad
Part 3 of 6: Creating Your First Program
Image titled Learn a Programming Language Step 61
Focus on one concept at a time. One of the first programs taught for any language is the "Hello World" program. This is a very simple program that displays the text "Hello, World" (or some variation), on the screen. This program teaches first-time programmers the syntax to create a basic, functioning program, as well as how to handle displaying output. By changing the text, you can learn how basic data is handled by the program. Below are some wikiHow guides on creating a "Hello World" program in various languages:
Hello World in Python
Hello World in Ruby
Hello World in C
Hello World in PHP
Hello World in C#
Hello World in Java
Image titled Learn a Programming Language Step 72
Learn through deconstruction of online examples. There are thousands of code examples online for virtually every programming languages. Use these examples to examine how various aspects of the language work and how different parts interact. Take bits and pieces from various examples to create your own programs.
Image titled Learn a Programming Language Step 83
Examine the syntax. The syntax is the way the language is written so that the compiler or interpreter can understand it. Each language has a unique syntax, though some elements may be shared across multiple languages. Learning the syntax is essential for learning how to program in the language, and is often what people think of when they think about computer programming. In reality, it is simply the foundation upon which more advanced concepts are built.
Image titled Learn a Programming Language Step 94
Experiment with changes. Make changes to your example programs and then test the result. By experimenting, you can learn what works and what doesn't much quicker than by reading a book or guide. Don't be afraid to break your program; learning to fix errors is a major part of any development process, and new things almost never work right the first time.[2]
Image titled Learn a Programming Language Step 105
Start practicing debugging. When you're programming, you're invariably going to come across bugs. These are errors in the program, and can manifest virtually anywhere. Bugs can be harmless quirks in the program, or they can be major errors that keep the program from compiling or running. Hunting down and fixing these errors is a major process in the software development cycle, so get used to doing this early.
As you experiment with changing basic programs, you're going to come across things that don't work. Figuring out how to take a different approach is one of the most valuable skills you can have as a programmer.
Image titled Learn a Programming Language Step 116
Comment all of your code. Nearly all programming languages have a "comment" function that allows you to include text that is not processed by the interpreter or compiler. This allows you to leave short, but clear, human-language explanations of what the code does. This will not only help you remember what your code does in a large program, it is an essential practice in a collaborative environment, as it allows others to understand what your code is doing.