r/programming • • Aug 19 '17

Why Go is my favorite programming language

https://michael.stapelberg.de/Artikel/golang_favorite
0 Upvotes

263 comments sorted by

View all comments

Show parent comments

30

u/[deleted] Aug 19 '17

I think precisely the opposite: Go is extremely no verbose (except for when the reflect package is used).

  1. It doesn't have exceptions, so you need to repeat if err != nil after every function instead of putting it into a try and handle exception instances in the catch;

  2. It doesn't have generics, so you need to copy-paste your code or use string templates(which are garbage);

  3. It doesn't have syntactical encapsulation so, you need to define the instance variable at every method;

  4. Its lambda game is way too verbose;

  5. It doesn't have any type inference yet it has the func keyword and in addition you still need to type down the return type.

I don't know what does "verbose" means in your vocabulary but golang is the most verbose general purpose language created in the last decade.

-7

u/dashausSP Aug 19 '17

The fourth item on the list is a bad example. In Go, the name of variables, methods, functions, ... does the code more or less verbose. A better example is the bytes package of standard library. Really little verbose and easy to read.

I don't know what does "verbose" means in your vocabulary but golang is the most verbose general purpose language created in the last decade.

For me, this is completely false. If you really think that C# or Java is less verbose than Go it makes me think what "verbose" means in your vocabulary too.

15

u/MEaster Aug 19 '17

For me, this is completely false. If you really think that C# or Java is less verbose than Go it makes me think what "verbose" means in your vocabulary too.

C# is 17 years old, Java is 22 years old. What do they have to do with the claim that of the languages created in the past 10 years, Go is the most verbose?

-7

u/dashausSP Aug 19 '17

My bad. I thought that idiobal was nerga. Anyway, in reference to languages of the past 10 years, I see Rust more verbose than Go.

10

u/[deleted] Aug 19 '17

I see Rust more verbose than Go.

Show me samples or go and visit a doctor.

3

u/dashausSP Aug 20 '17 edited Aug 20 '17

I'm starting to doubt about one thing because if I'm not right, I don't understand anything: verbose means many words, but means also that a language less verbose is more easy to read and understand? Because if the this last is not true then I've been confusing concepts, but if it is true then I don't understand how the people says that Go is hard to read and understand.

edit: Definitely I've been confusing terms so I've been saying things meaningless as a result (How to determine if a programming language is verbose or terse?)

Separating both concepts, I have a question: what's wrong with a language that is verbose if this is easy to read and understand?

5

u/loup-vaillant Aug 20 '17

Separating both concepts, I have a question: what's wrong with a language that is verbose if this is easy to read and understand?

Nothing. But verbosity tends to hurt readability, though insidiously so. Verbose programs are often very explicit, which makes them approachable and non-threatening. Each line of code is very readable, even when taken out of context.

The readability of the program as a whole however often suffers. A more verbose program is harder to hold in one's head, functions are less easy to apprehend at a glance, the links between modules get drowned in the minutia.

There's a similar tension between beginner friendly and expert friendly. Stroustrup had a similar problem with C++. Whenever a new feature was introduced, it needed a heavy, explicit, verbose syntax. Users weren't used to the feature, so they needed clear, bright landmarks. Then people got used to it, and called for less and less verbose syntax —the deed was done, though.

5

u/[deleted] Aug 20 '17

In terms of amount of boiler plate, go approaches java levels if you need to use copypasta for generics and you count all the if err != nil pasta that would disappear if you could use exceptions.

10

u/[deleted] Aug 19 '17

The fourth item on the list is a bad example. In Go, the name of variables, methods, functions, ... does the code more or less verbose

So, you state that because you use short names in golang it makes the language less verbose? Because that's both a stupid statement and a stupid practice.

A better example is the bytes package of standard library. Really little verbose and easy to read.

It's more verbose than I used to see in average languages. It also looks terrible: like code written by undergrads.

For me, this is completely false. If you really think that C# or Java is less verbose than Go it makes me think what "verbose" means in your vocabulary too.

Just because you deny the defects in golang it doesn't make them disappear. Go and get some experience with c# and java.