How to learn a programming language

Source: Internet
Author: User
Tags variables

Choose a language

Identify areas of interest to you

You can start learning any programming language (although some of them are described more "easy to learn" than others), you have to ask yourself what kind of work you want to accomplish by learning the language. This will help you determine the programming style you should pursue and provide a good start.

If you want to enter the Web development industry, you will have a lot of language to learn, which is the opposite of developing a computer program. The development of mobile apps requires more skills than the development of PCs. All of these decisions will affect your direction of development.

Consider starting with a "easy to learn" language

No matter what decision you make, you may just want to start with a high-level, easy-to-learn language. These languages are useful for beginners because they teach basic concepts and thinking processes that apply to almost any language.

Two of the most popular in this language are Python and Ruby. They are all object-oriented Web application development languages that use easy-to-read syntax.

"Object oriented" because the language is built around the concept of "object", data collection and manipulation. This concept is used in many advanced programming languages, such as C + +, Java, objective-c, and PHP.

A basic tutorial to read through a large number of languages

If you are not sure which language you should start to learn, then read the basic tutorials for different languages. If a language is more interesting than anything else, go and see if it's true. There are countless basic tutorials on the web for all programming languages.

python--a language that is perfect for beginners, and it becomes more powerful when you master it. has been used to develop many Web applications and even some games.

java--is used by countless projects, from gaming to Web applications to ATM software.

html--is an essential sailing point for any web developer. It is important to master HTML before engaging in a series of other web development.

One of the oldest languages of c--, it is already a very powerful tool and also an ancestor of some more modern languages, such as c++,c# and objective-c.

Learn from the simple beginning

The core concept of learning language

While the appropriate part of this step will depend on the language you choose, all programming languages have basic concepts that are critical to building useful programs. Learning and mastering these concepts as quickly as possible will make it easier for you to solve problems and create powerful and effective code. Here are just some of the core concepts in different languages:

Variable--A variable is a way to store and apply to change the code slice. Variables can be manipulated and often defined as "integers", "characters", and other types of data that determine what can be stored. When coding, variables often have names that let them have some meaning for us. This makes it easy to understand how the variable interacts with the rest of the code.

Conditional statement--A conditional statement is a behavior based on whether the condition is true. The most common form of a conditional statement is "if-then". If this condition is true, then one thing happens, and if the condition is false, then another thing happens.

Functions or subroutines-the actual name of the concept may depend on different languages. It may also be called "process", "method", or "return unit". It is essentially a small program in a large program. A function can be "called" multiple times by another program, running a program to effectively create a complex program.

Data entry-This is a broad concept that is used in almost all languages. It involves processing the user's input and storing the data. How this data is collected depends on the type of program and the available input methods for the user. It has a precise connection with the output that is displayed on the screen or printed on the file.

Install some of the necessary software

Many programming languages require compilers that are designed by programmers to translate the code into a language that the machine understands. Some other languages, such as Python, can be converted to a program immediately without compiling it.

Some languages have their own IDES (integrated development environment) that often contains code editors, debuggers, and/or translations and debugs. These programmers are in the same place to perform any necessary functions. Ides may also contain a visual interface that contains object hierarchies and catalogs.

There are many code editors available on the web. These programs provide syntax highlighting in different ways and provide other developer-friendly tools. (The translator recommends Emacs)

Create your first program

Focus on only one concept at a time

The first program to be taught in almost any language is "Hello world". This is a simple program that simply displays "Hello,world" on the screen. This program teaches beginners some simple syntax to create a basic program to work with and how to handle display output. By changing the text, you can also learn how the basic data is handled by the program.

Learn through snippets of online samples

In almost every programming language on the web there are thousands of online code examples to remember. Use these examples to learn how different parts work together with the language, and the differences that precede each part. Create your own programs with the fragments you've made in the ongoing example.

Check syntax

Grammar is the method by which a language is written so that the compiler or interpreter can understand it. Each language has its own unique syntax, although some elements may be shared in different languages. Learning grammar is very important for learning how to program. In reality, it is just the foundation on which the more advanced concepts are built.

Experimental changes

Make some changes to your sample program and test the results. You can learn something useful and useless by experimenting, which is much faster than reading a book or guide at any time. Don't be afraid to break your program, learning to fix errors is the most important step in any development process, and new things will never work correctly for the first time.

Start Practice Debugging

When you are programming, you always encounter bugs. They exist in the program and may appear anywhere in the program wherever they are. The vulnerability could corrupt the program, or just let the program not compile/run. Capturing and repairing these errors is a major process in the software development cycle, so be accustomed to doing so early.

