r/csharp May 25 '22 Silver 1

Why are tools such as Docker and Kubernetes written in Go and not C#?

A lot of new tools that devs use seem to be written in Go. But why not C#? I know that C# and .Net is more than capable. Is it a lack of that kind of culture? How can we foster a more open source culture because it still seems like a lot of devs have old prejudices towards C# and .Net. I think having more interesting and useful open source tools written in C# would go a long way to change perceptions.

65 Upvotes

78

u/haho5 May 25 '22

Not sure why Docker might have been written in Go.

But Kubernetes was developed by Google which also created Golang.

25

u/alternatex0 May 25 '22

Process containers which are the basis of Docker also have its roots in Google.

6

u/locusofself May 26 '22

Are you sure about that? I don't know who contributed cgroups and namespaces to the linux kernel, but those are the primitives that a lot of containers are based on. Those were inspired in part by "zones" in Solaris (Sun Microsystems).

3

u/alternatex0 May 26 '22

Two guys at Google contributed cgroups to Linux.

9

u/locusofself May 26 '22

So despite .NET core and C# being relatively platform independent, in practice C# and .NET have historically been used more often that not for writing apps that run on Windows.

"containers" in the docker/kubernetes sense, are a construct built on top of several *linux* kernel features, cgroups, namespaces, etc.

Google invented golang, and they also invented "Borg", which is/was their internal system for running workloads, which inspired kubernetes.

I think docker itself being written in golang is probably just a matter of golang being a hip and popular language at the time (and still) for people who want to write certain types of applications, namely, multi-threaded, high performance, but easy-to-maintain (in terms of code readability and ecosystem of libraries etc).

7

u/KevMar May 26 '22

I would like to see more C# CLI tools built for PowerShell instead. Creating CLI tools is where PowerShell really shines strong. PS modules over console apps makes a much better user experience. Even if you build it in C# or keep your C# libraries. I should write up a post on this to take the mystery out of it.

But we do have crescendo that at least makes it trivial to code gen console tool wrappers.

3

u/HahahahahaSoFunny May 26 '22

If you do create a post, I would love to check it out.

41

u/TheAmericanBanana May 25 '22

My guess would be that .NET Core wasn't around when Docker and Kubernetes was started (.NET Framework was).

Also, Kubernetes and Go are both Google languages.

It could also be that Go is compiled to native.

9

u/pnw-techie May 25 '22

It's not a guess, this is just the chronology. C# was windows dotnet framework or mono for Linux when docker was made.

Kubernetes isn't a language though...

5

u/Alikont May 26 '22

mono for Linux

Nobody really took that serious to base infrastructure around.

Google was also already burned by lawsuits when they based their OS on Java.

2

u/f-berasategui May 26 '22

Google was also already burned by lawsuits when they based their OS on Java.

Oh, the irony, had they used C# instead of java none of that would have happened, and the entire Android API would have been much better.

Without properties and events (and many other features) the java language is simply unsuitable and incapable for client application development. And I would argue for everything else as well, but that's for another conversation.

4

u/Alikont May 26 '22

It's also funny listening to their lawyers in SC

Google: what were our ouptions? We needed to spend millions to develop new platform?

Oracle: yes. That's what Microsoft and Apple did.

0

u/cat_in_the_wall @event May 26 '22

kubernetes is so complicated, and especially with things like custom resource definitions, you could make a convincing case that kubernetes is indeed a language.

51

u/inna_hey May 25 '22

Why weren't they written in Rust? Or C? Or PASCAL? Or Java? Or D? Or Haskell?

122

u/Angelwings19 May 25 '22

Because

  • too cool
  • too dangerous
  • too obscure
  • too java
  • too niche
  • too esoteric

103

u/PissBlaster2k May 25 '22

too java

lol this

8

u/KRS_2000 May 25 '22

too cool, ahahaha

5

u/Professor_Cunning May 26 '22

too java

😂😂

7

u/rezell May 25 '22

Smalltalk.

1

u/fmillion May 26 '22

INTERCAL.

1

u/x6060x May 26 '22

Poor bastard!

7

u/Independent-Ad-4791 May 25 '22

Rewrite the world in Haskell and utopia emerges.

9

u/KevinCarbonara May 25 '22

C is certainly a viable option, and Rust probably is as well. Java would fall in the same boat as C#, I doubt it would work out.

No one programs in Pascal, D, or Haskell. Not like actual applications, anyway.

11

u/hpstrprgmr May 25 '22

I have had a job for 12 years where our primary code base is in Delphi. (Pascal) and yes, it’s applications.

2

u/Skarsnik101 May 25 '22

You poor bastard.

13

u/hpstrprgmr May 25 '22

I wouldn’t say poor

2

u/ThePsycho96 May 25 '22

Not poor, but shoot me when I have to edit in the Delphi IDE.

0

u/KeyAcanthisitta6650 May 26 '22

Is Delphi still a thing? Lol

8

u/Zwitschermartin May 25 '22

pandoc - one of the very best tools I discovered in the last years, is written in Haskell.

2

u/sohang-3112 May 25 '22

Another well known application written in Haskell is XMonad - it's a tiling window manager.

3

u/pnw-techie May 25 '22

Rust would be now, but it wasn't out when docker was written

1

u/Embarrassed_Quit_450 May 26 '22

C is a walking security risk via memory related attacks. New projects should not use it.

1

u/KevinCarbonara May 26 '22

C is a walking security risk

No, C isn't a "walking security risk".

1

u/Embarrassed_Quit_450 May 26 '22

Yes it is.

1

u/sacredgeometry May 27 '22

So all computers are walking security risks? Most OS Kernels are written in C. A lot of OS low level libraries are written in C.

Lots of embedded software is still written in C. Drivers, C.

