[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 / qa] [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


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 17080855-1689743287926.png (120 KB, 1400x791)
120 KB
120 KB PNG
why would you pick Go over C# for backend or Python for CLI stuff? this is a genuine question, i'm trying to understand if it's worth my time learning it.
>>
4dalulz
>>
File: IMG_0409.jpg (69 KB, 457x680)
69 KB
69 KB JPG
>>101201520
>pros over C#
simpler, doesn’t force you into an OOP paradigm, standard library is good enough for most use-cases, not associated with microsoft, goroutines and channels make concurrent programming simpler
>pros over python
compiles to a binary, faster, strongly typed, easier to performance profile, doesn’t rely on hacky dependency management like venvs
>cons
error handling is ugly, no functional programming utilities like map/filter/reduce, generics are very primitive
>>
>>101201520
Because Go compiles to a static binary that doesn't require anything else to be installed on the target machine.
Just copy your binary onto it and run it. Simple as.
No runtime to install, no interpretter needed.
>>
>>101201728
have you heard of C#'s NativeAOT?
>>
>>101201752
I hadn't until right now.
That looks very promising and is a major point in C#s favor if it works as advertised.
>>
>>101201520
C# blows. I would rather just use C++ if I want to use a C#-like language.
>>
>>101201715
Basically this. Error handling is ugly but it works well and after having errors as values it's hard to go back to try/except, throw/catch blocks. Developing in go is like developing in an interpreted language due to its compile speed. Its lsp is the best I've ever used.
>>
>>101201781
>if it works as advertised
a big if
plenty of libraries won't build in this mode still, kek
>>
>>101201807
>le go errors bad
This meme needs to end. You can make your own try/except with a thin wrapper around panic/recover if you really care. You can also create Rust-style result monads with generics if you really care.
>>
>>101201728
literally the same for C#. you can make a single self contained executable that includes the runtime
>>
>>101201828
>>101201752
even without AOT you can have a single executable that contains the runtime, retards
>>
>>101201715
The second pajeets start interacting with Go to the degree they do C# or Java, I will again search for another language and delete all my public repos and open-source libraries in Go and move to something obscure.
>>
>>101201752
It’s a poopoo-in-loo language. Smearing makeup on it doesn’t make it any less of a pig. I don’t want to be associated with C# because it’s low-class. You could rewrite the language from scratch and many people still wouldn’t want to be associated with it.
>>
>>101201520
it does not matter. do whichever one you like the most
>>
>>101201884
You're either a jeet or illiterate. When did I say they were bad?
>>
>>101201520
>why would you use a flat screwdriver instead of a cross screwdriver?
its a preference, why cant you retards never understand that?
>>
Because I'm not a wintoddler so I have better choices than Visual Studio.
>>
>>101202353
You might be the ESL. I wasn't talking about you in particular.
>>
>>101201728
how do you orchestrate that?
k8s expects containers. single static binary is irrelevant.
>>
>>101202817
by copying the binary into the container, often it is debian so depending on dynamic libraries is impossible anyway since debian is garbage
>NOOOOO, YOU NEED 800GB CONTAINER THAT NEEDS 3000 HOURS TO BUILD
>>
>>101202817
You can just copy it into an empty container via
FROM scratch
>>
>>101201520
> Go over C#
I don't know if you are familiar with C# and like MS, stick to it. Otherwise, Go has also a nice ecosystem and the binaries work fucking everywhere and definitively worth your time.
Fuck Python.
>>
>>101201520
I've used C# and liked it well enough - it's clearly built for people to do real work in, with no fooling around. The OO stuff is a little heavy for most uses, though, and I've been moving away from Microsoft, so Go is a pretty natural "just-works" professional language.
>>
>>101202620
??? Wouldn't you choose the screwdriver based on the screwhead? Where does preference come into that?
>>
Go is fine and all, until you try and use it for building shared libraries. Any single process can only consume a single shared library built with go. If you load another one, shit goes haywire.
These folks found out the hard way: https://github.com/apache/arrow-adbc/issues/1841
>>
>>101201520
yes
Python's lack of type safety is annoying.
Go has wonderful support for easy concurrency, which is one of the most important features for modern languages.
I have built around 15 projects in Go and never have I felt "wow I should not have done that."
I worked an old job in Python and Typescript and everyday I hated it
>>
Can anyone tell me how the fuck do you render html in golang? i couldn't get simple code autocompletion in vs code
>>
>>101205214
text/template or if u want lsp try templ
>>
>>101202817
the whole point of a container is to minimize it as much as possible so the best case scenario is it's just the binary, do exactly what the other anon said, have a multistage build that builds the binary then does a "from scratch copy", google an example of it
>>
>>101201520
>if it's worth my time learning it
there is almost nothing to learn, 90% is covered in an hour video
https://youtu.be/8uiZC0l4Ajw
>>
>>101201520
Better syntax even if it's half baked
>>
>>101201520
C#'s entire goal is to bait you and lock you into Microsoft's ecosystem. They've done it since the 90s and if they see a competing product they can't acquire, they throw millions at creating an alternative that they control, to then use that to push you into their ecosystem. Just for that reason, C# or anything Microsoft is a no.
>>
>>101205214
with gopls + templ
>>
>>101204778
Read the comments, this is a non-reproduce-able bug.
It's also a Mac + amd64 only bug.
>>
>>101206495
in the last 10 min he builds "simple" api but he uses some packages for middlewares, http, requests, that he does not explains at all
literally needs hours of learning the API of those package to actually build a simple api in Go
>>
>>101206681
https://github.com/golang/go/issues/65050#issuecomment-1885233457
>Using multiple c-shared libraries in the same process is never really supported
>The underlying problem is that currently each Go runtime assumes it has the complete information of all Go code in the process, and there is no other runtime or Go code exist in the same process.
doesn't appear very mac+amd64 specific to me
>>
>>101206832
well that what happens when u dont wanna implenment stuff like auth urself, the api are decent tho after looking at the examples once
>>
>>101207431
>well that what happens when u dont wanna implenment stuff like auth urself
>reinventing the wheel
i value my time
>>
File: 1695023179185958.png (2.79 MB, 2000x4588)
2.79 MB
2.79 MB PNG
Another reverse .NET shill thread
>>
>>101201520
It’s Rust for the blue team rather than the orange team. Both are retarded.

Rust is a schizo post of a language but Go is nothing more than a half baked language with terrible ideas implemented to the point you think the devs were smoking crack.

What people actually want is C++ but not dogshit, as long as you literally just reinvent the wheel to be C++ but cleaner, not insane with its STL, and a decent package manager/importing system, you won.
>>
>>101207569
>as long as you literally just reinvent the wheel to be C++ but cleaner, not insane with its STL, and a decent package manager/importing system, you won
sounds like Nim
>>
everytime i use something thats made with Go it puts a stupid Go folder in my home directory. i instantly remove it and whatever i installed. fuck you
>>
>>>/a/>>>/ck/
>>
using static Math;
public implicit extension for Math {
public static int Clamp(int x, int min, int max) => Min(Max(x, min), max);
}
>>
>>101207569
>What people actually want is C++ but not dogshit
Also called "people don't want C++ at all, except for the people brain-damaged beyond repair by it".
>>
>>101208238
the biggest c++ haters are C++ devs, there is no language where the users are as critical of the tool they use as C++ dev, most of the C++ alternatives that popped these last few years were created by C++ devs.
there is no such thing as C++ brainrot, you thinking of webshitter and scripters who have no engineering and CS background.
>>
File: 1719698563273675.png (2.59 MB, 2000x4588)
2.59 MB
2.59 MB PNG
yet another jeetsharp shiller
>>
>>101208117
is this go?
>>101208623
>>101207495
i hate you you're so autistic
>>
File: 1705047640605627.png (121 KB, 856x488)
121 KB
121 KB PNG
>>101208753
fuck off. .NET fags are worse than Rustfags.
>>
>>101208238
Yea, going on forums about it you get two types of people
>kool aid drinkers who refuse to see the 50 plus years of tech debt
>people who hate it but got a job in it
>>
Honestly I don't think it makes as much difference as people think. Both Go and C# allow you to build the same kind of systems. They have chosen different tradeoffs, at the end of the day over a longer period of time I'm willing to bet productivity averages out to be the same

TLDR who gives a shit just pick whatever you're most comfortable with
>>
>>101201520
Goroutines are very lightweight and allow you to literally create thousands of threads with minimal impact.
There are a lot more than that, check comparison on go against other languages on performance and you'll see.
Here's a video for example: https://www.youtube.com/watch?v=yPcWzSlsteA
>>
>>101210161
>primereact
fucking normie
>>
>>101201715
i do the last one and havent touched programming since my freshman year course
>>
>>101201715
>error handling is ugly
if err != nil {
// code
}

...

if err != nil {
// code
}

...

if err != nil {
// code
}

...

if err != nil {
// code
}
>>
basically this >>101201715
although,
>not associated with microsoft
this is a con actually since its google

another pro: compile time is lightning fast, binaries are relatively small
>>
because i'm not indian
>>
>>101210161
>https://www.youtube.com/watch?v=yPcWzSlsteA
holy shit that guy is a retard
>>
can i just write go templates with .html extention?



[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.