Knowledge system of programming language learning

Source: Internet
Author: User
Tags abstract anonymous closure exception handling function definition generator numeric value time and date

The basis of learning a language, that is, the grammar itself, does not mean that you have mastered the language. Learning a language should be learning the complete ecological environment it represents and the most appropriate combination for each application scenario. In the same way, I have used over seven or eight languages, of course, you have to learn to learn, with the number of languages advertised yourself is meaningless. However, every language has its own characteristics, like its weak type when it comes into contact with Python, the ease of rapid development, and the confusion of code later applied to the development of large programs, I am impressed. Often speaking a language is not good because you did not learn to get home, but in terms of skill level and application scenario, each language has its own advantages. I see a lot of existing tutorials, in Java as an example, its way of explaining and application examples are based on the JDK itself and the Java language itself. The author's own summary of the so-called programming language knowledge structure diagram or topology map, it will abstract the characteristics of each language to form. Well, for example, I was first in JavaScript, when using jquery to contact the concept of promise, and later in Java, in Swift found similar, but not necessarily called the name of the use or third-party class library, then we do the notes, the first thing to know, What you are learning now is which part should be put. Grammar Basics

Learning a language, it must first to learn its grammatical basis, that when learning the basis of grammar, we have to master which aspects, I probably categorized into the introductory overview, Quick Start, data structure, process control and exception handling, functions, modules and components, classes and objects and IO these parts. Getting Started overview

Here you have to understand the origin of the language, its characteristics, its basic appearance. For example, you need to understand the features of each version iteration. Just like Java 8, you need to know a little bit about the syntax of JAVA8, but for a specific grammatical knowledge point, it should be placed in the corresponding grammar. For example, JAVA8 inside the functional interface, then this part of the specific explanation should be placed in the interface that part.

Next, you have to understand the basic annotation and code segmentation of the specification, as the author of the Python, this is not curly braces, with the method of indentation, so that only from the C++/java came from the author of a meal of acid cool.

Next, on this side of the Getting Started overview, you'll also want to place links to external sources. You can't turn all the information you see into your own notes, so you'll need to store all of the valuable reference addresses you see here. The author is probably divided into:

Tutorial & Docs: Getting Started tutorials and guidance related
Practice&tips: Practice, tips related, like GitHub on the popular awesome-series, it is necessary to put the link to this
Forum&lessons: Some forums and online video tutorial addresses
Blog&news: Blogs and News
Book&resources: Reference books Ah, resources Ah put here
Quick Start

Learning a language, you will certainly write HelloWorld, the author emphasized above, the purpose of making notes is in the future you may forget all the time can be as fast as possible to learn, then you will be learning again when you are sure to continue to write HelloWorld. In this department, you need to know how to set up a development environment, especially recommended is to learn how to use Docker to build the development environment. Next, you'll learn to build tools and rely on management tools. In the early years, the author learned Java, do not know when using Maven, that time is not clear what constructs ah, the concept of dependency management, each time to use jar bag can only manually drag and drop, really oh da. Of course, a good programming language must have its corresponding construction and dependency management tools, so as to promote the whole community of active and communication. Then you have to look at how the code is deployed, like Python's notebook, Swift's playground, or something magical, that's very handy.

Finally, but also to see the common IDE, but I am currently using Atom plus jetbrains (Thanksgiving) this series. Well, before I saw a lot of Daniel like to use sublime vim to write code, I said, this force still do not pretend good. Data Structure

After learning HelloWorld, we are going to look at the data structure, which is the cornerstone of a programming language. So no matter what language it will provide us with what knowledge.

(1) The first is to know how to define variables and constants. As in JavaScript, the Var, let, and future Java will be added in the Val, variable definition of the way there are many kinds of. There is also to understand the system's built-in constants, this in the use of PHP for the development of the time compared to use. Next, look at how the variable is assigned, whether it has to be assigned individually or chained, or it can support deconstruction assignments like JavaScript. Finally, this part also depends on how you make the type, format judgment, like instanceof Ah typeof these operators, are introduced here.