If you are a walking security risk then you probably shouldn't write code but pretending like a language is at fault for your incompetence is a little ... well its a little telling.

2

u/Alikont May 27 '22

So all computers are walking security risks? Most OS Kernels are written in C. A lot of OS low level libraries are written in C.

And we have CVEs every month. Almost all of them are memory corruption bugs.

Don't pretend like proper language doesn't help mitigating entire class of bugs.

Lots of embedded software is still written in C

"Still", usually means that C++ tooling is not there yet.

Drivers, C.

Windows doesn't recommend C for drivers, and a lot of infrastructure there is built around C++.

1

u/Embarrassed_Quit_450 May 27 '22

Not being aware programming languages with no memory safety are one of the top cause of security issues... well it's a little telling about your incompetence.

1

u/sacredgeometry May 27 '22

Not knowing that programming languages can't create security issues, and that incompetent people writing code are instead at fault is pretty telling. Do you even write code professionally?

Do you know how much mission critical code is written in C? Really? It is so stupid to even entertain your opinion I am not sure where to start.

1

u/Embarrassed_Quit_450 May 27 '22

You obviously have no idea what you're talking about.

1

u/sacredgeometry May 29 '22

and yet I still know more than you. Please enlighten me how a programming language can create security issues. Even the arguable cases for an interpreted languages runtime isn't the language itself causing the problem and isn't applicable here.

So go on genius. How does a programming language specifically without a negligent or incompetent programmer create security problems?

→ More replies

2

u/pnw-techie May 25 '22

Rust didn't even exist when docker was written

1

u/gregory_rorschach May 26 '22

Rust was too young for that.

60

u/XalAtoh May 25 '22

Because the developer(s) simply prefered Go.

8

u/tedbradly May 25 '22

Because the developer(s) simply prefered Go.

There are often concrete reasons people choose a particular language for a particular task. As a simple example, execution speed can influence a choice like when a video game is coded in C++.

-14

u/HahahahahaSoFunny May 25 '22

I guess I’m trying to understand why. To me, it seems like it’s more of a cultural issue. I feel that fostering a more open source culture in the C# community would go a long way to bring about better and more interesting tools for us to use.

65

u/Slypenslyde May 25 '22

Yes, but keep the context in mind.

When Docker was written, the people who wanted it were web developers having issues maintaining applications across machines with multiple environments. This was 3 years before .NET Core, so the only problem C# web developers had was, "How do I configure IIS?" because ASP .NET at the time only ran on Windows and Windows had no support for the containerization technology Docker used.

So no C# developers felt like they needed it, but people using open source languages needed it. (Some people nitpick that "C# has always been open source" and that's true, but it's still relevant that in-context there was no prominent C# web application framework that ran on Mono.) It only became important for the .NET world once ASP .NET Core MVC could run in non-Windows environments.

People are only going to write solutions in C# if they happen to be C# developers with a problem that needs solving. Python developers who need to solve something don't think, "Hey, I should write this package in C# to help contribute to that community!" You might get better answers for "Why Go?" in-context in a Docker community where people are familiar with the specific history of that tool.

9

u/HahahahahaSoFunny May 25 '22

I appreciate you giving me context and that makes a lot of sense. I really do enjoy C# and it’s community, I just wish we as a community were more involved with the professional open source community in terms of creating and contributing to interesting tools and projects. Maybe I’m just being impatient since C# and the .Net framework as a whole have only recently become truly cross platform.

40

u/Slypenslyde May 25 '22

This has been a gripe for all of C#'s "career". I'm not sure how long you've been following it, but I started dabbling with MS dev in the late 90s and it's gone like this:

  • At first, MS treated OSS like Satan's mentor. The vast majority of the MS community didn't trust it and didn't want anything to do with it. It was Linux witchcraft for nerds and we were Serious Professionals.
  • First MS dipped their toes in by making C# an ECMA standard. That technically meant anyone could write a C# compiler for .NET if they wanted to. The OSS community didn't trust this one bit, and assumed it was a trap that would be withdrawn the moment someone made significant efforts.
  • After a few years, MS made some additional legally-binding public promises on top of that ECMA standard that meant even if they wanted to, they'd breach an implicit contract if they tried to sue someone for making C# compilers. This caused some murmurs in the OSS community and I think this is when the first seeds of Mono were sown, but I'm not going do some research to peg a date on it.
    • It's notable at this time .NET devs still didn't "get" OSS. One of the nicest tools of early .NET was "NDoc", a documentation generator like the one Java's shipped with since the mid 90s. Unfortunately "open source" for NDoc meant "it's on Sourceforge", but the maintainer refused to accept submissions and refused to add maintainers. He eventually had a meltdown because he wasn't getting enough donations, didn't realize the value of having "I made NDoc" on his resume, and the project died because there were no other maintainers and the .NET Community wasn't familiar with how to fork a dead project and rally around one new fork.
  • When Mono came out, the OSS world watched with curiosity. They sort of expected Mono to get sued. They didn't.
  • NuGet really helped .NET OSS, because suddenly it was easy to use random third-party packages.
  • The real tipping point was when .NET Core started being developed AND ASP .NET Core was viable on Linux AND MS made MSSQL and several other tools available on Linux. This is what made it able for a bunch of people who left ASP .NET for Ruby able to come back to ASP .NET, and ASP .NET MVC is based heavily on a popular Ruby framework of the time.

That's around when source sharing agreements with Mono happened and I feel like open source decided MS was serious about accepting the philosophy. But we're talking roughly 2013-2015 here, so honestly most of the languages you're discussing are still older than the start of MS trying to direct the community to accept OSS.

8

u/ruph0us May 25 '22

Let's not forget that MS has shot themselves in the foot a number of times recently regarding OSS (the whole .NET Foundation drama, and the .NET Hot Reload drama). There's definitely still an air of mistrust that some people have regarding MSFT, and it's not entirely undeserved

