[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1763920924756654.png (16 KB, 183x572)
16 KB PNG
Why is Go syntax so unreadable despite being supposedly a simple language?
>>
it's designed for typing instead of thinking
>>
>>108790802
literal C is more readable than this dogshit
>>
File: go_err_nil.png (1.45 MB, 1376x768)
1.45 MB PNG
>>108790800
On the bright side, it's kinda predictable.
>>
>>108790800
The 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 if
nice AI slop lil bro
>>
>>108790844
The entire stdlib has under 100 if err nil
you are coding incorrectly.
>>
>>108791048
yeah 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.
>>
>>108790800
Is there an actually simple, statically typed lang for backend dev?
Go being the only option is kind of dissapointing
>>
>>108791261
Sure, C.
>>
>>108791261
D 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.
>>
>>108791268
Webdev in c sounds painful, might as well do rust in that case
>>
>>108791261
Haskell baby.
>>
>>108791261
Types aren't real. Write your backend in assembly.
>>
>>108791415
assembly has .text though
>>
>>108791261
Groovy
>>
>>108791399
Hmm maybe a functional lang wouldnt be so bad. I was thinking about elixir and clojure also
>>
>>108791048
Well 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.
>>
>>108791820
Forgot ocaml. I also just realized neither of those are statically typed
>>
File: 1767076306731861.png (15 KB, 250x121)
15 KB PNG
>>108791261
>>108791820
>>
>>108791230
Personally 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) {
...
}

vs
func foo(num int) int {
...
}
>>
>>108790836
literal C is the most readable language because it's simple as fuck. you sound like a retard
>>
>>108792186
I did say readable
>>
I can read it without issue.
>>
>>108790800
Ignoring err != nil for a moment:

>gofmt enforces the same style everywhere
The death of perl has been a disaster for the human race
>>
>>108792114
It's the differences from C that make it unreadable.
>>
It's actually amazing how hard this language filters /g/
>>
>>108790844
what happens if you return nil
>>
>>108790800
Its really only two things:
1. Type appearing on the RHS of variable name
2. Gofmt being unconfigurable (by design) and having retarded defaults
>>
File: 1763488213160241.png (58 KB, 197x265)
58 KB PNG
>>108791261
Just use Python with type hints.
>but those aren't strictly enforced!
Then just run mypy when linting. Its not hard
>>
>>108791261
unironically java with a dependency injection framework
>>
>>108795434
fake 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
>>
>>108795826
I hate this "dependency injection" term, it's meaningless.
>>
>>108791261
>Node JS via Typescript
Simple, 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 balls
If you enforcing optional typing, then its functionally no different than mandatory typing
>and python is slow as balls
This is true for high performance computing, but has 0 affect on the average CRUD app
>>
>>108791261
Nim3 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
>>
>>108797209
It 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
>>
>>108792351
This
Who the fuck has trouble reading go? That's like one of the handful of things it's good for. Curly braces are ugly but it's still readable ugliness.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.