Go is fucking retarded

Go is fucking retarded.

Let's look at the code to check if a list contains an item.

Java:
myList.contains("My string");

Python:
'My string' in my_list

Go:
func contains(s []int, e int) bool {
for _, a := range s {
if a == e {
return true
}
}
return false
}
and repeated for every type you want to use it for

>b-but performance!!
Since the convenience battle is already lost we might as well compete on speed, eh?

reverse-complement
Go 0.48
C gcc 0.42
pidigits
Go 2.04
C gcc 1.73
regex-dna
Go 3.28
C gcc 2.43
fasta
Go 1.98
C gcc 1.36
fannkuch-redux
Go 15.84
C gcc 9.07
spectral-norm
Go 3.95
C gcc 1.98
n-body
Go 21.52
C gcc 9.56
k-nucleotide
Go 17.36
C gcc 6.46
mandelbrot
Go 5.64
C gcc 1.64
binary-trees
Go 39.68
C gcc 3.28

>O-oh, but what about C++?

reverse-complement
Go 0.48
C++ g++ 0.59
regex-dna
Go 3.28
C++ g++ 3.89
mandelbrot
Go 5.64
C++ g++ 5.82
pidigits
Go 2.04
C++ g++ 1.89
fannkuch-redux
Go 15.84
C++ g++ 13.17
fasta
Go 1.98
C++ g++ 1.47
spectral-norm
Go 3.95
C++ g++ 2.01
n-body
Go 21.52
C++ g++9.30
k-nucleotide
Go 17.36
C++ g++ 7.15
binary-trees
Go 39.68
C++ g++ 7.23

Wow, it actually won! on 3/10 tests and by microseconds each time.
Also, the binaries are fuck huge (2MB for fucking hello world, C version is 10KB).

There is literally NO reason to use this pile of garbage. Do yourself a favor and use something that can actually compete, like Rust.

Other urls found in this thread:

benchmarksgame.alioth.debian.org/u64q/go.html
benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=gpp
nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/
rust-lang.org/en-US/team.html#Language-design-team
github.com/Microsoft/vscode/issues/19983#issuecomment-283714789
docs.python.org/3/library/dis.html
twitter.com/SFWRedditVideos

Is the C and C++ compiled with optimizations on?

does go use retarded curlybraces and semicolons too?

>Go is fucking retarded.

Thanks for pointing that out, Captain Obvious.

>example code from Java, Python
>performance compared with C, C++
the fuck man?

Ruby:
for_you = Array.new
for_you filesize: 4.47MB

Go bashing thread?
Go bashing thread!


Let's look at Quicksort.

First in Ruby:
def quicksort(*ary)
return [] if ary.empty?
pivot = ary.delete_at(rand(ary.size))
left, right = ary.partition(&pivot.method(:>))
return *quicksort(*left), pivot, *quicksort(*right)
end

Whoa, that was short, but hey, performance is EVERYTHING, right?

So let's look at C:

void swap(int *a, int *b) {
int tmp = *a;
*a = *b;
*b = tmp;
}