4

u/ender1adam May 25 '22

Ty for the read man

3

u/malthuswaswrong May 25 '22

The OSS community didn't trust this one bit, and assumed it was a trap that would be withdrawn the moment someone made significant efforts.

Embrace, Extend, Extinguish. That's was Microsoft's policy towards competitors for decades. You can't blame the OSS community for being skeptical. But they've made huge inroads into the community recently with .NET and VS Code.

C#'s very existence was born from J++, which was a thinly veiled attempt to take control of Java from Sun Microsystems.

There are a lot of C# open source projects now. Both MS committee and free range. Dapper, xUnit, Mediator, AutoFac, come immediately to mind.

2

u/G_Morgan May 26 '22

When Mono came out, the OSS world watched with curiosity. They sort of expected Mono to get sued. They didn't.

I don't think "watched with curiosity" is accurate. There was a huge campaign to expunge GTK# Mono projects from Gnome. Every single big C# project had somebody kick off a competing project, usually in C++ hilariously, which eventually pushed out the C# project. Miguel de Icaza was hounded continually.

.NET Core is the first time it has really gained traction because the main MS runtime is now itself open source.

Of course the hostility went both ways in the past. MS didn't have a great track record prior to the current leadership.

-1

u/gutterwall1 May 25 '22

Don't forget the YEARs and YEARs of open warfare by M$ on anything OSS, still continuing to this day with locked bootloader's on new PCs and suing and Fud for days...

0

u/Skarsnik101 May 25 '22

In the early days Microsoft were still shooting themselves in the foot with open source. We had a solid testing tool and a coverage tool which worked well together. Microsoft made their own testing tool. Then broke the OS coverage tool and released their own behind the VSS paywall...

There are a few other examples of them doing stuff like this.

2

u/f-berasategui May 26 '22

So no C# developers felt like they needed it

It's been many years since Docker was invented, and no one has been able to convince me (as a mainly C# dev doing web apps) why would I need something like that.

3

u/Slypenslyde May 26 '22

Honestly? I can imagine careers where multiple generations of developers never find a need for Docker.

It's for a domain that builds clusters of devices with non-homogeneous hardware executing applications developed by multiple teams who may not be using homogeneous programming environments. For those people living without Docker and K8s is a nightmare.

But if your domain involves "writing ASP .NET Core APIs and applications that run on servers I administer using databases I administer", well, you already have full control over all the variables. So if that case gets complicated it's your fault, and Docker won't really help if you're making bad decisions. ;)

Or, additionally, if you work in an organization that has standardized servers and enforces that all teams use the same development environments, many layers of the complexity those tools handle don't exist.

So yeah, you're not invalid. You don't need features F1 cars have if you're driving at normal speeds on normal roads to the grocery store.

2

u/f-berasategui May 26 '22

I don't administer any servers at all. I use Azure, and if Azure didn't exist I would be using AWS.

"Administering servers" sounds so 2010.

0

u/Accelerator213 May 25 '22

Yep. My company is a Microsoft shop so they hire for c#. Context matters, if your tools are Microsoft focused, your c# tooling may be best there. I tried developing in other languages like rust and typescript (node), but I was met with a ton of unresolved security, proxy and support issues being that I was the first to try and use it

11

u/NathanOsullivan May 25 '22

The primary technical reason is that Go produces statically linked binaries, without requiring a separate runtime, which makes it ideal for system tools.

There's lots of other reasons, some technical and some not, but this aspect of .net essentially excludes it from being used in the system tool space.

8

u/xabrol May 25 '22

Tons of stuff in c# community is open source, what's that got to do with Docker and Kubernetes?

I can easily list 500 open source c# products. Umbraco CMS for one, Orchard Core CMS, Newtonsoft.JSON, and many many many more.....

3

u/HahahahahaSoFunny May 25 '22

Honestly I appreciate your answer. I’ve only relatively recently started diving deeper into these topics and gotten interested so it’s nice to become more aware of these projects.

2

u/xabrol May 25 '22

Go look at the DotNet Foundation, it has a ton of projects on it, and anyone can join to add their open source projects to it.

https://dotnetfoundation.org/

Also don't forget that it's not really about C#, it's about .Net. C# Is just a syntax language ontop of MSIL just like F#, and VB.Net, they all compile to the same MSIL.

It doesn't really matter what .net code is written in as long as it compiles to .Net assemblies. Other languages can use assmeblies written in other .net languages.

3

u/xabrol May 25 '22

Also, don't discount .Net itself, the entirety of the .Net platform is open source now, basically.

7

u/[deleted] May 25 '22

When these were made dotnet core wasn't out so C# wasn't truly cross platform.

3

u/Akmantainman May 25 '22

Requiring a runtime is a common consideration when evaluating solutions. Not sure if thats the case for docker specifically, but I've run into that consideration alot.

2

u/chucker23n May 26 '22

I guess I’m trying to understand why.

Why do people like anything? They may be more familiar with it. That may know more people who also like it. They may focus on certain attributes it has.

I feel that fostering a more open source culture in the C# community would go a long way to bring about better and more interesting tools for us to use.

Sure, but why does it matter what Kubernetes was written in? You generally use it, rather than looking at its code.

2

u/HahahahahaSoFunny May 26 '22

I should have worded my post differently. I was more just stating those as examples of popular software that devs like to use nowadays, but I meant just popular software dev tools in general.

3

u/chucker23n May 26 '22

It’ll simply take a while until people trust the .NET ecosystem for popular tools. In the pre-Core days, it was very controversial. (Mono existed, but was niche outside of mobile.)

2

u/HahahahahaSoFunny May 26 '22

It just feels shitty that there’s still a stigma surrounding .NET in general. Hoping that changes.