(2) Then look at some basic data types. The first is the numeric type, which is divided into integers, floating-point types, or all-nsnumber like OJC, and also to see the difference between primitive and non-primitive types. If it is a numeric value, also see how to get the random number, how to do scientific calculation, how to convert the type. Next, you'll also see how the null type, the Boolean type, the optional type, and the enumeration type are defined.

(3) Next, look at how the string type is used. Strings are also required for each language, it is difficult to say, say simple, so much usage. Basically see how it creates additions and deletions, how to index traversal, how to type code and some other basic operations like reverse AH. There will also be a lot of small knowledge points, such as Java inside the string is immutable type, such as PHP inside your connection string can not use the plus sign.

(4) Then, it is necessary to see how the structure is defined, this is very important in swift, but in some languages there is no.

(5) The following is a look at the basic time and date type, here will also involve time zone conversion ah, calendar ah and so on. Basically the time and date of each language, either the original is good, or there will be a third-party library support, such as JavaScript in the moment.js, or very good.

(6) Several of the data types described above are fine, and it's time to get to know the advanced complex data types, which are called collections. The author divides the set into two parts: the sequence type and the key value index, for example, corresponding to the list and map in Java respectively. This is also to understand the creation of collection additions and deletions, index traversal, type conversion and sorting Ah, find AH and so on advanced usage.

(7) In the end, it's important to learn immutable data, which is popular in functional programming, like the Immutable.js that Facebook offers. Process Control and exception handling

The next step is to look at the process control and exception handling knowledge, first of all to know operator-related, such as logical operators Ah, plus and minus operators Ah, and operator overloading (operator overloading is an important advantage of the language can be used for data analysis calculation). Then we'll look at how to choose the branch, that is, the common if, switch statement, and guarantee in Swift. The next step is to see how the common cycle, the most classic is definitely for the loop, then each language has expanded, like what for-in, for-of, foreach Loop, they are all part of the loop traversal. There is a variant of the while and Do-while.

Read the cycle below to continue to look at the flow control, like break, continue this, and goto so can randomly jump the statement. To continue to understand the scope of knowledge, like JavaScript, the global scope of the accidentally. Then there is the knowledge of iterators, in many languages the iterators and generators are inseparable, and in Java the iterator is an interface. Iterators are also placed in the process control because the iterators are generally used for loops as well.

Finally, we'll look at exception handling, including how to define exceptions, how to throw exceptions, and how to catch and handle exceptions in the form of try-catch-finally. The use of try is provided in Swift, which is also very sweet. function

Next we continue to learn the concept of function, well, like Java, the complete OO language, there is no function, there is only method, which is often criticized by the place, the old say other languages HelloWorld on the line, but Java inside to write a lot of lines. Here the author is to include methods Ah, functions are put on this side of the introduction.

(1) Function definition
First of all, to see how the function is defined, different languages define the way there is a difference between the intersection. Like what func, function, define and so on n many different keywords. Note that this function does not need to return a value, like in Java there is no return value is void, and swift can write can not write, there are many weakly typed languages have no return value. Also see how to define function variables, which are often used together with closures.

(2) Parameter invocation
After reading the definition and then look at the parameter definition and invocation method. parameters, you need to know whether the default parameters and external parameters. When I first approached OJC, its external parameters did greatly improve readability, and then swift inherited and thrived. Here's a look at the indeterminate parameters, such as how to define an indeterminate parameter in Java. Finally, to see the difference between the reference value and the copy value, in some languages there are in-out such keywords.

(3) anonymous function/lambda/closure
The use of lambda is introduced in Java8, and lambda itself is a benchmark for functional programming, a design pattern. Here to see how lambda use, like some language is->, or some => And just to see how closures are defined, Swift provides a handy way to call a trailing closure.

