This is a creation in Article, where the information may have evolved or changed.
the world is parallel.----Do not say the universe, in the whole world, everything is happening in parallel; it is inherently easier to describe the parallel world in a well-supported go language;
the world is made up of material composition.---Microcosm: a large particle composed of small particles; a macro world: a large object composed of small objects;
Inheritance can only describe a small part of the real world, the use of inheritance is not comprehensive; Go design choice is the combination, this and the real world more consistent design, more expressive;
the world is standardized---with the development of productivity, the social division of labor more and more detailed, more and more industries have international standards, any one country, any one company in accordance with this standard production device, can be assembled to a machine; IBM/PC is one of the most successful examples of hardware modularity and interfacing;
Software can be so, go interface is Duck model, interface programming, and do not need to display the declaration, the language can do things to the language do;
Orthogonality--The orthogonal geometry refers to the vertical relationship of two vectors, and the projection of one vector in the direction of another vector is a point;
The orthogonal in reality refers to a number of factors, one changes, does not affect the other factors, in the case of no reduction of expressiveness, orthogonal is to maintain the stability and simplicity of things the best design;
Go is well-followed by this rule, and the multiple features of Go are orthogonal: goroutine, interfaces, combinations, type systems, etc.;
To give a typical example of orthogonal design: For example, the customer too small umbrella, simple extended umbrella rod is not good, this will increase the length of the umbrella; This design ensures that the umbrella size and umbrella length meet the orthogonal relationship, which will increase the complexity of the production of umbrellas.
Leave the complexity to the manufacturers and leave the convenience to the customers; for programming languages: Try to leave the complexity to the language implementation and compiler, and leave the simplicity to the language user, which is a good language;
Less is more---There is no universal language, in other words a language cannot contain all the features; a language that wants to encompass all features must be very complex (C + +);
The way to keep it simple is that each feature provides only one way to reduce duplication, redundancy, and imagine if the car has multiple brake pads, would you feel safer and more convenient?
just provide a way to do things, do things to the extreme, this is the principle of Go , liberate the programmer, do not provide him with a lot of similar features and statements, this will not make the problem simple, will only aggravate the programmer's mental burden
28 Law---Described in the programming language: 80% of the code uses only 20% of the language features, adding language features, and does not guarantee the development efficiency, because it will increase complexity, resulting in more error-prone;
Some complex programming problems can actually be supported in the form of libraries;
Anomalies and Errors--the so-called anomalies are unexpected unintended things happen, the so-called error is expected to be unexpected things happen; go language finally points out the two situations, what is defensive programming, how to maintain the robustness of the program;
Every call to check the error does make the code pretty ugly, personally think for the sake of robustness, defensive programming can also be received, through a certain skill is to avoid error code redundancy;
After discussing the universal laws, let me summarize the philosophy of the Go language:
1. Interface-Oriented programming
2. Using a combination of programming
3. Orthogonality: The orthogonality of language design, to ensure the stability and simplicity of language
4. Less is more: there's only one way to get things done right
5. Concurrency language support: Concurrency for better use of multicore, stronger expressiveness to simulate the real world
6. Openness: Open source, language implementation is not a black box for programmers, anyone who wants to understand the language implementation can participate in it.
Go is not like Java, the full object-oriented design of religious style, completely object-oriented design is a one-size-fits-all religious design, but it does not represent the world well, which leads to its lack of performance, and finally through design patterns and face-oriented design techniques to compensate for language defects Go is a project-oriented pragmatist, which combines the advantages of object-oriented design, functional design and process design, and the original design through a variety of design patterns through functions, interfaces, combinations and other simple way to get it done; go has more glue things like: Global variables, constants, functions, closures, etc. can easily connect and drive the module; Java is like: holding a hammer in the hand, see what is a nail, what is the object of the class, this and the real world, the class represents a single thing can also, once the expression of multiple things and their interaction, its expressiveness will encounter various challenges.
It is time to change the concept, not to mention the object-oriented design, not to mention design patterns (specifically, some recruitment pseudo-experts); The programming world is diverse, programming ideas and paradigms are colorful, and don't go along the wrong path, embrace go.