1

u/[deleted] May 25 '22

[deleted]

5

u/pnw-techie May 25 '22

Is there a reason the size of the binary is important for a web app?

1

u/NullIndex May 25 '22

Is that the same reason why RabbitMQ was written in Erlang? :D

6

u/ixths153 May 26 '22

Yes exactly...developed for Ericsson and the telecommunications system, "Erlang comes with a substantial library, battle-tested over decades, for building highly concurrent, distributed, and fault-tolerant systems." it seems it was quite deliberately choosen for a message broker.

60

u/enry_straker May 25 '22

To be fair, even now, given the choice, i would prefer writing system tools in languages like C, C++, Rust or Golang before even considering C#

9

u/leeharrison1984 May 25 '22

Eh, now that C# has platform native compilation and single executable binaries packaged with dependencies, it's a little more appealing.

I'd still probably reach for Rust or Go though.

2

u/fmillion May 26 '22

C# has native compilation ? I need to investigate this...

0

u/alternatex0 May 26 '22

It does not. It has something called ReadyToRun compilation which is precompiled code that outputs a larger executable and slightly faster startup time but still way slower startup than something done in C++. NativeAOT is still in the works and will probably mature in the next few years.

2

u/Alikont May 26 '22

The binary size is still not good compared to C++/Rust/Go.

So if you make a lot of CLI tools C# is not that good.

-5

u/stanusNat May 25 '22

I wouldn't bunch c with c++ and rust and I wouldn't bunch golang up with any of the before mentioned. And I cannot for the life of me even begin to understand why you would go with C instead of c#.

12

u/enry_straker May 25 '22

Being a programmer for more than a few decades, i have some experience with both tool making and the afore mentioned languages (except rust - just heard good things about it)

But it ultimately comes down to what languages you are most comfortable in - the language per se is not as important as the tool you are building.

5

u/tedbradly May 25 '22

I wouldn't bunch c with c++ and rust and I wouldn't bunch golang up with any of the before mentioned. And I cannot for the life of me even begin to understand why you would go with C instead of c#.

C, C++, and Rust are languages that solve the same problems. They offer execution speed / ability to optimize and access to lower-level details and hardware. Go is different though. After all, it has a garbage collector, which immediately makes it impossible to use for many applications that use those three.

-3

u/stanusNat May 25 '22

C doesn't have a clear class/package structure which immediately sets it apart from c++ and rust.

C has very little application and there is basically no reason to use it outside of an academic or educational setting. You just use c++.

7

u/fishy_snack May 25 '22

C has more platform reach than any other language. If you want to share systems level code widely, it’s your best bet.

4

u/chucker23n May 26 '22

Also convenient when you want your inevitable security bugs to spread as widely as possible.

3

u/tedbradly May 30 '22

C doesn't have a clear class/package structure which immediately sets it apart from c++ and rust.

C has very little application and there is basically no reason to use it outside of an academic or educational setting. You just use c++.

It blows my mind when people talk about things they don't understand well.

Yes, Rust and C++ have different language features than C. No, that has nothing to do with what is being discussed, which is the fact that the three languages are used for the same scenarios. The topic also isn't which language someone should use. It was whether the languages solve the same problems.

C is widely used, and it's used in the same situations where Rust and C++ are used.

To know just how wrong you are, consider Linus Torvalds' opinion about C versus C++. Again, I'm not arguing to use C instead of this or that language. I'm pointing out that C is still used and has its strengths, indicated by top programmers sometimes preferring C or being fine with C.

The three languages definitely have the same application, and some (extraordinary) programmers definitely prefer C over C++ sometimes. New projects are also began with C all the time.

12

u/rileyreidsaccountant May 25 '22

I personally don't see why Go is getting popular. I understand why someone could use it over C# for developing Docker/Kubernetes which is closer to the hardware, but it still seems like it's pretty inferior to C++ or Rust.

It's not self managed memory, and the code is just ugly blocks of imperative code as opposed to the beautiful code you could write in Rust, and modern C++.

3

u/Alikont May 26 '22

Go is good when you can throw manpower at the problem, so you don't need to teach people more complicated tools.

6

u/couscous_ May 25 '22

Hype driven development honestly.

3

u/endowdly_deux_over May 25 '22

Go is pretty simple.

It’s neat and clean. It’s quick and easy to write. It’s also easy to compile and portable.

So for simple stuff—there ya go.

17

u/couscous_ May 25 '22

golang's simplicity translate to complexity in the code base, because reality is complex. Don't fall for this trap. I've seen first hand the mess of code bases that are possible in golang, that would have been much much more manageable in Java or C#.

5

u/endowdly_deux_over May 25 '22

You completely just breezed over my qualifier; for simple stuff.

I have never once seen a code base of a small command line tool or widget written in go that was complex.

I’ve said elsewhere I cannot imagine writing a large app or service in go and it would be much better to do that in c# and f# for this reason.

4

u/jingois May 26 '22

Eh, error handling is a massive pain in the ass. Even calling a method is annoying with that if(err != nil) return nil, err cancer.

Would have to be an extremely simple Go program to not piss me off. Seems like its a useful language for teaching, or maybe if you were writing userenv shit like 'ls' or 'cat'.

1

u/endowdly_deux_over May 26 '22

I don’t mind tupled returns and definitely prefer Result<> and railroading for that kind of stuff.

Not a big fan of exceptions to be honest. But I agree that having … every method return a, err could be tough to read.

2

u/jingois May 26 '22

I don't really like exceptions - but it seems like unless you go for a pure functional approach, without exceptions you are writing far more error "handling" code than you otherwise would, which is 90% passthrough.

2

u/couscous_ May 25 '22

So that rules out Docker and Kubernetes right? If so, we're in agreement.

2

u/endowdly_deux_over May 26 '22