When you are about to modify a program, you may encounter situations where they cannot function. Find a way to figure it out and take a different approach, which will be one of your most valuable skills as a programmer.

Add comments to all code

Almost all programming languages have a "comment" feature that allows you to include text that is not handled by the interpreter or compiler. It also allows you to leave a short but clear explanation of the human language that this code is used to do. This will not only help you remember what your code does in this large program, but it is also very important in a collaborative environment because it allows others to understand what your code does.

Keep practicing

Every day you have to hit the code.

Spending a lot of time on mastering a language is the most important. Even in a simple language like python, it may take a day or two to get to know its basic syntax and spend a lot of time really mastering it. Like any other skill, practice is the key to becoming more skillful. Try to spend some time every day knocking on the code, even after work and an hour before dinner.

Set a target for your program

By setting goals that can be achieved but challenging, you will be able to start solving problems and get solutions. Try to imagine a basic application, such as a calculator, and then find a way to do it. Use the syntax and concepts you've been learning, and then apply them to the real world.

Communicate with others and read other people's programs

There are many programming communities dedicated to specific languages or disciplines. Finding and participating in these communities will create miracles for your learning. You'll get a wide variety of sample code and tools to help you with your learning process. Reading other people's program code can not only motivate you, but also help you to recall concepts that you have not mastered yet.

Find a forum or online community for the programming language you choose. Make sure that you are really involved rather than asking questions constantly. These communities tend to look at areas of collaboration and discussion, not just simple questions-answering questions. Please feel free to ask for help, but be prepared for your program and try a different approach.

Once you have some experience, you can participate in some programming activities. These activities are an individual or a team that is racing against the development features of the program, usually around a specific topic. These things are fun and a great way to meet other programmers.

Challenge yourself and stay fun

Try to do something that you don't yet know how to do. Study how you can accomplish this task, and constantly add them to your program. Be sure to try to avoid the hard-to-run program, you should make every aspect perfect.

Share your knowledge.

Take some training courses

Many universities, community colleges, and community centers offer programming lessons and studios that you can attend without having to register at school. This is good for novice programmers because you can get help from other experienced programmers, or you can communicate with programmers from other places on the web.

Buy or borrow a book

There are thousands of teaching books in all the languages you can imagine. While your knowledge should not come entirely from a book, they will provide you with a lot of references and often have a lot of friendly examples.

Learning Math and logic

Most programming involves basic arithmetic operations, but you may want to learn more advanced concepts. This is important if you want to write complex simulations or algorithmic level programs. For most everyday programming, you don't need much advanced math knowledge. But learning logic, especially computer logic, will help you understand the best way to deal with the complex problems of more advanced programs.

Never stop programming

There is a popular theory that it takes at least 10,000 hours of practice to become an expert. Although the theory is still in debate, the principles it contains are always correct: mastery takes time and dedication. Don't expect to learn everything overnight, but if you stay focused and learn, you'll soon become an expert in your field.

Learn a different programming language

While you can only master a single language, many programmers improve their chances of success in their field by learning multiple languages. Their second or third language tends to be complementary to the first language, which helps them to write more complex and interesting programs. Once you have mastered your first language, you will have time to learn a second language.

You may find that the second language will learn faster than the first one. That's because many of the core concepts are common to multiple languages, especially if the two languages themselves are closely related.

Apply Your Skills

Take a four-year course

While this is not absolutely necessary, four years at college or university will allow you to see a variety of different languages, and you can communicate with professionals or other students on the web. This approach is not necessarily suitable for everyone, and many successful programmers are not learning in a 4-year-old institution.

To create your own code base

When you are creating a program and constantly expanding your knowledge, make sure that all your best programs are saved in your code base. You can show this to the signs and the interviewer to see what you're doing. Make sure that this includes all your time work and that you can use these programs to do any work for another company.

Do some outsourced part-time jobs

There is a very large freelance market for programmers, especially mobile app development. Take a few small outsourced part-time jobs to feel how business programming works. Usually you can outsource a part-time job to help you build a code base, and this will benefit new work.

Develop your own free programs or business software

You don't have to exchange money for a job. If you have the ability, you can independently develop the software and let it be free, through your own website or other market. Be prepared to provide technical support for your business software because your customers want them to work in good condition.

Freeware is a popular way to publish small programs and applications. Developers will not receive any payments, but will help you build awareness and give yourself a certain reputation in the community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.