No optional arguments or function overloading

>no optional arguments or function overloading
>no ternary or null coalescing operators
>no proper enums
>errors (useless string wrappers) AND panic/exceptions
>must comply to coding style or you can't compile
>must comply to "suggested" directory structure or your imports get fucked
>can't compile with unused imports/declarations

And it goes on and on. Is this the worst popular programming language? My experience with it is even worse than JavaScript.

Other urls found in this thread:

github.com/golang/go/issues/1675
golang.org/pkg/io/#pkg-variables
twitter.com/NSFWRedditGif

what is this language and whats it for

for botnets

ok
the go language? (did image search)
>MUH GOOGLE MADE IT, IT HAS TAH BE GOO!
>oh wait googles security division
>nvm

None of those are bad things you're just a retard

Go

oh and did you know if you php:

$oq = "SELECT * FROM users";
$oq[strlen($oq)-1] = "";


thatll break ur query
php must be bad then

desu go might replace php for me in the aspect of rapid prototyping, i fucking hate web dev but php is the only good language for rapid that i know

>forced to make your code look like shit while wasting space
>not bad
I bet you're a student who programs hello worlds in c just to seem cool

dont forget making a class devoted to changing text color in the terminal, that shit coo

>opinions
Nobody cares kys pls

Prototyping is a meme, if you are competent you don't need it.

It's easier to setup a database connection using a prototype language then a harder language, I know a bunch of other languages and PHP has to be the easiest for database connections

Prototyping isn't a meme kind sir :-)

Go is supposed to be an alternative to Java/C++/C, at least for some applications. it does the job, and it does it very well.

if you want syntactic sugar and magic, use another language, it's simple...

And it does so with an import system made for package managers(tm) and while removing shit like semicolons to end lines just to ADD THEM BACK before compiling. You have to write blocks that are hard to read and look horrid for LITERALLY NO REASON.
Does C force you to use the variables you declare or your imports? I'm pretty sure the compiler gets rid of it silently. What if I want to debug by printing to the console? Oops, gotta re-add that import that I had to remove earlier because I wasn't using it at this specific point in time. In the middle of implementing a feature? Oops, gotta remove 5 variables before testing.

Want to use some function and perform a comparison? Oops, it returns error once in a blue moon with a string that you have to look up and hope it never changes or compare with nil to make sure shit werks instead of just handling exceptions. Now you have to turn your comparison into a line twice as long or split it into 3 statements instead of 1. So simple I die of old age before I get anything done.

>no optional arguments
wrong
>function overloading
good, but you don't understand interfaces
>no ternary or null coalescing operators
good
>no proper enums
const is better than enums because it is of arbitrary width and precision
>errors (useless string wrappers)
not useless in the slightest
>must comply to coding style or you can't compile
good
>must comply to "suggested" directory structure or your imports get fucked
good
>can't compile with unused imports/declarations
good

>My experience with it is even worse than JavaScript.
sounds like you can't be bothered to learn how to write idomatic code

I just asked a question, you don't have to be so rude.

well, many of the things you say are true, but otoh, what makes Go great is the performance, the libs and the tools. there are languages that can transpile to Go, even functional langs... and vice-versa, you can compile JS code from Go :)

and JS compared to Go is complete shit

>What if I want to debug by printing to the console? Oops, gotta re-add that import that I had to remove earlier because I wasn't using it at this specific point in time
use println (no, not fmt.Println). or use an actual debugger, like delve

>Oops, gotta remove 5 variables before testing.
_ = myVar

Sounds like you're a code monkey.
I'm a successful businessman, I'm sure everyone here agrees with me, I've ran many successful businesses, great companies, lots of money. Here you have a war criminal, deleting thousands of e-mails, and you're telling me that designing a programming language around github is a good thing? I think it's about time China drops a nice little nuke to make America great again.

...

salty allman fag detected

get FUCKED, i'm tired of reading your shit code

>Does C force you to use the variables you declare
this has been explained over and over; unused variables are a common sign of bugs

>Oops, it returns error once in a blue moon
you're the sort of person who lets a program crash from a file-not-found exception
>a string that you have to look up
you are doing it wrong
>instead of just handling exceptions
much more complicated and messy
>Now you have to turn your comparison into a line twice as long or split it into 3 statements instead of 1.
here you go you incompetent whiner:

if a, ok := shit["cunt"]; ok { }
if a, err := shit("cunt"); err != nil { }

