Home >Backend Development >Golang >Is golang object-oriented?
Golang is not object-oriented, go is a process-oriented language, and it is not a functional programming paradigm. It lacks arrow functions, requires explicit declaration of lambda, and does not pay attention to pure functions and immutables.
golang is not object-oriented, go is a process-oriented language
Noclass
, Generally oop
languages with obvious features will define the class keyword, and many will force you to put all the code into the class to realize that everything is an object, even the main function. Putting it into static
is not a functional programming paradigm. It is manifested in the lack of arrow functions, the need to explicitly declare lambda, and it does not pay attention to pure functions and immutable
Go's code does not pay attention to encapsulation and Organized, many source codes contain thousands of lines of code, showing the basic characteristics of typical procedural languages
Most scripting languages, c, etc. are procedural, and the language features of go are similar to those of these languages Very similar, except that common tools such as gc and goroitine are added. The author himself lacks understanding of oop, fp, etc. He just sorted out some common tools based on his experience in c, and then put them into the runtime of the language.
You said that you can achieve similar effects, just like if you use static to write Java, it can be similar to C. That is not a basic feature of a language paradigm
Related Learning recommendation: Go language tutorial
The above is the detailed content of Is golang object-oriented?. For more information, please follow other related articles on the PHP Chinese website!