I would agree with that completely, yes.

18

u/Sossenbinder May 25 '22

I'd say:

- Performance reasons (No underlying runtime requirement like the CLR)

- Portability (.Net Core was probably not around yet at that time, and especially Docker stems from the Linux world)

- And probably also dogfooding to some extent, especially for Kubernetes which was developed under the umbrella of Google who just so happen to be the creators of Go

12

u/metaltyphoon May 25 '22

To clear something up, go does have a runtime that is bundled in each executable. In dotnet’s world it would be the AOT solution coming up in dotnet 7.

2

u/Balcara May 27 '22

EVERY language has a runtime bundled into each executable though. Even CPP, rust etc. The problem is that the CLR is responsible for translating bytecode, which is just too damn slow for making an efficient and performance solution.

3

u/K3dare May 25 '22

.NET Core did not exist or wasn’t mature enough at the time Docker and Kubernetes were created. Also Go has been created by Google, Kubernetes too, and Go was made especially to write this kind of services.

3

u/williane May 25 '22

Different tools for different purposes. C# is great for writing user facing products. It abstracts the developer away from most of the low level details and lets us focus on translating business requirements into working code.

Slightly lower level languages like C/C++ get you closer to the hardware which is good when performance is key.

I can drive nails by whacking on them with a screwdriver enough times; and I can force a screw in by slamming it hard enough with a hammer. I don't really want to do either of those though, neither is optimal. Use the right tool for the job.

Then there is always the personal preference component; sometimes people just use what they're most familiar with.

3

u/Wixred May 25 '22

When Docker was originally developed dotNET was pretty much Windows only and not very open except for Mono which Microsoft didn't own and was barely friendly to.

3

u/pnw-techie May 25 '22

Docker

History

Docker Inc. was founded by Kamel Founadi, Solomon Hykes, and Sebastien Pahl during the Y Combinator Summer 2010 startup incubator group and launched in 2011.

Dotnet core

History

On November 12, 2014, Microsoft announced .NET Core, in an effort to include cross-platform support for .NET,

Rust

History

The first numbered pre-alpha version of the Rust compiler was released in January 2012.

Does this clear it up? It would have been literally impossible to write docker in either c# or rust when docker was being created.

This kind of question is one I see a lot at work, asking why things that exist today weren't used 10 years ago to solve a problem. And the answer is that those things didn't exist at the time

4

u/gigatwo May 26 '22

Yup. Mono would have been a non-starter. Go had a decent amount of hype in the early 2010s too. For the Linux world where C is so common for everything, it feels familiar to C but a lot faster to build in because of GC and easier to build/distribute because of static linking and the included runtime.

Being able to just go build felt like magic at the time. All you needed was your gopath and a text editor and you were set. I kind of don't see it being built in anything else at the point that docker was created, unless it stayed as a collection of bash scripts.

There is a visceral reaction to dotnet in the Linux world that is well earned but based on some things that are no longer true. It's enough to keep people from learning it and contributing to projects.

Meanwhile, I pre-learned core for my job interview on a Linux laptop in vscode and it felt pretty magic to me. It's just going to take time and some serious push for people to build nixy tools in csharp first.

And right now that rust hype train is so much fun. It really is a neat language if you're all in on the runtime-less stuff.

19

u/asdfasdf666_ May 25 '22

Go is simply a better tool for the job. C# and Java don't stand a chance in systems programming against Go.

  • Go compiles to a single binary without a need for a pre-installed runtime foundation.
  • Go's simplicity helps reduce the complexity of these inherently complex problems.
  • Go's approach to concurrency (CSP) is better than that of C# (async-await), especially in the case of Kubernetes.
  • Go has had a focus on cross-platform from the start.

.NET C# is typically used for web servers or for Windows machines, and Docker and Kubernetes were not targeting either of those.

7

u/jingois May 26 '22

Go's simplicity helps reduce the complexity of these inherently complex problems.

Inherently complex problems benefit from a more expressive language that can take bigger bites out the problem with less code.

