TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: An introduction to Go for C# people

17 pointsby passivepinetreealmost 5 years ago

5 comments

caseymarquisalmost 5 years ago
C# is my goto language for productivity. If you want to lure us in, show a stereotypical example of go routines with channels solving a problem that would take significantly more effort with .net threads or .net tasks. We&#x27;ll be intrigued enough to look further, and most won&#x27;t stop to ask if channels seem like a recipe for deadlock&#x2F;panic that&#x27;s usually not the right abstraction. Don&#x27;t mention the lack of generics; you&#x27;ll scare us away before we get addicted to go routines.<p>Personally, I prefer actors over CSP. Async concurrency is less predictable, but race conditions don&#x27;t generally happen when threads aren&#x27;t synchronizing, so it doesn&#x27;t matter if you&#x27;re not making satellite firmware.<p>C# allows dynamic code compilation at runtime based on reflection. The cool part of LINQ is the &#x27;Expressions&#x27;, which allow you to analyze&#x2F;rebuild the AST of code and take actions based on code structure. It&#x27;s kind of like having runtime macros, except you can only make your own if you&#x27;re willing to spend an hour doing something that would take 2 minutes in lisp. Keeps the DSLs to a minimum. I would miss this if I switched to go. Rust on the other hand...
unsignedintalmost 5 years ago
&quot;Go places a strong emphasis on its applications staying up to date with the language, in contrast to the fragmentation in the .NET and .NET Core ecosystems&quot;<p>This seems to be bit of an overstatement. C# as a language is stable and .NET and .NET Core aren&#x27;t that apart from language standpoint. They had different focus through different set of built-in functionality that each framework has provided but with bit of overlap.<p>There are some libraries that support one but not another (although, for many of libraries, it is non-issue as they are often targeted to .NET Standard which supports both) but to call it &quot;fragmented&quot; sounds a bit too much.
CyanLite2almost 5 years ago
Serious question: Why?<p>C# is faster, more productive, has better tooling, and generics.
评论 #23400413 未加载
评论 #23398755 未加载
评论 #23394538 未加载
评论 #23408140 未加载
may4malmost 5 years ago
why Go when you have C#?
dntbnmplsalmost 5 years ago
&gt; Go programs compile down to a single binary with all dependencies included. In contrast to C#, no runtime is needed, so applications may run in very thin containers such as scratch or alpine.<p>This was by design and not necessarily a bad thing. C# was meant to compile to managed code for better security and performance ( JIT ) - though people can argue over the actual merits.<p>&gt; Go has no generics ... You’ll find yourself freqently writing small bits of code for operations that would be trivial LINQ statements ... Go returns errors which are then checked by the caller, rather than try&#x2F;catch blocks and exceptions for error handling ... Go has no concept of awaiting an action (more on this later)<p>These are pretty important stuff that Go is lacking.<p>&gt; Go places a strong emphasis on its applications staying up to date with the language, in contrast to the fragmentation in the .NET and .NET Core ecosystems<p>This isn&#x27;t really much of an issue.<p>C# people primarily use C# to make money developing on&#x2F;for the microsoft&#x2F;windows ecosystem ( windows servers, sql server, IIS, sharepoint, azure, etc ). So a better way to introduce Go to C# people is to show how Go is better at interfacing with these microsoft software&#x2F;servers or how Go can improve productivity within the microsoft ecosystem. Otherwise, you aren&#x27;t going to have much success selling Go to &quot;C# people&quot;.