Hacker News new | ask | show | jobs
by mattcristal 1341 days ago
My experience, so far, has just been in Python developing with FastAPI. Next, I would like to learn a statically typed language, but I am not sure what. I was wondering about Go and C# of course.
2 comments

Both has it's advantages and disadvantages depending on the use case.

If you primarily develop user facing applications (web applications, line of business applications etc.) C# is a good choice. There are a lot of companies (including Microsoft) using it for these use cases, so there are good ready made solutions, tutorials, documentations for the common features that you'll require.

If you primarily develop "system" level software (Docker, Hashicorp products etc), Go is a good choice for the same reasons.

This is a bit of a generalization as both languages can be used for both use cases, and you need to take a lot of different things into account on deciding which one to focus your attention on (familiarity, job availability and many other things). As always, it's about the tradeoffs you are willing to make.

Keeping that in mind, it would be a safe bet for me to say the a Docker alternative in the future won't be developed in C#, and the some big business application won't be developed in Go.

Another thing I want to add: The decision to learn a language doesn't need to be an 'OR' decision. Learn both, and use the one that fits your requirements best.

Coming from a lot of python knowledge, including deep language junk draw trickery and being able to do all sorts of interesting tricks with it… and having looked into go to do a bunch of things where Go is basically the only supported language (kubernetes operators and some other niche stuff like that) … and now diving into .Net 6 with c# for a few new projects after some past experiments with Unity.

c# all the way…

Go is like hunt and peck typing with my nose while I’m strapped into a strait jacket. It’s deliberately designed to make it hard to be clever, hard to deepen your knowledge, and for me this makes it hard for me to be efficient… Other than small edits of other peoples code I have never once found Go enjoyable. It’s intuitive to a fault because it’s so minimal and restrained. Like a set of Duplo blocks compared to a set of Lego blocks. It’s really hard to convey this feeling of mental abrasion I have while using it… if I’m not fixing/extending something else where there’s likely only one good way to do something and I’m not in a position to change anything outside the little bit I’m working with… every time I use Go I am constantly ignoring the part of my brain that sees how inefficient this language is for my time I have to sit there typing out so much god damn useless shitty boilerplate that every other language gives you tools to avoid by way of better syntax, syntactic sugar for more advanced patterns, tools for polymorphism and meta programming and all the other things go rejects… hell until very recently it didn’t have generics (I haven’t been forced back to using it since this so maybe it’s slightly better now)

C# has a powerful type system, good enough and growing ecosystem of language level packages to empower you to work well. But it does have one big negative, it’s rather IDE dependent, and the package/module/import system is very “implicit” as opposed to the explicit Pythonic way of doing things. So it takes a while to get used to (still doesn’t feel right but my brain no longer bristles at the sight of it anymore) how everything is imported an entire package or module at once and the compiler just takes care of optimising out unused stuff. It also makes it harder to read peoples code samples which cycles back to how much you have to learn to let the IDE do the work, because it’s often the only antidote to tersely referenced object names that have been pulled in from a large package namespace. I’ve gotten rather used to just asking JetBrains Rider to add the necessary using statements.

For all the downsides C# doesn’t feel like sandpapering my brain while using it, it’s more employable, .Net 6 is a real boom time for new open source code as they have finally unified the weird .Net Framework vs .Net Core mess, it’s one target and everything lives here now. And Microsoft are supporting cool new technology like gRPC/Web and Blazor which might get us back to the days where you could just design a UI around a push/pull function call model and deploy to desktops which could perform RPC via the LAN to the back office server. Exciting times!

Agreed on all the points.

Re: IDE, I see this as an advantage. As a lifelong user of editors (emacs, Sublime Text, VS Code) other than checking some IDE out here and there, I've committed to using an IDE (Rider) for the first time while working with C#. When the platform and the language you are using allows good IDE support (static typing and friends), the experience is leaps and bounds ahead of using an editor in a dynamically typed languages.

I was also using all kinds of meta programming magic to bend Python to my will, so an IDE had nothing more to offer.

I'm also employing the same ideas with C#, but this time they are encapsulated to a few input/output locations and supplemented by design-time code generation where possible, resulting in nearly everything is type safe. Now Rider can work as a partner, instead of being a hindrance.

Always embrace the powers of the platform you are using. If it's a statically typed language, learn to work with the IDE, don't fight with it.

> Always embrace the powers of the platform you are using. If it's a statically typed language, learn to work with the IDE, don't fight with it.

Very much agree! For me as a big fan of IDEs for all my work, my biggest adjustments have been learning all the .Net specific things, how to do them in the otherwise familiar JetBrains Rider (I use PyCharm for my python work), and a slow acceptance that while there are ways to "work more explicitly" (fully specifying names and not touching the "using statements") the IDE does indeed have all the power it needs to understand what I cant see because of the powerful type system and all the .Net machinery under the hood that I don't yet know to the level of my deep python knowledge.