Learning a programming language

Author: Morris Wright
Date Of Creation: 1 April 2021
Update Date: 1 July 2024
Anonim
How To Learn a New Programming Language - FAST
Video: How To Learn a New Programming Language - FAST

Content

If you are interested in creating computer programs, mobile apps, websites, games or any other type of software, you will need to learn how to code. You make programs with a programming language. This allows a program to run on a computer, a mobile phone or other hardware.

To step

Part 1 of 6: Choose a language

  1. Determine your area of ​​interest. You can start with any programming language you want (but some are clearly "easier" than others), so the first thing to ask yourself is what you want to achieve by learning a programming language. This will help determine the type of programming you should get started with and is a good starting point.
    • If you want to get started with web development, you will have to learn a whole range of programming languages, unlike developing computer programs. Developing mobile apps requires different skills than programming for computers. All of these decisions will determine the direction you take.
  2. Start with a "simple" language. Regardless of your decision, it is wise to start with a higher, simpler programming language. These programming languages ​​are especially useful for beginners, as they teach you basic concepts and ways of thinking that can be applied to just about any programming language.
    • The two most used programming languages ​​in this category are Python and Ruby. Both are object-oriented programming languages ​​that use an easy-to-read syntax.
    • "Object-oriented" means that the programming language is built around the concept of "objects", or data sets, and the operations on them. This is a concept used in many advanced programming languages ​​such as C ++, Java, Objective-C and PHP.
  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 is right for you. There are numerous tutorials available online for every existing programming language, many of which you can find on wikiHow:
    • Python - A great programming language to start with and powerful enough, once you get familiar with it. The language can also be used for web applications and even 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 proceed with any kind of web development.
    • C - One of the older programming languages, and still a powerful tool, it is the basis for the more modern languages ​​C ++, C #, and Objective-C.

Part 2 of 6: Start small

  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 for building useful programs. Learning and mastering these concepts will make it easier to troubleshoot and write powerful, efficient code. Below you will find a number of key terms as used in many different programming languages:
    • Variables - A variable is a way of referring to and storing data. Variables can be edited and are often of a predetermined 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 (e.g. x = 5) then one thing happens, if the statement is false (e.g. x! = 5) then something else happens.
    • Functions / Subroutines - The actual name of this term can be called different in each programming language, depending on the programming language. It can also be called a "Procedure", a "Method", or a "Callable Unit". This is basically 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 available input methods (keyboard, file, etc.). This is directly related to output, where a certain result is returned to the user, whether it is displayed on the screen or delivered as a file.
  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 immediately run the programs without compiling them first.
    • Some programming languages ​​include an IDE (Integrated Development Environment) with usually a code editor, a compiler and / or interpreter, and a debugger. This allows the programmer to have all necessary functions within one environment. IDEs can also contain visual representations of object hierarchies and directories.
    • There are a diverse number of code editors available online. These programs provide different ways to distinguish syntax and provide other development tools that can be very useful.

Part 3 of 6: Making the first program

  1. Focus on 1 concept at a time. One of the first programs taught 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 it) on the screen. This program reads first-time programming, 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
  2. Learn by unraveling online examples. There are thousands of examples of code available online for virtually all programming languages. Use these examples to explore how different aspects of the programming language work and how the different components interact. Take bits and pieces from the different samples to make your own program.
  3. Examine the syntax. The syntax is the way the programming language is written for the compiler or interpreter to understand. Each programming language has a unique syntax, although some elements of different programming languages ​​are the same. Learning the syntax is essential to learning to code in a programming language, and is often what people associate with programming. In reality, this is just the foundation on which more advanced concepts are built.
  4. Experiment with changes. Make changes to your sample programs and test the result. By experimenting you can learn much faster what works and what doesn't, than by reading a book or article. Don't worry about a program crashing; Learning how to fix programming errors is an important part of the development process, and new programs usually never work flawlessly the very first time.
  5. Start debugging. When you start programming, you will inevitably run into bugs. These are errors in the program and can occur really anywhere. Bugs can be harmless hiccups in your 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 are experimenting with changing default programs, you will find things that don't work. Finding out how to take a different approach to solving a problem is one of the most important skills you can have as a programmer.
  6. Comment on all your code. Almost all programming languages ​​have a "comment" function that allows you to include text in the code, which is not intended to be functional code. You can use this to give a short, but in plain language, explanation of what the code does. Not only will you be able to better remember what each line of code represents, but it is also very important if you are going to program as a team, because then other programmers can immediately see what your code is doing.

