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.

Ask HN: Is it worth it to learn C in 2020?

11 pointsby zabanaover 5 years ago

11 comments

ktm5jover 5 years ago
I say yes because, as others have pointed out, C is at the base of nearly everything. If not C then you should learn <i>some</i> systems level language, be it C, D, rust or whatever. If you want to know how modern computing actually works then that&#x27;s the way to do it.<p>You&#x27;ll learn lessons that will teach you how to avoid common pitfall mistakes in higher level languages. And you&#x27;ll be able to interop with C&#x2F;C++ libraries which can be quite useful. And your code will run faster than most other languages can achieve. There are lots of reasons to learn C even today.
dinklebergover 5 years ago
What type of projects are you trying to build? Are you working on embedded technology or are you building web apps? The type of environment you work in will help decide. C is still a relevant and powerful language, but there are more modern alternatives in the same space like Rust.
yulaowover 5 years ago
If you want to work, for example, in embedded systems it&#x27;s a must
westurnerover 5 years ago
The GNU&#x2F;Linux kernel, FreeBSD kernel, Windows kernel, MacOS kernel, Python, Ruby, Perl, PHP, NodeJS, and NumPy are all written in C. If you want to review and contribute code, you&#x27;d need to learn C.<p>There are a number of coding guidelines e.g. for safety-critical systems where bounded running time and resource consumption are essential. These coding guidelines and standards are basically only available for C, C++, and Ada. <a href="https:&#x2F;&#x2F;github.com&#x2F;stanislaw&#x2F;awesome-safety-critical&#x2F;blob&#x2F;master&#x2F;README.md#coding-guidelines" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;stanislaw&#x2F;awesome-safety-critical&#x2F;blob&#x2F;ma...</a><p>Even though modern languages have garbage-collection that runs whenever it feels like it, It&#x27;s helpful to learn about memory management in C (or C++). You&#x27;ll appreciate object destructor methods that free memory and sockets and file handles that much more. Reference cycles in object graphs are easier to handle with modern C++ than with C. Are there RAII (Resource Acquisition is Initialization) &quot;smart pointers&quot; that track reference counts in C?<p>Without OO namespacing, in C, function names are often prefixed with namespaces. How many ways could a struct be initialized? When can I free that memory?<p>When strace prints a syscall, what is that?<p>Is it <i>necessary</i> to learn C? Somebody needs to maintain and improve the C-based foundation for most of our OSs and very many of our fancy scripting languages. C can be very unforgiving: it&#x27;s really easy to do it wrong, and there&#x27;s a lot to keep in mind at once: the cognitive burden is higher with C (and then still with ASM and WebASM) than with an interpreted (or compiled) duck-typed 3GL scripting language with first-class functions.<p>What&#x27;s a good progression that includes syntax, finding and reading the libc docs, Make&#x2F;CMake&#x2F;Autotools, secure recommended compiler flags for GCC (CPPFLAGS, CFLAGS, LDFLAGS) and LLVM Clang?<p>C: <a href="https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;docs&#x2F;c&#x2F;" rel="nofollow">https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;docs&#x2F;c&#x2F;</a><p>C++: <a href="https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;docs&#x2F;c++&#x2F;" rel="nofollow">https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;docs&#x2F;c++&#x2F;</a><p>Links to the docs for Libc and other tools: <a href="https:&#x2F;&#x2F;westurner.github.io&#x2F;tools&#x2F;#libc" rel="nofollow">https:&#x2F;&#x2F;westurner.github.io&#x2F;tools&#x2F;#libc</a><p>xeus-cling is a Jupyter kernel for C++ (and most of C) that works with nbgrader. <a href="https:&#x2F;&#x2F;github.com&#x2F;QuantStack&#x2F;xeus-cling" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;QuantStack&#x2F;xeus-cling</a><p>What&#x27;s a better unit-testing library for C&#x2F;C++ than gtest? <a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;googletest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;googletest&#x2F;</a>
评论 #21878834 未加载
WheelsAtLargeover 5 years ago
Yes. Many current hot languages are based on the C&#x27;s structure plus there are millions of lines of C code that need maintenance. It&#x27;s worth learning now and it will be worth learning 10 years from now.
ThrowawayR2over 5 years ago
Only matters if you want to work in embedded devices&#x2F;IoT, operating systems, any other type of systems development or high-performance development, and some segments of game development or games middleware.
shakkharover 5 years ago
Most certainly. I do suggest C++ over C though, for a higher paying job.
t312227over 5 years ago
imho: always<p>especially if you are in to hardware, embedded, hpc, ... usecases.
streetcat1over 5 years ago
Maybe if you want to write a kernel driver or a file system.
borplkover 5 years ago
You can&#x27;t go wrong with it. But for what purpose?
livealifeover 5 years ago
yes