void quicksort(int *begin, int *end) {
int *ptr, *split;
if (end - begin

C++:
std::find(vec.begin(), vec.end(), "My string") != vec.end()
Maybe not the clearest but still one line.

Rust:
vec.contains("My string")

import "strings"

string := "string"

strings.Contains(string, "t")

No major systems language has emerged in over a decade, but over that time the computing landscape has changed tremendously. There are several trends:

Computers are enormously quicker but software development is not faster.
Dependency management is a big part of software development today but the “header files” of languages in the C tradition are antithetical to clean dependency analysis—and fast compilation.
There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing people towards dynamically typed languages such as Python and JavaScript.
Some fundamental concepts such as garbage collection and parallel computation are not well supported by popular systems languages.
The emergence of multicore computers has generated worry and confusion.

We believe it's worth trying again with a new language, a concurrent, garbage-collected language with fast compilation. Regarding the points above:

It is possible to compile a large Go program in a few seconds on a single computer.
Go provides a model for software construction that makes dependency analysis easy and avoids much of the overhead of C-style include files and libraries.
Go's type system has no hierarchy, so no time is spent defining the relationships between types. Also, although Go has static types the language attempts to make types feel lighter weight than in typical OO languages.
Go is fully garbage-collected and provides fundamental support for concurrent execution and communication.
By its design, Go proposes an approach for the construction of system software on multicore machines.

A much more expansive answer to this question is available in the article, Go at Google: Language Design in the Service of Software Engineering.

Go was born out of frustration with existing languages and environments for systems programming. Programming had become too difficult and the choice of languages was partly to blame. One had to choose either efficient compilation, efficient execution, or ease of programming; all three were not available in the same mainstream language. Programmers who could were choosing ease over safety and efficiency by moving to dynamically typed languages such as Python and JavaScript rather than C++ or, to a lesser extent, Java.

Go is an attempt to combine the ease of programming of an interpreted, dynamically typed language with the efficiency and safety of a statically typed, compiled language. It also aims to be modern, with support for networked and multicore computing. Finally, working with Go is intended to be fast: it should take at most a few seconds to build a large executable on a single computer. To meet these goals required addressing a number of linguistic issues: an expressive but lightweight type system; concurrency and garbage collection; rigid dependency specification; and so on. These cannot be addressed well by libraries or tools; a new language was called for.

Programming today involves too much bookkeeping, repetition, and clerical work. As Dick Gabriel says, “Old programs read like quiet conversations between a well-spoken research worker and a well-studied mechanical colleague, not as a debate with a compiler. Who'd have guessed sophistication bought such noise?” The sophistication is worthwhile—no one wants to go back to the old languages—but can it be more quietly achieved?

Go attempts to reduce the amount of typing in both senses of the word. Throughout its design, we have tried to reduce clutter and complexity. There are no forward declarations and no header files; everything is declared exactly once. Initialization is expressive, automatic, and easy to use. Syntax is clean and light on keywords. Stuttering (foo.Foo* myFoo = new(foo.Foo)) is reduced by simple type derivation using the := declare-and-initialize construct. And perhaps most radically, there is no type hierarchy: types just are, they don't have to announce their relationships. These simplifications allow Go to be expressive yet comprehensible without sacrificing, well, sophistication.

Another important principle is to keep the concepts orthogonal. Methods can be implemented for any type; structures represent data while interfaces represent abstraction; and so on. Orthogonality makes it easier to understand what happens when things combine.

These are lists not strings

If this doesn't make your dick hard you aren't a profesional programmer, and if you are, you're probably a pajeet who learned Java or C++ at a bootcamp and are strongly afraid of change because it means you might lose your job (And you're too stupid to learn another language).

ITT brainlets

>python fag

Multiple function returns are comfy. Glad Rust has it

Kill yourself, shit for brains.

It's literally useless. If you can tolerate a GC, then there's already C#, Java, Haskell, Scala, and Ocaml. Maybe even Python, Ruby, or Bash depending on what you're doing and your performance requirements. And for things that actually need to be as fast as possible, Go is already out of the running.

>tl;dr: I love you Google please hire me!!

>I've never been employed

Go beats Java and C++ in most benchmarks

benchmarksgame.alioth.debian.org/u64q/go.html

benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=gpp

>scala

It has all the over head of Java

>Haskell

Literal hobbyist language

>Ocaml

Not worth the effort when compared to Go

>python, ruby, bash

Are you retarded? Go out performs all of them and has a more simple and safer syntax, there is absolutely no reason to choose an interpreted language over Go.

>Go beats ... C++ in most benchmarks
Are you blind?

>contains
So just write a fucking library for it and make a pull request jesus ffs

Why not use pure asm then?

maybe you should compare the performance of some real applications, not 5 lines of code.

Also, Go has only been around for less than a decade and it's already about to surpass the performance of Java/C++ in most categories, which says a lot about those languages.

C++ has had 17 versions and over two decades to get things right, yet everyone still hates using it.


Choosing to use C++ or Java over Golang is masochism. The few areas where C++ and Java excel are single threaded operations that can't be paralleled.

The only reason to use C is if you have to have the performance, and in many cases safety is more important than performance.

See:

So deluded.

I like Go, just wish it had generics so retarded faggots like OP couldn't make these threads that cherry pick examples.

Go excels in developing projects of large size with multiple developers. If you're a professional fizzbuzzer I recommend an interpreted language instead.

What the hell are you smoking?

Go doesn't beat C++ and it beat Java only in tiny tasks where Java has the disadvantage of JVM startup time.


Go is slightly faster than Python, Ruby or Bash (or at least until we see the next version of them) but is nowhere close when it comes to frameworks or functionality. And theres no way you can think this..

import "fmt"

func fib() func() int {
a, b := 0, 1
return func() int {
a, b = b, a+b
return a
}
}

func main() {
f := fib()
fmt.Println(f(), f(), f(), f(), f())
}

..is more readable that Python..

def fib(n):
if n < 2:
return n
return fib(n-2) + fib(n-1)


..or Ruby:

f = ->(x) { x < 2 ? x : f[x-1] + f[x-2] }

puts f[10]

As the other user said, Go is a weird middle ground. It's to verbose to give you the productivity of Python or Ruby and too powerless to compete with Java or C#.

Turning expensive O(n) operations into one-liners make the code harder to reason about.

Go was designed by people involved in multi-million lines C/C++ and Java projects.

>No major systems language has emerged in over a decade..

..and with "systems language" we mean "programming language", not really "systems language"..
:^)

