How to quickly learn a programming language?

This article assumes that you have knowledge of at least one programming language; however, the concept of this article will help you learn programming from scratch.

How to quickly learn a programming language?

When I was in school, a teacher said something to me, I want to tell novice developers: you have to learn a programming language is the most difficult you learn a second language.

Do not let frustration - meaning it is that when you first learn how to program, you have a program for all aspects of preconceived ideas. You eventually establish more contact syntax and assumptions, you should not even have some established.

Therefore, when you learn a second programming language, you have to think of ways to "forget (unlearn)" these assumptions. When you want to try to learn a second door, even when the third programming language, always remember that.

To analyze programming

There are many programming languages, you can find statistics a little  more than 5000 kinds , but  TIOBE ranking list only the first 250 languages. Without exception, all the standard library of the top 20 programming languages have similar.

I think the best way to understand programming is to "eliminate" all the extra stuff, then you will be able to see the necessary basic elements.

atom

Every aspect of every programming language can be grouped into true and false. Why do you say? Because the circuit is such work - either a charge or no charge. Memory store values ​​0 or 1 in a manner, which either have a charge, or not.

8 (bits) is 1 byte, this is sufficient listed  in ASCII any of the characters. Bits (bits) in a certain order flip, it provides a decimal representation of the character. The computer can understand how this representation is translated into a letter.

How to quickly learn a programming language?

The basic binary representation, showing the Hello this is how to create the word out

Once you understand this concept, "Why is this said," will help you more easily understand others.

tool

How to quickly learn a programming language?

Tools are the same, we can be in any order to learn how to use these tools, but I usually use the following order.

variable

This seems too simple, but think about it, what variables are created out?

Operators

操作符是什么,怎样使用它们?假设你有一些基本的数学操作符,但是逻辑操作符会是怎样的?是“AND”(拼成“and”或者“AND”)操作符呢,还是说使用诸如“&&”这样的标记?

条件语句

我惊讶地发现,在自己撰写的关于 Swift 和 Python 的文章中,最受欢迎的都和做决策有关。你接下来需要了解的是在程序中如何做决策。你想要学习的语言使用传统的“if/else if/else”还是偏向 Python 的风格“if/elif/else”?你所学习的语言中是否有“switch”或者“guard”语句?

循环

你怎样循环遍历重复的任务?你所学习的语言包含 for 循环、while 循环、do-while 循环或 for-each 语句吗?

函数

语言中是否能够创建函数?如果可以,你会怎样创建?怎样在这些函数中包含变量?了解如何正确地使用函数会给你节省时间,让你的生活更轻松。

类和结构体

这门语言是否提供类或者结构体的概念呢?这看起来是不言自明的问题,但是有些语言两者都不具备,或者只具备其中之一。如果确实是这样,你会怎样创建类或者结构体?这个类需要一个构造函数还是 init 方法呢?

错误处理

错误是在所难免的。当它们发生时,这门语言是否具备鲁棒性的错误处理解决机制,你会怎样使用这个机制?这种机制是“try/catch”、“try/except”还是其他方法?是否有其他语句,如“else”或者“finally”,可以给出其他错误处理选项。

测试

你怎样测试你的代码?是否有内置的代码库做测试,或者需要下载独立的工具来做测试?

所有这些工具会出现在最现代化的编程语言里。即使是古老的编程语言,如 COBOL 也有其中大部分工具,但是其叫法不太相同,比如 paragraph 或者 copybook。

How to quickly learn a programming language?

如何获得良好的效果

一旦你理解这些工具,下一步要做的就是使用它们,写一个应用程序。你可以通过阅读文档了解一门语言,但是直到你用这门语言写了一些应用程序后,才能真正了解这门语言。

When writing an application, you have to think like an X programmers. I can say that I understand the C ++ language, because I went to class a C language, and read the C ++ documentation, but until I write an application in C ++ unique feature, be able to say I really understand C ++ the language.

Blackjack is very suitable as the initial stage of the project. It requires variables, operators, conditionals, loops (based on the number of players), function, class / structure and error handling. To prevent possible program crashes, you can include a number of test cases, test cases such as poker runs out.

Other good introductory project, including Chutes, Ladders, Yahtzee.

For more advanced features, you can try to re-create a game like Monopoly. More to think about the mechanics of creating, this game can just text-based.

The key thing to remember, if you give yourself the difficulty of the task of reducing (such as skipping double down blackjack or sub-license feature), it will only locked into your overall understanding of this language.

Are there any other learning tips?

A language can provide much more than these aspects I listed above. The fact is, you can use the tools listed above to write anything, but the extra features included in the standard library can make it easier for you to write anything. Most of the standard library contains the same function, so in different languages ​​you can use a similar function names.

You use a language more, you can find more standard library, but have to make sure to learn the tools mentioned above.

When you use a language, trying to figure out what the language of the strengths and weaknesses are yes. In the face of a specific problem, which can help you figure out which language should be used.

Need to quickly do some science data thing? You can watch some packets or R Python language. Need to quickly write a service? Or C can take a look at the Go language. How to build a Web server? Look at Java or Python.

Just look at the documentation for these languages, and can not understand them deeply. I learned through the use of these languages.

As this may be the shortest article I've ever, I want to give you present a challenge, and that is to learn a new language, I wish you good luck!

Guess you like

Origin www.cnblogs.com/deeplake/p/Selfstudy.html