10 years of programmers' programming language experience and Go's affinity

original
2021/07/04 17:29
Number of readings 210

Because my editor is writing two sets of tutorials recently, namely the basic Java language tutorial and the basic Go language tutorial, and I have used both of these two languages in my actual work

and www.helloworld.net The backstage of the community is written in Go language, and it is the small editor who is responsible for it. Besides, the editor uses Java in his work.

So I have a good understanding of these two languages, so this article will talk about my feelings and opinions about these two languages

, and also talk about the feelings of various programming languages in the past 10 years

The views in this article are only for your own reference

Do not want to cause a debate between good and bad language.

Xiaobian's C++development experience

At first, when I graduated from college, I worked as a editor C/C++ It is mainly developed for Windows desktop software. Used Microsoft MFC WTL Also used Qt Cross platform framework

Anyone who has known C++desktop software development knows that, C++ It is very painful to write interfaces. There is no user-friendly interface library, MFC Ugly, complex, WTL Only interface framework

But it is also difficult to achieve a beautiful interface, and I have been exposed to it later Qt As well as the self drawn UI framework, C++ Developing desktop client software is really not as cool and painful as the front end.

It causes you to think about how to implement this button and how to vertically center the text in the edit box all day, instead of focusing on business. In short, hard work does not please.

moreover C++ Not only is it easier to draw the interface than other terminals (such as the front end, Android, IOS), but even common libraries are not as complete as theirs. Many still need to build wheels.

Even every C++ Development engineers have their own set of tool classes for string operations, while in Java, a String class has been completely solved.

Three years C++ However, with the rise of Android phones, more and more software began to have Android versions, and Android became more and more popular at that time.

Think of C++ Desktop software development may be lonely, so with the help of my classmates (Android development), I started my career in Android development.

Xiaobian's Android development experience

Because the university is a computer major, I learned it in the university C/C++ , also learned Java , so it is not too difficult to switch to Android. Even a little surprised.

I remember one thing that I remember deeply. I did it before C++ When developing, I parsed the json string. I forgot what library was used at that time. I just remember when parsing,

You need to manually parse one key at a time to obtain values.

When doing Android development, my classmates told me that there was a Gson Library, you can directly convert a json string to a corresponding class, or you can directly convert a class to a string

It felt good when I saw it Java It's so cool to write. There are so many libraries that you don't have to worry about many things, C++ After transferring to Android, write Java That's a cool

It feels that from the primitive slash and burn era to the modern era.

In a twinkling of an eye, it has been six or seven years since Android was developed. Java is now used, not to mention an expert, but at least an advanced level. With the deepening of Java language

I gradually feel that Java is good, but there are also some disadvantages.

such as Java Language is too wordy. Modern languages, such as dart , go , swift Those that appear later are simplified.

The grammar is simple and comfortable to write. Java Although in Java 10 There are also var Keyword and variable definitions don't need to be written in a long and smelly way, but Java 8 is still the most widely used

There are also Java virtual machines, which cause special resource consumption.

For example, the whole set of solutions of Java Spring is jokingly called the configuration engineer. You only need to configure the functions you want. (If you remember how to configure or know how to search)

It can be seen how mature Java Spring is, but it also brings black box operations. Many people only know the configuration, but do not know the principle

What is compiled? Is it an executable file? Yes jar Bag? Monitored ip Address and port Where was it written? main Where is the function?