Go still effectively doesn't even have generics - so even goroutines & channels, being a major language feature (but not unique) - are practically a massive pain in the ass to deal with (contrast rx.net with rxgo). Lack of error handling means you are dealing with option-type-like tuples (but not proper option types, because no generics), and when I say "you are dealing with" I mean literally every fucking method call you've got some if(err != nil... boilerplate.

This "simplicity" gets in the way of doing anything useful beyond the simplest tasks.

1

u/Fishsnacks_519 May 26 '22

Go has support for generics in Go 1.18 or later

3

u/jingois May 26 '22

1.18 is a few months old - the generics implementation isn't close to complete enough to be useful (type parameters only on receivers, not methods), and obviously you still need a decent amount of time for major libraries to get rewritten to support it.

Hence "still effectively doesn't have generics".

8

u/rileyreidsaccountant May 25 '22

I agree with most of that except for the concurrency part. .NET C# has channels like Go, there's also TPL dataflow which imo is a better abstraction. Also PLINQ, IAsyncEnumberables.

-13

u/asdfasdf666_ May 25 '22

Yes you can throw tons of new features and abstractions on a language to make it compete with other languages, but it doesn’t have the completeness feeling, just like with C++. Docker could realistically be built with C++ instead of Go since C++ as C# has tonnes of features thrown on it, but still developers choose simplicity and languages that feel well designed and thought out from the start.

Instead of the developers discussing what features and what strategy to use for the C# concurrent software, the team could have gotten a lot of work done by then with Go.

2

u/couscous_ May 25 '22

systems programming

What's "systems programming" in this context? I heavily disagree with the premise by the way.

golang's supposed simplicity actually translates to more complexity in written code. I've seen this first hand at an employer who heavily uses golang and shoves it everywhere.

Java is now getting virtual threads, there's very little reason to use golang anymore, unless to blindly follow hype.

-4

u/asdfasdf666_ May 25 '22

You're calling a 13 year old language "hype"... Cool, not gonna spend too much time discussing with you then.

golang's supposed simplicity actually translates to more complexity in
written code. I've seen this first hand at an employer who heavily uses
golang and shoves it everywhere.

Really? I think most of the CS world will disagree with you that Go, a language focusing on composition over inheritance and simple syntax, will inherently create more complex code than modern-OOP flavour languages like C#/Java.

Java is now getting virtual threads, there's very little reason to use golang anymore, unless to blindly follow hype.

Sorry, but that's just laughable at best.

4

u/couscous_ May 25 '22

No one is forcing you to use inheritance in Java or C#, but it's there when you need it.

I don't know who the "CS world" you're talking about are, but my comments stem from real world experience on very large codebases written in golang. I've seen how those projects ended up, and the effort required to maintain a semblance of sanity in the projects that didn't end up in a mess.

2

u/chucker23n May 26 '22 edited May 26 '22

Go compiles to a single binary without a need for a pre-installed runtime foundation.

C# can do that now. (The way Go does it is by bundling a runtime. So, same thing.)

Go’s simplicity helps reduce the complexity of these inherently complex problems.

This sentence doesn’t mean anything.

What is “Go’s simplicity”? What makes it simpler than others? (And “simplicity helps reduce complexity” is just tautological.)

Go’s approach to concurrency (CSP) is better than that of C# (async-await)

Elaborate.

Go has had a focus on cross-platform from the start.

Indeed. Not relevant today, but a big part at the time.

0

u/[deleted] May 26 '22

[removed] — view removed comment

2

u/RafaCasta May 27 '22

Now write the list of the homologous Go type declarations that cover all that use cases.

1

u/f-berasategui May 28 '22 edited May 28 '22

This is simply nonsense.

Half of those aren't even expressible in golang. And the other half are completely different things used in completely different contexts for completely different reasons and use cases, most of which would require horrendous HACKS to replicate in INFERIOR languages such as golang or java.

For instance, the internal keyword is fundamental to proper modularization and encapsulation at the assembly level in .NET, which didn't have a proper equivalent in java before version 9.

The result is that java has this idiotic disgusting workaround based on using a horrible naming convention based on reverse website names (com.foo.myapp.this.is.retarded.please.kill.me.now).

I could go ahead and name all the other horrendous bullshit required in other languages to imitate what C# makes really easy and simple by merit of being a rich language. As a matter of fact I would argue that C# is STILL not rich enough, because it still lacks fundamental things such as union types, that increase expressiveness.

golang is a language for idiots, as explicitly stated by its creator. An inferior, feature poor language is NOT an advantage AT ALL, in any circumstance. C# 10 has MORE features than C# 2.0, and therefore is an objectively BETTER language. C# 2.0 is completely useless and obsolete because it didn't even have LINQ.

1

u/ExeusV May 25 '22

especially in the case of Kubernetes.

could you say something more on that?

5

u/ninjakermit May 25 '22

Wasn’t the first implementation of kubernetes in Java? They then rewrote it in go for performance, and well. It’s a google product using a google language

5

u/KevinCarbonara May 25 '22

I don't know that Docker in C# would even be viable. The point of Docker is to be able to run containerized code on bare metal. That is now how the CLR works. It would almost be like expecting to write the CLR itself in C#.

I don't know that it's impossible, but I can't imagine it being anywhere near efficient enough. Nor would it even be particularly beneficial. The CLR is its own form of containerization.

It's also worth noting that both Docker and Kubernetes were developed before C# ran (properly) on Linux.

8

u/MagoDopado May 25 '22

The Docker process itself doesn't host the applications, it just interfaces with the SO to setup boundaries and rules for the processes (containers) to run. IMO performance of the Docker process itself is irrelevant besides build time (layer fs and composing the image) I think the most prominent point is the timing of the tool and the state of .net core that you mention

-4

u/KevinCarbonara May 25 '22

It may not "host" the applications, but I'm pretty sure the instructions have to run through docker anyway. Something has to map things like the containerized address space to real memory.

6

u/MagoDopado May 25 '22

There's no such thing as the containerized address space. Processes run natively on the host machine with limitations to the interaction with other processes and hardware. It's all Linux magic orchestrated by the "container runtime" but not hosted by it.

6

u/lugaidster May 25 '22

but I'm pretty sure the instructions have to run through docker anyway.

No

Something has to map things like the containerized address space to real memory.

The kernel does, as it always has

Docker does do stuff, obviously. But it's not a hypervisor and it doesn't run client code or reinterpret it. It interacts with the kernel to isolate a process inside a container.

3

u/chucker23n May 26 '22

The point of Docker is to be able to run containerized code on bare metal.

Docker is just a front end. The actual container implementation is either an OS feature or done through a VM. The Go code does neither of those, so whether you write it in Go or C# is irrelevant.

I’m also unsure what you mean by bare metal. Docker is not a hypervisor.

0

u/KevinCarbonara May 26 '22

Um... no, Docker is not just a front end. It's true that the actual boundary between docker and the OS isn't always clear, but Docker absolutely creates the containerization.

3

u/chucker23n May 26 '22

Docker absolutely creates the containerization

Depends a lot on what that means. It basically creates a package format. The actual isolation is handled by the kernel.

2

u/LloydAtkinson May 25 '22

like a lot of devs have old prejudices towards C# and .Net

This is the real answer

0

u/Snoo23482 May 25 '22

No, it's not. Go is just great for writing cloud based microservices.
It feels lightweight and fun like a scripting language, but still gets you all the goodies of a compiled language plus a great concurrency story.
C#/.NET on the other hand feels more like an improved Java.

5

u/LloydAtkinson May 25 '22

No, it's not. Go is just great for writing cloud based microservices.

Meanwhile ASP.NET's obsession with performance and the fact that a good amount of Azure runs on .NET, as well as Bing, means that C# is more than capable of managing the processes and containers of some microservices as well as being used for microservices themselves.

1

u/Snoo23482 May 25 '22

Maybe now, but not back then. And then there other factors too, such as how much memory is used, how easy can I deploy to ARM boards, and how easy it is to accomplish a certain taks.
For me, the tool of choice is more often than not Go.
That said, most companies around here use C# or Java and that's ok too...
The only language I'hoping to never need again is C++ (but C is ok).

2

u/alkra88 May 26 '22

Tbh that's how I feel writing F# over C#, and many of my devs trying .net core from js/go feel the same so I understand this viewpoint - that c# is too bloated. Lighter weight for most programs. I feel both platforms have a good enough concurrency story tbh. But I've seen some ugly bloated Go code because the language has been simple at the expense of power imo. Error handling, until recently lack of generics and code repetition, etc. Whether that's important really depends on your use case (e.g. devops tools imo are a very different use case than say highly algorithmic work or large data crunching or ...).

Personally I think .net core is the more powerful ecosystem at the moment but only marginally, but go had advantages before. At current state each language is powerful enough to do the job imo. All languages are evolving and leapfrogging each other and that's a good thing. At the time k8 was made go was more suitable, and it's an in house language to boot so why not? Current in house skills are also important. Best way to get language success is to use what you are promoting.

1

u/Snoo23482 May 29 '22

Go has more of a unix-y feel to it. And the fact that it compiles quickly to dependency free native code on various platforms is just great.
On the other hand, .NET and Java provide much more out of the box.
But I generally prefer simpler languages that can be easily learned. C# seems to be moving in the direction of C++, which is more or less collapsing under its own weight.

0

u/Rocketsx12 May 25 '22

Why did you delete this post when it got downvoted just to repost it again?

2

u/mastertub May 25 '22

A lot of it also has to do with memory constraints. These applications need to be super lightweight memory-wise. Sure C# can handle the applications performance-wise, but it's VM based (whereas Go is purely compiled), has huge memory profile

3

u/lIllIlllllllllIlIIII May 26 '22

Hah, as if any software developer cares that an app uses even a gig of RAM these days.

2

u/mateialexandru May 26 '22

It doesn’t mean we shouldn’t care about memory footprint…

1

u/bilby2020 May 25 '22

I used to be a C# programmer (still do a bit). Like it or not C# is too complex syntax wise. It has changed rapidly from 2.0 to now 10.0. The same programming logic can be written in too many different ways, it makes understanding code developed over 10+ years a complex mess to comprehend. GO is a simple language, yet it is popular because good code should be easy to read and understand for 1000s of open source programmers to contribute.

5

u/lIllIlllllllllIlIIII May 26 '22

Do you not just look up syntax you don't understand when you encounter it? Aging C# projects are a bitch to work with due to the advances in patterns and libraries rather than the language changes.

2

u/bilby2020 May 26 '22

As a personal project or even within a company that approach may work. But in a popular open source project where 1000s of contributors from various age groups, educational backgrounds and countries are expected to contribute over 10-20 years it is not a good idea. People should be attracted to contribute easily and code written long ago should not look too different to code written today. Code is written few times but read and understood many multiple times. C# IMHO has taken the approach of too much syntactic sugar for writing terse and ‘clever’ code.

3

u/lIllIlllllllllIlIIII May 26 '22

People have been using god classes, mutable global state, excessive inheritance, excessive reflection, implicit type conversions, and even IL generation since way before the recent acceleration of new language syntax. Those things are way more obtuse than switch expressions, Elvis operator, null coalescing, or record types. I really don't get where you're coming from. As a developer, the language is the easiest thing you're going to have to learn.

Additionally, these features were inspired by other languages. People saw the advantages and wanted to bring it to C#. Sounds to me like you just want to cater to people with < 1 year of experience, or those who can't grow out of .NET 2.0.

2

u/bilby2020 May 26 '22

I agree that learning the language is the easiest thing to learn. But once learned I don’t want to relearn every year new syntactic sugar, new patterns etc. and then ridiculed if I don’t use them. Code is just a means to an end to build technical or business value. Familiarity of code style (enforced by GO) and quickly getting to contribute for large scale open source project (that is the context of the question not a general C# vs GO argument) is important. But C# is taking the direction of ‘terse’ or ‘clever’ code just for the sake of it.

2

u/f-berasategui May 26 '22

code written long ago should not look too different to code written today

Ah, yes, that's why retrograde, backwards languages with worse is better, anti-progress mentalities such as java or golang exist.

By this reasoning, LINQ should not exist, and C# would be useless without it, being yet another mediocre language like the ones mentioned above.

1

u/bilby2020 May 26 '22

The proof is in the pudding, GO and Rust are the language of choice for systems programming in OSS. That is why the question was asked. C# is a good choice for business application programming.

1

u/HahahahahaSoFunny May 25 '22

Can I ask what language you write in professionally nowadays?

2

u/bilby2020 May 26 '22

I am an architect now, not writing production code. I still code a bit in C# (as I used to code in it in my previous job and I started with C++ after uni in my first job’) for some PoCs and learning GO as my current company’s products are written in GO.

1

u/HahahahahaSoFunny May 26 '22

How do you like writing in Go? Is it a language that’s ready for enterprise apps (possibly monolithic apps) or is it specially suited for smaller apps such as devops tools and micro services?

2

u/bilby2020 May 26 '22

I am not in engineering and don't contribute code. I am learning GO to read portions of the code to understand deatils when required. As a language it is simple with only about 25 keywords compared to C# with 100+ keywords.

I will not identify my employer but our core enterprise products are complex and written in GO, almost 80% is open source and well loved by the community but we do sell enterprise editions to make money.

1

u/HahahahahaSoFunny May 26 '22

I understand, thanks for the info!

1

u/bilby2020 May 26 '22

I am not in engineering and don't contribute code. I am learning GO to read portions of the code to understand deatils when required. As a language it is simple with only about 25 keywords compared to C# with 100+ keywords.

I will not identify my employer but our core enterprise products are complex and written in GO, almost 80% is open source and well loved by the community but we do sell enterprise editions to make money.

1

u/knotzen_fecht May 25 '22

Well a factor might be the startup time. As you compile Go to machine code it does not have the disadvantage of the jit compiler. (C# is compiled to IL)

1

u/alkra88 May 26 '22

Is this the real advantage with devops tools though? Both use a runtime, and the jit in .net core would be barely noticeable w.r.t usage of these tools if at all. I wonder if even python could of even been used (given more runtime dependencies than go or .net core but that hasn't stopped other linux tools). I think language choice has some benefits, but isnt the only factor go k8/docker success.

However as of now most devops engineers I've seen know some Go so community contribution wise it may make sense to go with the flow even with new tooling in the space.

0

u/[deleted] May 25 '22

[deleted]

3

u/stanusNat May 25 '22

I would actually argue that the fact typescript has become so popular in relation to js is actually a move towards OOP and statically typed languages. Also you can, in theory, write c++ without any classes, just the same way you could write c# with just one class. You would, however, get an unreadable mess and eye cancer.

Functional programming is nothing new and it has its place, which is why many OOP languages and post-oop languages have made efforts to adopt many functional concepts. But in regards to structuring big projects OOP structures/concepts are king, period. Hence why most applications in use today use this structure.

Also, where I think your argument fails the most is extrapolating what you should do on Javascript to the whole industry. Javascript is already a very dorky language. And because it is so useful, people have often endured its quirks. It is far from being the ideal language however and if anything, im seeing typescript substituting Javascript in the next 10 years as front-end applications grow in complexity. C# with asp.net core and their newly found open-sourceness will, imo, have a place for the foreseeable future. Specially as a beginner friendly do-it-all language.

-7

u/[deleted] May 25 '22

[deleted]

6

u/Rocketsx12 May 25 '22 edited May 25 '22

LloydAtkinson -7

like a lot of devs have old prejudices towards C# and .Net

This is the real answer

The real real answer is that docker and kubernetes predate .Net being cross platform so C# wouldn't have even been in the room regardless whether people liked it or not. Mono doesn't count.

All these people posting about the CLR and native code have deeply misunderstood the differences between C#/.Net and Go.

1

u/ppumkin May 25 '22

Gotta give go … a go? And find out why ?

1

u/couscous_ May 25 '22

Fad driven development honestly.

1

u/randomlemon9192 May 25 '22

Why Go?

This is why people choose Go over other languages.

1

u/Accelerator213 May 25 '22

We can say the same in any language. My rust subreddit will tend to have this question for rust

1

u/elpiel May 26 '22

Because they only see sharp and don't understand oxidation 😅 Show some love for Ferris ♥️🦀 #rustlang

1

u/TallNectarine8786 17d ago edited 17d ago

Let’s go down the history to all these Tech, Go was initiated by the Big Three’s of Google (ken, rob, Russ) there were the 3 people who really hated C++ because of the Difficulty of new Dev adopting the language as then when massive amount of People were entering the Software development stage and with the invention of multicore processing They wanted to embed concurrency so 2007 Go was Created with an Ideal For Young Dev who wants to be productive, large scale Development, Web Developments and Concurrency around that time Microsoft were selfish with C# and Apache were selfish with Java this made Jetbrains pretty much mad so they had to create their own language to port to JVM well jet brains was already a slave to Java Ex Apple Eng who had workings with the LLVM ( I don’t know his name ✌️) was or is Mozilla they wanted to create a language with type safety and able to port to llvm, so rust was funded then only little or small number of people was working on Go and at that time Google was funding Dart and it’s was pretty much of a failure not because to bad features or language but because of adoption they had VM for chrome but no one was using it, it was pretty much a dormant language until Flutter came along. So pretty much Rust, Dart Were fully funded and Go was just a backyard language, the first compiler in C was made in 2009 and it was a success so has new devs start working on the Go project it was expanding while Rust had issues with the features and architecture this took Rust development 6 years to release a stable version when Mozilla started funding them in 2009 while Go was stable in 2012 a lot of containers projects and concurrency projects focused on the intel multicore was invented around 2009 - 2015 so Rust was hanging by the thread you could say Rust Is a late comer by then all these project were integrated has docker packages were already created Google saw no need of reinventing the wheel and infact Rust was not stable has they already have brog, Google tried it and it was successful and till this day they still went on with it So When people say Go is Google language they are just been ignored, Go was not created by Google but At Google a lot of opportunities C# lost was because it’s a Microsoft language

-18

u/[deleted] May 25 '22

[deleted]

6

u/Fiennes May 25 '22

Dude, did you just have a stroke lol?

0

u/alien3d May 25 '22

nope . Hehe . Licensing is a big issue upon development . BSA quite active in our country and most prefer to develop other alternative . University , collage and polytechnic do get some help via microsoft education department for software but its for duration of school. We rather speak the truth , c sharp these day quite easy compare to old vb.net but to create awareness , you need to think outside the box . By example , people rare know asp.net can be deploy in linux and macos also .

-1

u/zickige_zicke May 26 '22

Go has a couple of advantages over c# - simple to understand: with the latest changes in c#, you have 99867899 ways to do the same thing. Go has only 1 - go is compiled to binary, thus portability. It doesnt require a virtual machine to run the code. - performant