Part 4 of 6: Exercise regularly

  1. Program daily. Above all, mastering a programming language will take time. Even a simpler programming language like Python, which should only take a day or two to learn basic syntax, takes a lot of time to really become proficient. Like any other skill, practice is what creates mastery. At the very least, try to make time for coding every day, even if it's just an hour before dinner.
  2. Set goals for your programs. By setting achievable but challenging goals, you are quickly busy solving problems. Try to come up with a first application, such as a calculator, and come up with ways to program one. Use the syntax and concepts you have learned and put them into practice.
  3. Talk to other programmers and review other programs. There are many programming groups dedicated to specific programming languages ​​or disciplines. Finding and participating in a community can perform learning wonders. You will come across various examples and tools that can help you in the learning process. Reading the program code of others can inspire you and help you understand the concepts that you are 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 seen as a place where you can collaborate and discuss, not just as 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 time to create a functional program, usually around a specific theme. These events can be a lot of fun and a great way to meet other programmers.
  4. Challenge yourself to keep it fun. Try to do things you don't know how to do yet. Research ways to accomplish a task, then try to implement it in your own program. Don't be too easily 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

  1. Take a few courses. Many universities, community colleges, and community buildings do offer programming courses and workshops that you can attend without registering at 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.
  2. Buy or borrow books. There are thousands of instructional books for every programming language imaginable. While your knowledge shouldn't just come from a book, they are great reference books and often include many good examples.
  3. Study math and logic. Most programming is concerned with common algebra, but it can certainly be useful for studying the more advanced math. This is especially 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.
  4. Don't stop programming. There is a popular theory that becoming an expert takes at least 10,000 hours of practice. While 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 continue to learn, you will eventually become an expert in your field.
  5. Learn yet another programming language. While you will certainly be able to learn one programming language, most programmers will learn multiple languages ​​to be more likely to be successful in their field. Typically, the second and third languages ​​will complement the first, allowing them to create more complex and interesting programs. If you are well versed in your first programming language, it is time to learn the next.
    • You will likely find that learning the second language is faster than the first. Many core concepts are the same within groups of programming languages, especially when the languages ​​are close together.

Part 6 of 6: Applying your skills

  1. Apply to a university or college. Although not strictly necessary, following the right education will greatly increase your opportunities in the field. In addition, you almost automatically get a broader network of fellow students and other professionals. This is not for everyone and many successful programmers have never attended a degree.
  2. Create a portfolio. As you create programs and expand your knowledge, it is important to store the best work you have done in a portfolio. You can show this to job hunters and companies during an application. Make sure to include work done in your spare time, and make sure you have permission to show work done for a company.
  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.
  4. Develop your own freeware or commercial programs. You don't have to work for a company to make money with programming. If you have the skills, you can develop and sell 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 let 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 in the community.

Tips

  • If you are interested in programming for games, focus on Python, C ++ and Java. Of the 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 of free software. Study the source code of programs you can find on the free software directory. Why reinvent the wheel when you can improve it too? But always try to understand what you are programming.
  • For most people, programming something they can use or that you want to be interested in will be more fun than the examples from a textbook. Use a search engine to find information that may be of use to a project that interests you.
  • When you are learning something new it is usually useful to implement it yourself and then tinker with the design, trying to predict the results so that you are sure you understand the concept.
  • Make use of an up-to-date interface and official reference material.
  • Reference books are here to help you. Don't worry if you don't know everything right away; that will eventually come naturally. Most importantly, you know where to look.
  • Try to practice by teaching others. Not only will it make you a better programmer, but you will also look at the matter from multiple angles.