How to learn a programming language

Source: Internet
Author: User

Choose a language

1. 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.

2. 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.

3. Basic tutorials 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

1. Core concepts of language learning

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.

2. Install some 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

1. 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.

2. 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.

3. Check grammar

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.

4. 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.

5. 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.

(It's already 2:30, and I'll translate it tomorrow.) )

How to learn a programming language

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.