>..but the “header files” of languages in the C tradition..

Because all languages use header files? WTF?

>There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing people towards dynamically typed languages such as Python and JavaScript.

There's a growing rebellion against cars, pushing people to use bicycles and planes.

>We believe it's worth trying again with a new language, a concurrent, garbage-collected language with fast compilation.

You mean Erlang?

Ah no, I see. Go is so concurrent, especially the """great idea""" of concurrency with a shared state. :^)

>Go provides a model for software construction that makes dependency analysis easy and avoids much of the overhead of C-style include files and libraries.

That's cool - if Go really was a systems language and as fast as C.
(Protip: it's not.)

>Go was born out of frustration with existing languages and environments for systems programming.

"Programming is too hard."
- t. Pajeet

>Programmers who could were choosing ease over safety and efficiency by moving to dynamically typed languages such as Python and JavaScript rather than C++ or, to a lesser extent, Java.

Yes!
I hate it when I have to chose between knife, spoon and fork. Let's all use the spork!!! :DDD

>Programming today involves too much bookkeeping, repetition, and clerical work.

LMFAO.
Go is all about writing boilerplate code, because a simple map/reduce is "too complicated". Is this bait?

>Another important principle is to keep the concepts orthogonal.

What is he even trying to say here? That "+" and "*" is the same in other languages?

>C++ has had 17 versions
My sides are in orbit

>Choosing to use C++ or Java over Golang is masochism
Choosing to use Go is masochism. It's on par with Java in terms of boilerplate. if err { ... } if err { ... } if err { ... } etc. Oh sorry I forgot, you can't say "if err", it's "if err != nil".

but then in Go, you just use your contains function that you defined, in a single line.
In Java, it was just included for you.

>C++ has had 17 versions

...

>Go was designed by people involved in multi-million lines C/C++ and Java
go was designed because google couldn't find enough pajeets and they need a lang retarded enough so it could be used by a monkey

>in Go, you just use your contains function that you defined, in a single line

No, stop drinking the DRY kool-aid.

The designers of Go knew very well that putting expensive O(n) operations into one-liners is an anti-pattern in long-lived multi-million line software projects.

This is funny because it is true:

>nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/

>multi-million line software projects

..and with Go you are quickly at this size, huehuehue..

>The designers of Go knew very well that putting expensive O(n) operations into one-liners is an anti-pattern
Once you've written that O(n) `contains` function, calling it is a one-liner. Even in Go.

>No, stop drinking the DRY kool-aid.

The most stupid thing I have heard today.

"I'm to intelligent for go!!11"

The blog post

>i'm a low self-esteem down-to-earth yeat another snowflake and everyone should be the same
The Sup Forums post

>Once you've written that separate O(n) `contains` function for every type you're using
FTFY

If go is so shit, why does Sup Forums recommend programs written with it?

Sure, but that's a totally separate issue.

>it's impossible to write good software in a bad language

Go is not "slightly faster" than ruby and python, it is orders of magnitudes faster and often beats out Java and C# in terms of performance despite being a much younger and immature language.

Also that ruby example is fucking hard to understand. I prefer the python one.

>good software
How do you know that it's good? Just because you find if useful doesn't make it good.

I like Go because I picked it up quickly and it lets me deploy statically linked binary blobs. Decent performance is a nice bonus.

If you care about speed that much, use c/cpp
python is used because its comfy to write, fast enough, general purpose and ecosystem is large and mature
Go is a dick meme google is forcing on its hamsters and you fall on it

And just because it's written in Go doesn't make it shit. Don't be retarded.

If it's written in Go, it has the crippling weakness of not being written in C.

It's just C but protected from google's army of pajeets.

>garbage-collected language
>systems languages
Dropped.

Also why do they say systems languages like it's plural? C is the only systems language.

>doesn't make it shit
It does, because it sets the precedent for what kind of developer(s) are behind it.

Go is a google meme that they will get bored of and stop supporting. It's stupid to use it

C is harmful and unfortunately java is super widespread as a systems language so there are more of them.

Rust will show them all. Even google engineers like it.

>Go beats Java and C++ in most benchmarks
Who the fuck cares? If it's supposed to be a systems language it's competing against C.

>Rust
Please, user. The adults are discussing systems programming.

>Rust will show them all
>Rust

Do you mean the language made by former Ruby on Rails and Ember.js contributors?

For the vast majority of programs, it doesn't actually matter.

That's a weak correlation at best. Maybe if you had literally no other information to go on, it would be helpful, but that seems like an unlikely scenario.

It's a meme and stupid to use, but I doubt Google will drop it. Assuming, of course, that it's actually getting significant internal usage like the Go devs claim.

>The adults are discussing systems programming.
No, we're discussing Go.

>fast enough
kek

Which of these six people are Ruby/Ember contributors?
rust-lang.org/en-US/team.html#Language-design-team

Just a quick look shows that Steve Klabnik and (((Yehuda Katz))) make up 1/4th of the core team.

They are both web developers.

>all those fucking numales
Holy shit

Steve does docs and wycats does Cargo. As far as I know all the people working on the language design and the compiler are actually competent.

(((REFUGEES WELCOME))) INTENSIFIES

Most of them have stuff like Rails forks on their Github pages. Why are you pretending not to know about this?

The only people who don't like Golang are brainlets.

"herp derp Go is too easy so it's for stupid people I'm going to hinder my self with C++ and fear new languages because I had a hard enough time learning C++"

>what is object pascal
>what is oberon
>what is ada
>what is burroughs algol

>C is harmful
programlet spotted

Who, specifically, has major contributions to Rails or other webdev projects?

Remember I'm only talking about the language and compiler teams here. The rest can shit up the stdlib and cargo (>implying it's not already shit) all they want, those parts are easy to replace.