Many beginners have even done it for five or six years Java People (mainly Spring I don't know the principle

At that time, Java had many advantages. Spring provided a basket of solutions for enterprise development, which was the most stable

Domestic Alibaba, JD and other companies are all using it on a large scale Spring Spring Almost become synonymous with Java

Not to mention the small company, 99% of them will choose Spring if they choose Java development

Of course, Xiaobian does Android , not doing Web developed

Later contact Web development , also because it is necessary to Developer exclusive technology community , which is the website mentioned at the beginning of this article www.helloworld.net

From this, Xiao Bian and the later Go language intersected

Development experience of Xiao Bian and Go language

Speaking of Go language, I have to mention HelloWorld Developer Community (www.helloworld. net), originally in 2018, the idea of being a developer exclusive technology community came into being

When selecting technology, the first thing to decide is what language is used in the background? In what frame?

use Java Write with SpringBoot In fact, this one is very attractive to me. At least if there is any problem in the future, this set has corresponding technical solutions.

But at the same time, I also searched some online Go For language related articles, I learned about Go language in my spare time before, so I know that Go language has some great features.

For example, the syntax is simple, the function returns multiple values, inherently supports concurrency, uses channels to synchronize and trust multiple coroutines, and has rich network programming interfaces

Of course, some people criticize Go In fact, there is no generics. I think this is an advantage because generics are really difficult to understand when I'm doing C++, and the code written by generics

It is really obscure, especially the source code in STL.

In Java, generics are a little simpler than those in C++, but they are still too difficult to understand. Therefore, the editor would rather write more functions than generics because they are too brainy.

After talking about Fei Nao, I learned that swift Language, put ++ The operator has been abolished. because ++ Can be used in front ++i , can also be used in the back i++ , and the meaning is different

So, a programming language mainly depends on the design idea behind it, swift It is unnecessary to add before and after. Why bother to distinguish them

So in swift Medium, can only use i = i + 1 In this way (lower versions of swift still have++operators), I think this mind emancipating design is good.

Because adding before and adding after can distinguish, can't distinguish, can't respond to anything, can't respond to anything.

Going off the topic www.helloworld.net At last, the developer community learned Go from various materials, and also came into contact with gin, iris and other frameworks. At least use Go to write web programs

The language itself supports, providing an interface. The net package provides a fairly rich interface for writing the web. In addition, the web frameworks such as gin and iris are not very deeply encapsulated

This is exactly what I need: do not want something that is too deeply encapsulated, just rely on configuration, so that I do not know the specific principle and process

But I don't want the most primitive framework, which doesn't encapsulate anything. I think gin and iris are exactly the framework I need.

Another reason is that there is only one executable file compiled by Go language, which can be thrown to the server to run and provide services

Even nginx does not need to be installed. It provides 80 services directly. This is similar to Java, and almost nothing needs to be installed on the server

Compile an executable file and execute it on the command line. It's OK. It's too friendly for operation and maintenance. No need to install tomcat, JDK, environment configuration or nginx

This is also the most attractive thing for me

In addition, the development of Go language is quite efficient, and its performance is also very high. It is called the C language of the 21st century

So finally, I chose Go as www.helloworld.net The background language of the developer community

Comparison between Java and Go

This topic is most likely to cause a debate between good and bad languages, because programmers themselves have a very skilled tool, for example, some people use JAVA It has been used for many years and is very convenient

For example, some people only contact Go , keep saying Go Everything is good. In fact, these are unfair. At least you must have used both languages and have practical project experience.

In fact, language is good or bad. This little editor thinks it exists.

Java and Go, there is a lot of controversy now. Java has a history of more than 20 years. Various frameworks, libraries and solutions are very mature, and the performance is not poor

It is now the preferred language of many enterprises, but it is also undeniable Java There are some problems that may not exist in Go.

The Go language, which Google vigorously promotes and is also used internally, is bound to emerge because it solves some problems

But it came out late. There are no solutions for various libraries Java Is rich.

Therefore, neither of these two languages can replace the other. However, I personally believe that the future of Go must be the future of server programming

current Java and Go The debate over language is like that of the past Java And PHP Same as the dispute

History is always strikingly similar, and time will answer everything. Our quiet witness is good.

At least for now, there is no lack of work in knowing either of these two languages.

C++, Java and Go

As an experienced person, my first feeling may be that, C++ Hard work is thankless, maybe C++ and Java Front end and Android have the same salary, but do C++ Your heart is more tired

Java is really good, top students. Sometimes they can't find any fault. There are some problems, but they are not substantive

Go I really like it. I wrote it Go People from all over the world will feel this way. The language should be better, but the third-party database of Go should be richer

The development experience of the past 10 years, from c++ , java , go , I also wrote about the front end (vue) for a period of time, about a year of intermediate entrepreneurship, and about a year of PHP

To sum up, language is just a tool. It's good to use tools correctly and solve problems

But when there are multiple tools to solve the same problem, there are good and bad ones, and there are choices. Those who understand will naturally understand

If you are a student, if you just work, if you work as a backend, it is recommended that you must check the Go language

If you have worked for many years, it is not important for you to believe which language

Expand to read the full text
Loading
Click to lead the topic 📣 Post and join the discussion 🔥
Reward
zero comment
zero Collection
zero fabulous
 Back to top
Top