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
>>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 pythoncompiles to a binary, faster, strongly typed, easier to performance profile, doesn’t rely on hacky dependency management like venvs>conserror handling is ugly, no functional programming utilities like map/filter/reduce, generics are very primitive
>>101201520Because 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.
>>101201728have you heard of C#'s NativeAOT?
>>101201752I hadn't until right now.That looks very promising and is a major point in C#s favor if it works as advertised.
>>101201520C# blows. I would rather just use C++ if I want to use a C#-like language.
>>101201715Basically 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 advertiseda big ifplenty of libraries won't build in this mode still, kek
>>101201807>le go errors badThis 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.
>>101201728literally the same for C#. you can make a single self contained executable that includes the runtime
>>101201828>>101201752even without AOT you can have a single executable that contains the runtime, retards
>>101201715The 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.
>>101201752It’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.
>>101201520it does not matter. do whichever one you like the most
>>101201884You'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.
>>101202353You might be the ESL. I wasn't talking about you in particular.
>>101201728how do you orchestrate that?k8s expects containers. single static binary is irrelevant.
>>101202817by 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
>>101202817You can just copy it into an empty container via FROM scratch
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.
>>101201520I'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
>>101201520yesPython'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
>>101205214text/template or if u want lsp try templ
>>101202817the 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 itthere is almost nothing to learn, 90% is covered in an hour videohttps://youtu.be/8uiZC0l4Ajw
>>101201520Better syntax even if it's half baked
>>101201520C#'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.
>>101205214with gopls + templ
>>101204778Read the comments, this is a non-reproduce-able bug. It's also a Mac + amd64 only bug.
>>101206495in the last 10 min he builds "simple" api but he uses some packages for middlewares, http, requests, that he does not explains at allliterally needs hours of learning the API of those package to actually build a simple api in Go
>>101206681https://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
>>101206832well 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 wheeli value my time
Another reverse .NET shill thread
>>101201520It’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 wonsounds 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 dogshitAlso called "people don't want C++ at all, except for the people brain-damaged beyond repair by it".
>>101208238the 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.
yet another jeetsharp shiller
>>101208117is this go?>>101208623>>101207495i hate you you're so autistic
>>101208753fuck off. .NET fags are worse than Rustfags.
>>101208238Yea, 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 sameTLDR who gives a shit just pick whatever you're most comfortable with
>>101201520Goroutines 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>primereactfucking normie
>>101201715i do the last one and havent touched programming since my freshman year course
>>101201715>error handling is uglyif err != nil { // code}...if err != nil { // code}...if err != nil { // code}...if err != nil { // code}
if err != nil { // code}...if err != nil { // code}...if err != nil { // code}...if err != nil { // code}
basically this >>101201715although, >not associated with microsoftthis is a con actually since its googleanother pro: compile time is lightning fast, binaries are relatively small
because i'm not indian
>>101210161>https://www.youtube.com/watch?v=yPcWzSlsteAholy shit that guy is a retard
can i just write go templates with .html extention?