The only languages that have an ISO are relevant.
You can shit on C or C++ whatever you want but nobody is going to change to meme languages for critical stuff because those meme languages are not mature yet.

Alright Go/Rust shills. Name 1 reason automatically picking the latest releases of a package from a repo without letting users pick previous versions is a good idea.

None of those are bare metal you fucking moron.

>herp derp i am going to shit on Go in Sup Forums until i die so jedi younglings won't fall for yet another coy
also, fuck googel and recaptcha

It's not too easy. It's too simple.
I bet you like BASIC too.

Sorry you're stuck with UNIX, kid.

It's not. Rust is a good language but cargo is trash (just like all other language-specific package managers/build systems). And also, cargo doesn't actually have the problem you're talking about. You can put version constraints on your dependencies and it will pick a version that satisfies those constraints.

>Rust is a good language but cargo is trash
You need Cargo to compile Rust.

Nothing inherently wrong with a language package manager and it's not even mandatory.

To build rustc + libstd? Maybe. You can probably still put it together with manual `rustc` invocations on src/lib*/lib.rs in the right order, but I haven't tried.

Relevant to this thread, maybe
github.com/Microsoft/vscode/issues/19983#issuecomment-283714789
I don't have an account so I can't chime in on this to tell them to avoid using Rust

Judging only from the conceptual and the syntax I've seen in various examples over time I'd say Go seems like a language which does a lot of things right/better than many of it's predecessors. However, it's C-isms to me are still too apparent. I'm just not at all fond of languages that even *try* to be C. C is not that perfect of a language that one should even borrow from it. Of course you can now go ahead and say
"You don't expect language designers to throw everything overboard and design a language that is completely alien to everyone?"
Which is 100% fair, but I'd say that the main problem with this line of reasoning is that we are reaching a point where trying to be too familiar just leaves you with a language that has been done before. I consider C and everything related to it pretty much done at this point. It's time to start fresh, be ridiculous, try out crazy things. Design, to me, is a bit like nonlinear fitting: if your initial guesses are too similar, you'll forever be stuck in the same local minimum. I want to see something exotic again

