TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

What to Learn? Cpp vs. Go

2 点作者 lazy_afternoons11 个月前
I have less than 10 yrs of exp and primarily focused on web, JS(node, react) and kotlin.<p>Now I want to try my hand in building low level stuff like parsers, small KV stores and some network programming.<p>Go seems to be more approachable for my goals but I have the FOMO of not learning to manage memory. I want to be able to work on performance critical stuff later.<p>I used some Cpp in college and I went through some tutorials (learn go with tests) in GO. I like them both.<p>Which language do you think I should go deeper in.

4 条评论

teeray11 个月前
If your goal is to build parsers, KV stores, and play with network programming, Go is going to be the most productive for those goals. It will get out of your way, and the “correct” was will be fairly straightforward. C++ is a language with decades of history, and a whole mess of “dialects” out there, and these will all distract you from building things.<p>Once you’ve cut your teeth with a few projects, I’d recommend Rust first, then C++. I built good habits fighting with the borrow checker that improved the C++ I wrote out of the gate.
kstenerud11 个月前
Go is an OK language, but that&#x27;s all it is: OK. It doesn&#x27;t excel at anything or teach you any new paradigms, really. It was designed to be friendly for junior programmers so that they don&#x27;t need much training to become productive.<p>C++ is a bit of a mess due to its long, personality warping, traumatic history. There are many awkward parts to it due to fundamental designs that have since been discovered to be bad (although we only know that through hindsight). So you have things bolted on like smart pointers, which give you reference counted memory management (and that really is the recommended way now, because the old way of purely manual memory management was a disaster).<p>Rust is an attempt to give the power of C++ without the mess. It&#x27;s also a lot harder to grok from the start because they front-load you with a lot of required knowledge before you&#x27;re able to do even the simplest of things.<p>If you have the ambition, I&#x27;d suggest diving into rust. The concepts you learn in there will cross over into many other languages, and you&#x27;ll have a very strong foundation in ownership, transitional dependencies, and temporality in general (which you can get away with not knowing in most languages, but really should be aware of if you want to avoid some nasty bugs creeping in).
评论 #40687997 未加载
Rochus11 个月前
&gt; <i>low level stuff like parsers, small KV stores and some network programming</i><p>That&#x27;s not actually &quot;low level&quot;; you can pretty well do all of this using JS or TS. Go is very well suited for these kind of topics, and you can master it within a year. I don&#x27;t see a necessity or clear advantage to learn C++ for these kinds of topics (mastering C++ takes 3 to 5 years).<p>&gt; <i>I have the FOMO of not learning to manage memory</i><p>There is no reason for this. It would be different if you would like to develop resource constrained embedded systems (those with less than a MB of RAM).
评论 #40690456 未加载
gregjor11 个月前
Here&#x27;s an idea: learn both. Maybe learn C first, then you will know 75% of C++ and 90% of Go. All Algol-family languages, or C-family if you prefer to start with a language still widely-used, have more in common than not.