If you are interested in creating computer programs, mobile apps, websites, games or any other type of software, you will need to learn programming. You create programs with a programming language. This allows a program to run on a computer, mobile phone, or other hardware.
Part 1 of 6: Choose a language
Step 1. Determine your area of interest
You can start with any programming language you want (but some are obviously "easier" than others), so the first thing to ask yourself is what you want to achieve by learning a programming language. This helps determine the type of programming you should get started with, and is a good place to start.
If you want to get started with web development, you will have to learn a whole range of programming languages, as opposed to developing computer programs. Developing mobile apps requires different skills than programming for computers. All of these decisions will determine the direction you take
Step 2. Start with a "simple" language
Regardless of your decision, it's wise to start with a higher-level, simpler programming language. These programming languages are especially useful for beginners because they teach you basic concepts and ways of thinking that can be applied to just about any programming language.
- The two most commonly used programming languages in this category are Python and Ruby. Both are object-oriented programming languages that use easy-to-read syntax.
- "Object-oriented" means that the programming language is built around the concept of "objects", or sets of data, and the operations on them. This is a concept used in many advanced programming languages such as C++, Java, Objective-C, and PHP.
Step 3. Read some basic tutorials for a selection of programming languages
If you're still not sure which programming language you want to learn, read some tutorials for a few different programming languages. If you understand one programming language better than another, try it to see if it's for you. There are numerous tutorials available online for every existing programming language, many of which can be found on wikiHow:
- Python – A great programming language to start with and also powerful enough once you get used to it. The language can also be used for web applications and even for games.
- Java – Used in many different programs, from games to web applications to ATM software.
- HTML – An essential starting point for any web developer. Being able to work with HTML is vital before you can move forward with any web development.
- C – One of the older programming languages, and still a powerful tool, and it forms the basis for the more modern languages C++, C#, and Objective-C.
Part 2 of 6: Starting small
Step 1. Learn the core concepts of the programming language
While parts of this step may or may not apply depending on the programming language you choose, all programming languages share fundamental concepts that are essential to building useful programs. Learning and mastering these concepts will make it easier to solve problems and write powerful, efficient code. Below are some key terms used in many different programming languages:
- Variables - A variable is a way to reference and store data. Variables can be edited and are often of a predefined type, such as "integers", "characters", which determines the type of data that can be stored in them. When programming you make sure that variables have a name. 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 depending 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 (eg x = 5) then one thing happens, if the statement is false (eg x != 5), something else happens.
- Functions/Subroutines – The actual name of this term can be called differently in each programming language, depending on the programming language. It may also be called a "Procedure", a "Method", or a "Callable Unit". This is really just a smaller program within a larger program. A function can be "called" multiple times by the program, allowing the programmer to create more complex programs more efficiently.
- Data entry – This is a broad term used in almost every programming language. It involves handling user input and data storage. How data is collected depends on the type of program and the input methods available (keyboard, file, etc.). This is directly related to output, where a certain result is returned to the user, either shown on the screen or delivered as a file.
Step 2. Install the necessary software
Many programming languages require a compiler, programs designed to translate the code into a programming language that the machine can understand. Other programming languages, such as Python, use an interpreter that can run the programs right away without compiling them first.
- Some programming languages have an IDE (Integrated Development Environment) that usually includes a code editor, a compiler and/or interpreter, and a debugger. This allows the programmer to have all the necessary functions within one environment. IDEs can also contain visual representations of object hierarchies and directories.
- There are a variety of code editors available online. These programs offer several ways to distinguish syntax and provide other development tools that can be very useful.
Part 3 of 6: Making the first program
Step 1. Focus on 1 concept at a time
One of the first programs to be learned in any programming language is the "Hello World" program. This is a very simple program that prints the text "Hello, World" (or a variation of this) on the screen. This program reads to a first-time user the syntax to write a simple, functioning program, and how to display the output. By changing the text you can learn how simple data is processed by the program. Below are some wikiHow articles for creating a "Hello World" program in different programming 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
Step 2. Learn by unraveling online examples
There are thousands of examples online of code for virtually all programming languages. Use these examples to explore how different aspects of the programming language work and how the different parts interact. Take bits and pieces from the various examples to create your own program.
Step 3. Examine the syntax
The syntax is the way the programming language is written so that the compiler or interpreter can understand it. Each programming language has a unique syntax, although some elements of different programming languages are similar to each other. Learning the syntax is essential for learning to program in a programming language, and is often what people associate with programming. In reality, this is just the foundation upon which more advanced concepts are built.
Step 4. Experiment with changes
Make changes to your sample programs and test the result. By experimenting, you can learn what works and what doesn't much faster than by reading a book or article. Don't worry about a program crashing; learning how to fix bugs is an important part of the development process, and new programs usually never work flawlessly the very first time.
Step 5. Start debugging
When you start programming, you inevitably run into bugs. These are errors in the program and can occur anywhere. Bugs can be harmless hiccups in your program code or major errors that prevent the program from compiling or running. Finding and fixing these errors is a very important part of the development cycle, so get used to them right from the start.
While you're experimenting with changing default programs, you'll run into things that don't work. Figuring out how to take a different approach to solving a problem is one of the most important skills you can have as a programmer
Step 6. Comment on all your program code
Almost all programming languages have a "comment" function that allows you to include text in the code, which is not intended as functional code. You can use this to give a short, but in clear language, explanation of what the code does. Not only will this help you remember what each line of code represents, but it's also very important if you're programming as a team, because other programmers can see what your code is doing right away.
Part 4 of 6: Practice regularly
Step 1. Program daily
Above all, mastering a programming language takes time. Even a simpler programming language like Python, which only takes a day or two to learn the basic syntax, takes a lot of time to really master. Like any other skill, practice is what produces mastery. At least try to make time every day to code, even if it's just an hour before dinner.
Step 2. Set goals for your programs
By setting achievable but challenging goals you are quickly engaged in solving problems. Try to come up with an initial application, such as a calculator, and come up with ways to program one. Use the syntax and concepts you've learned and put them into practice.
Step 3. Talk to other programmers and review other programs
There are many programming groups devoted to specific programming languages or disciplines. Finding and participating in a community can work wonders. You will come across several examples and tools that can help you in the learning process. Reading the code of others can inspire you and help you understand the concepts you have not yet mastered.
- Check programming forums and online communities for the programming language of your choice. Make sure you participate and don't just ask questions. These communities are usually thought of as a place to collaborate and discuss, not just a Q&A. Ask for help, but also be willing to show your own work and be open to other approaches.
- Once you've gained some experience, consider joining a hack-a-thon or programming jam. These are events where individuals or teams race against the clock to create a functional program, usually around a particular theme. These events can be a lot of fun and a great way to meet other programmers.
Step 4. Challenge yourself to keep it fun
Try to do things you don't know how to do yet. Research ways to get a task done, then try implementing it in your own program. Don't be too quick to be satisfied with a program that "roughly" works; do everything you can to make sure every aspect is flawless.
Part 5 of 6: Expanding your knowledge
Step 1. Take a few courses
Many universities, folk universities, and community centers do offer programming courses and workshops that you can attend without applying to a school. This can be great for new programmers, as you get direct guidance from an experienced programmer, in addition to networking with other local programmers.
Step 2. Buy or borrow books
There are thousands of instruction books for every programming language imaginable. While your knowledge shouldn't just come from a book, they are great reference books and often contain many good examples.
Step 3. Study math and logic
Most programming deals with basic algebra, but it can certainly be useful to study the more advanced math. This is certainly the case if you are developing complex simulations or any other program that requires a lot of equations. Logic can help you understand how best to solve complex problems.
Step 4. Don't stop programming
There is a popular theory that becoming an expert takes at least 10,000 hours of practice. Although this is certainly debatable, the general principle remains: mastery takes time and dedication. Don't expect to master everything in a few days, but if you stay focused and keep learning, you will eventually become an expert in your field.
Step 5. Learn yet another programming language
While you will certainly be comfortable learning one programming language, most programmers will learn multiple languages to have a better chance of becoming successful in their field. Usually, the second and third languages will complement the first, allowing them to create more complex and interesting programs. Once you're well versed in your first programming language, it's time to learn the next one.
You will probably find that learning the second language is faster than the first. Many core concepts are the same within groups of programming languages, especially if the languages are close to each other
Part 6 of 6: Applying your skills
Step 1. Apply to a university or college
While not strictly necessary, getting the right education will greatly increase your chances in the field. In addition, you almost automatically get a broader network by fellow students and other professionals. This is not for everyone and many successful programmers have never studied.
Step 2. Create a portfolio
As you create programs and expand your knowledge, it's important to save the best work you've done in a portfolio. You can show these to job hunters and companies during a job application. Be sure to include work you've done in your spare time, and make sure you're allowed to show work done for a company.
Step 3. Do freelance work
The market for freelance programmers is huge, especially when it comes to mobile app developers. Pick up a few small freelance jobs to get a feel for doing assignments. You can often use these assignments to expand your portfolio and refer to work that has been published.
Step 4. Develop your own freeware or commercial programs
You don't have to work for a company to make money programming. If you have the skills, you can start developing and selling software yourself, either through your own website or through another channel. You will have to provide support as a service to your customers, because you make people pay for your product.
Freeware is a popular way to publish small programs and utilities. The developer doesn't get any money, but it's a great way to make a name for yourself and make yourself visible within the community
- If you're interested in game programming, focus on Python, C++, and Java. Of these three, C++ is probably the best in terms of performance, Python by far the easiest and Java to create programs that run on Windows, Mac OS, and Linux.
- Expand your knowledge about free software. Study the source code of programs you can find at free software directory. Why reinvent the wheel when you can improve it? But always try to understand what you are programming.
- For most people, programming something they can use or are interested in will be more fun than the textbook examples. Use a search engine to find information that may be useful for a project that interests you.
- When you learn something new, it's usually helpful to implement it yourself and then tinker with the design, trying to predict the results to make sure you understand the concept.
- Use an up-to-date interface and official reference material.
- Reference books are there to help you. Don't worry if you don't know everything by heart right away; it will eventually come naturally. The important thing is that you know where to look.
- Try to practice by teaching others. Not only does it make you a better programmer, but it also makes you look at things from multiple angles.