As someone who found C syntax revolting from the get-go and wouldn't touch system programming with a 5 kilometer pole I don't expect to (and honestly hope not to) be taken fully seriously on the matter, since it's not my area of competence.

Why are we programmers so ugly?

New languages should be familiar enough for an experienced programmer to learn in a day and use in production in a week.

What exactly are you complaining about? Are you hoping for higher-level abstractions than pointers, or do you just really hate curly braces for some reason?

>tfw no loyal dog who playfully bites me

I don't get what go even solves desu.

I'd rather use java, at least java has lambdas and proper OO and some basic generics.

it also has the same "single binary - run everywhere" meme and even more so since it actually does run everywhere, including different CPU archs and OSes

>have big forehead
>lower your eyebrows and take picture from an angle that makes it look even bigger

If we weren't we'd have chosen a respectable profession not bred out of a solitary youth

delet this

it's not the curly braces alone. It's not the tendency to entropy-encode everything into ascii special characters alone. It's certain abstract structures. But of course also elements; a void here, a * there, ;s all over the place. It's hard to put into words but when you look at the cornucopia of languages out there you just see it. You see how languages like fortran77 or algol68 are just .. in many ways different from C. Not better, but different. And then you have your Ds and Gos and heck even perls.

it's a fair argument. Reasonable, practical. The main issue I have is that familiar doesn't necessarily mean similar. The human brain is a wondrous thing which can find analogy in seemingly polar opposites. Being similar to another language is a crutch, an easy way out. Everything else takes much, much more work. But, ultimately, this work should be done. Or at the very least tried! Lisp is a good example of what I mean. No matter the opinion one might have of it, it is a very alien language. A person that has some good experience with, say, python for example should easily be able to program in lisp within a week. Not because the languages are similar, but because in some abstract sense the workflow of both languages has it's parallels.

>using the smiley with a carat nose

This is insane. Being retarded to that level should be a criminal offense.

Python isn't "fast enough". It's literally as slow as can be. It's impossible to be slower than python without writing the interpreter in a language slower than C, basically. Anything even remotely non-retarded compiles to bytecode on-the-fly before being interpreted, which gives the opportunity to optimize, which in turn allows running orders of magnitude faster -- when including the compile time.

Cargo does nothing special on the compiling/linking end, so yes you can.

>Anything even remotely non-retarded compiles to bytecode on-the-fly before being interpreted
You mean like what CPython does?

That's literally what it doesn't do.

docs.python.org/3/library/dis.html
>The dis module supports the analysis of CPython bytecode by disassembling it. The CPython bytecode which this module takes as an input is defined in the file Include/opcode.h and used by the compiler and the interpreter.