(4) Generator
Generator, yield, the first author is in Python contact, now see ES inside also introduced this concept. Generators are typically used together with iterators, but can also be used to write asynchronous code.

(5) Decorative Device
The adorner feels a bit like the concept of AOP, and I am also exposed to Python and Angular2.

(6) function of curry and anti-currying
In Computer science, Curry (English: currying), also translated as Cary or add-in, is a technique that transforms a function that accepts multiple parameters into a function that accepts a single parameter (the first parameter of the initial function) and returns a new function that accepts the remaining parameters and returns the result. This technique was named by Christopher Strachey, a logic home Haskell Gari, although it was invented by Moses Schönfinkel and Gottlob Frege. This is a noun explanation from Wikipedia. As the name implies, the curry itself is actually a fixed parameter that can be expected, and returns a specific function that handles batch-specific requirements. This increases the applicability of the function, but also reduces the scope of application of the function. This feature is commonly used by the author in JavaScript and Scala, where JavaScript is an example of the core idea of curry. Modules and Components

Here the main learning of the concept of modularity, such as Java, C # There will be a namespace, and Swift is the global namespace. And like ES6, this export, import keyword in the end is how to use. Classes and Objects

I really did not touch the Lisp, Haskell such pure functional language, is basically oo it. Then the class and object are a very important part.

(1) Definition of class
How to define a class, how to use public, private, protected, or similar methods to divide the visible fields and how to divide the attributes. There are delay loads like swift, property monitoring and so on. How to define the method (see with the function above).

(2) Object
How to initialize objects, some languages have new, some do not. How to practice the singleton mode. There is a similar usage of this or self, like JavaScript, because the first time there is no OO concept, a variety of custom objects, this is the use of this is very messy. There is the judgment of which type the object belongs to, which is duplicated in the chapter of the variable.

(3) Inheritance
How to inherit an object, there is the inherited method for access to the properties of the parent class, ah, overloaded Ah, this is often encountered in the Java surface test.

(4) Abstract classes, interfaces/protocols and delegates
How to define an abstract class or interface, in Swift and OJC, is the concept of protocol, and how to define an annotation in Java, for example.

(5) Inner class
This is used more in Java, and is divided into static inner class, member inner class, local inner class and anonymous inner class.

(6) Reflection and class loading IO

The basic input and output methods are introduced here, including the input and output of the console, the processing of parameters, the basic reading and writing of the file, as well as a variety of words in Java, such as throttling, character stream ah to introduce. Grammar Application

After learning the basis of grammar, then our notes will be entered into other specific applications, which are divided into advanced, Storage, Testrelease, sysproc these parts. Advanced

There is a need for generic programming, memory management, serialization and deserialization, programming specifications and code styles, and the learning of algorithms implemented by the language. Network

This section mainly introduces network access, network call correlation. Includes networkmanagement (network management), Socket, HttpClient (Network client), Rpc/rmi (remote Call) Storage

This is where the file system, database storage, and so on are stored. The cache is included, and the cache, like Java, is divided into two on-heap and off-heap. Then look at the common database, the database includes the KeyValue database, the most common is redis. There are also document-based databases, most commonly MongoDB, and relational databases. The use of relational database should pay attention to ORM and Database Division table and so on plug-ins. Testrelease

Here is the main test Ah, publish AH related content. Includes unit testing, like JUnit, Debug, like in PHP with Xdebug to achieve single-step debugging, as well as log logs, like the famous log4j, there is a running state monitoring. Sysproc

This is where the system process-related content is stored, including cutting-plane programming and the most important concurrency, synchronization-related knowledge.

(1) Concurrency
This part of concurrency is to understand the basic concept of multithreading, the basic concept of thread communication. The basic asynchronous patterns, like promise, callback, and so on, are asynchronous data streams, the message bus, and responsive development.

(2) Synchronization and thread safety
Here you need to understand the basic concepts of locks, such as synchronized and lock in Java. You will then also understand some of the built-in thread-safe data structures.

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.