What are the main features of the Go language?

Asked

Viewed 2,503 times

10

I started to hear a lot about Golang and is increasingly gaining ground among the most widely used programming languages.

As far as I know, I think it’s a programming language. So,

  • What are the main characteristics?
  • I can program and run on any operating system?
  • How the guys work in it?
  • What was the purpose of his creation?

If anyone can give me a basic idea about Golang.

1 answer

16


What are the main characteristics?

I will quote only what is most important.

It is a high-level language, much more than C, similar to C#, for example. It is compiled and generates native executable.

It was originally designed to be a language for system development and not so much for applications, but it didn’t actually happen, so it’s multipurpose and it’s used in many things for the web, although it can be used for anything.

It is of the imperative paradigm, essentially. It is modular, has encapsulation and polymorphism. Although it can embark on another type in a structure that is being created there is no mechanism of inheritance, op that limits polymorphism. It avoids features that make it multiparadigma. It prefers the most basic mechanisms.

Pointers are exposed although you cannot use them freely as occurs in C. They are more like references.

The syntax is succinct as in Python, so it attracts programmers who want more performance. Javascript programmers have also liked it. It’s kind of strange, it gets in the middle between a system language (original intention) and script (how she’s really used).

It has garbage collector so you don’t have to worry too much about memory management. It has the disadvantages of that too. She’s fast, but she can’t reach the C level.

Works with an easy way to handle parallel and concurrent processing (Channels).

I can program and run on any operating system?

No, no language can. It can run on: Freebsd 8-STABLE, Linux 2.6.23, Mac OS X 10.8, Windows XP and later versions of course. There is some support for others, but it is not official.

How the guys work in it?

I’m not sure what you want to know, but the typing is static, strong, secure, nominal and structural, manifest or inferent according to need and taste. There is no hierarchy of types.

Of course it’s safe to some extent. Because the language does not have generics, the solution is often to produce less secure codes to avoid duplication of effort. You can also dispute safety when there is structural typing where you can perform what you don’t expect. So she has a certain Feel dynamic language without having all the advantages of this.

There is proposal to have generics and there are detractors. I was once a staunch advocate, but given the way people use it I don’t know if it’s a good idea. There seems to be a Phpzação de Go going on. In fact from the start she suffers from a lack of identity of what she wants to be, but it seems that people use it as the language of script, then Generics it doesn’t make sense, along with other things. It makes you consider that everything originally thought for her is not from script, so the people who use it as script are with the wrong tool, but there is no way to fight with it, the IT world is like this, popularity counts more than technical motivation.

What was the purpose of his creation?

Originally to be a C language better than C itself. To be safer and more powerful with a better syntax, with facilities for the compiler to solve everything quickly, without context, with facilities to analyze dependencies, and simply also for humans, cannot transform into Java or C++. The creators refuse to put something that complicates the language and the compiler, which is a criticism that many do, since this prevented the creation of generics.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.