if you don't deal with errors (and usually an error is not an error at all, just a different circumstance that is easy to work with, which is why exceptions crashing your program by default is ridiculous) then you don't care whether your program works, end of discussion.

>>no optional arguments
>wrong
github.com/golang/go/issues/1675
???

>>function overloading
>good, but you don't understand interfaces
interfaces don't fix that, retard. that's why there are tons of library functions that take arguments that you don't need in 99% of cases.

oh default arguments

those are cancer and you should fuck off

>errors wrap strings
>can't figure out what string it returns without finding source code
>doing it wrong
???
So you think the right way to do this is just if err != nil?
Then what is the point of using that instead of exceptions (saves trouble) or just return some arbitrary value?

Proper function overloading/multiple signatures would be better, yes.

>>instead of just handling exceptions
>much more complicated and messy
At least comparing a type of exception will give you an error if the interface changes, while if you depend on something that changes its error message you have to make sure it is tested or get screwed because it's a shitty system that complicates everything.

>this has been explained over and over; unused variables are a common sign of bugs
programming is a common sign of bugs. that's what WARNINGS are for.

if you want to compare errors then you compare against the error types exported by the package

golang.org/pkg/io/#pkg-variables

e.g. if err == io.EOF

nice and easy, you retard

>exceptions (saves trouble)
hhhahaha

>just return some arbitrary value
all functions that can return errors return something like nil or 0 if they fail. e.g. functions implementing Reader.Read will return 0 only if the returned error is not nil

>while if you depend on something that changes its error message
retard didn't even bother to learn the language

>e.g. if err == io.EOF
you do realize this is a constant string and completely arbitrary and that literally anyone can use literally any arbitrary string as an error in a way that can break shit silently just by updating dependencies..........................RIGHT?

hhahahahh xD

go is a compiled language

nothing is changing underfoot

>update a dependency
>no warning or error shows up because you're COMPARING STRINGS
>shit breaks because errors are not caught properly
nice

>break shit silently just by updating
If you compile you program one day when EOF = errors.New("end of file"), and then compile the next day after updating your standard Go distribution and EOF is now = errors.New("eat shit"), then a function returning io.EOF still yields err == io.EOF and your program runs identically.

You are painfully stupid and seem to still be ignoring the fact that Go is a compiled language.

>error is not defined at global scope
>error is defined at deeper level and passed through multiple levels before being handled
durr
I guess it's hard to understand how brograbbing works when you do everything in main(), huh

io.EOF is defined at a global scope.

oh yeah i forgot there's literally 1 error in go ty for the reminder i'll update my hello world rite away

What is wrong with you? You don't seem to have written any Go programs, so you are inventing problems that do not exist because PACKAGE VARIABLES DO NOT CHANGE UNDERFOOT BECAUSE GO IS COMPILED, NOT DYNAMIC.

whatever criticism or tricky scenario you can come up with also applies to error enums in C, then

Sure, there are many things wrong with C and other languages. Just not nearly as many as Go.

You done?

Fucking this. Waste of time

Go can compiles performant multithreaded binaries, sure your code may not be aesthetic to you
But your endusers don't care that you have to copy paste your functions because you can't overload them

>PHP has to be the easiest for database connections
Topkek

>PHP has to be the easiest for database connections
Topkek

if io.EOF is defined as EOF = errors.New("whatever"), then when you do err == io.EOF, you're not doing a string comparison - you're comparing a variable reference.

Go has some valid criticisms but there aren't any in this thread so far

correct

>A language that doesn’t have everything is actually easier to program in than some that do.

>— Dennis M. Ritchie

suck it

>>no optional arguments or function overloading
fair point
>>no ternary or null coalescing operators
fair point
>>no proper enums
fair point
>>errors (useless string wrappers) AND panic/exceptions
fair point
>>must comply to coding style or you can't compile
Good thing, prevents pajeets from writin shit code
>>must comply to "suggested" directory structure or your imports get fucked
Good thing, prevents pajeets from writin shit code
>>can't compile with unused imports/declarations
Good thing, prevents pajeets from writin shit code
>And it goes on and on. Is this the worst popular programming language? My experience with it is even worse than JavaScript.
Dunno, i doubt it can be shittier than js

...

>no newlines before opening braces
>} else {
>import "github.com/retard/dumbshit"
>not shit code

>using a picture of the smiley with a carat nose

and if it's not defined globally and publicly what do you do then, retard?

also having to define errors at public global scope in every function is BLOAT
just like having to handle string errors whenever you call a function making you unable to pass return values directly