Why is Go syntax so unreadable despite being supposedly a simple language?
it's designed for typing instead of thinking
>>108790802literal C is more readable than this dogshit
>>108790800On the bright side, it's kinda predictable.
>>108790800The language was, without exaggeration, purposefully designed for retards. Go mascot is literally Glenda but retarded. Go is for retarded jewgle jeets, by Rob Pike's admission.
>>108790844>ease ifnice AI slop lil bro
>>108790844The entire stdlib has under 100 if err nilyou are coding incorrectly.
>>108791048yeah and stdlib parser does panic+recover in input errors
Part of it is go fmt. I write Go, but in personal projects where I use Go I refuse to use go fmt and it becomes somewhat more pleasant to read and reason about.
But I should also add... yeah I see OP's point. It's not unreadable the way say perl or bash or Rust are. But it's harder to figure out the big picture from it. Some say it's because it's roo verbose, but I think there might be more to that. Like the fact that methods are on the same level of nesting and are not inside structs. It's pretty elusive, but I definitely feel it.
>>108790800Is there an actually simple, statically typed lang for backend dev?Go being the only option is kind of dissapointing
>>108791261Sure, C.
>>108791261D could work too, but it doesn't have a nice templating language, at least I couldn't find anything resembling erb or go templates. Although arguably, I'd say D is better for other things and Go is well established for web.
>>108791268Webdev in c sounds painful, might as well do rust in that case
>>108791261Haskell baby.
>>108791261Types aren't real. Write your backend in assembly.
>>108791415assembly has .text though
>>108791261Groovy
>>108791399Hmm maybe a functional lang wouldnt be so bad. I was thinking about elixir and clojure also
>>108791048Well if you're writing a layered backend, you'll have a bunch of if err nill because you need to handle user errors at the uppermost layer.
>>108791820Forgot ocaml. I also just realized neither of those are statically typed
>>108791261>>108791820
>>108791230Personally I think it's the C-like syntax that makes it unreadable, but even C is more concise than Go, syntaxwise.int foo(int num) { ...}vsfunc foo(num int) int { ...}
int foo(int num) { ...}
func foo(num int) int { ...}
>>108790836literal C is the most readable language because it's simple as fuck. you sound like a retard
>>108792186I did say readable
I can read it without issue.
>>108790800Ignoring err != nil for a moment:>gofmt enforces the same style everywhereThe death of perl has been a disaster for the human race
>>108792114It's the differences from C that make it unreadable.
It's actually amazing how hard this language filters /g/
>>108790844what happens if you return nil
>>108790800Its really only two things:1. Type appearing on the RHS of variable name2. Gofmt being unconfigurable (by design) and having retarded defaults
>>108791261Just use Python with type hints.>but those aren't strictly enforced!Then just run mypy when linting. Its not hard
>>108791261unironically java with a dependency injection framework
>>108795434fake static typing is a meme and python is slow as balls
>>108791261>ask a reasonable question>literally every response is ironic or worse than go
>>108795826I hate this "dependency injection" term, it's meaningless.
>>108791261>Node JS via TypescriptSimple, with static typing, concise and readable. Plus a ton of libraries to boot. Downsides are all performance related: >Higher memory use due to runtime and GC>Higher CPU use due to runtime>Single threaded (multi-threading in Node essentially spins up a whole separate runtime)
>>108795832>and python is slow as ballsIf you enforcing optional typing, then its functionally no different than mandatory typing>and python is slow as ballsThis is true for high performance computing, but has 0 affect on the average CRUD app
>>108791261Nim3 will be great for backend. But it only recently got bootstrapped and the ecosystem is basically soft-reset.So if you don't mind a pre 1.0 lang, and some NIH.https://github.com/nim-lang/nimony
>>108797209It just means "we can't/won't overrite methods in unit tests because reflection scary therefore everything should be mockable and lets remake global variables but a little more managed"hope this helps