
Learn C programming and the rest will come - techtor
https://zeroequalsfalse.com/posts/learn-c-programming/
======
detaro
Responding to the title: Not really, no. Neither is C necessarily a great
starting point, nor does knowing C necessarily help you being good at other
languages etc.

I'm not saying learning C isn't useful, but it's far from a necessity and
learning other things early can be more effective.

The article itself doesn't really contain the claim the title makes, but also
doesn't back it up very much, just some fairly generic "C is low-level"
points.

~~~
zabana
I understand what you're trying to say as I am living proof that you can still
be a successful programmer without starting with C.

But I should at least mention that learning C and tinkering with system /
network programming helped me improve my understanding of higher level
languages in a way I didn't think was conceivable.

Learning about and dealing with memory management, system calls, how code is
compiled and translated into machine code etc can be boring and repetitive if
you do it long enough but is I believe an essential component of becoming a
wiser/better programmer (at least in my experience).

------
jdashg
C (or something very like it) is effectively the core of my mental VM. It's an
extremely useful mental abstraction even though all I write is C++, JS,
Python, and GLSL.

Being able to estimate "what does this code compile into" is extremely
powerful for understanding code, as well as exploring the possibility space of
solutions. ("Is it even possible to express this?")

It's not an exact mapping to hardware, but it's such a useful level of
abstraction to have on tap, even if I never want to write it directly.

~~~
kitd
Agreed. I spent 10 years writing C in the 90s but very little since. Even
still, I find my understanding of eg Go is based on what is being allocated
where, compared to colleagues from eg Java or JS, who have never dealt with
that, and who focus on syntax and features.

One was raving about slices, which are a struct of ptr + length built into the
syntax. Obvious with a C background.

------
olingern
This is sort of a 'turtles all the way down' sort of issue. You could also
say:

> Learn assembly and the rest will come

> Learn binary and the rest will come

> Learn the fundamentals of electricity and the rest will come

...

I think learning the layers below which you typically operate can be
beneficial; however, I think the patterns and ideas ( semaphores, scheduling,
etc. ) are probably the most beneficial part of an exercise like this -- not
the actual C language.

~~~
29athrowaway
Those are not "C ideas". They're not a part of the C language standard. Those
are usually part of the operating system API.

------
chadcmulligan
If you're a software developer who doesn't know C, then there's a whole class
of software that you can't read - network programming, operating systems,
language tools all written in C. This puts you at an extreme disadvantage
imho.

~~~
axaxs
Not sure if I'd agree with extreme disadvantage, perhaps slight. I'd wager
most even super competent C programmers rarely to never look under the hood at
such things.

That said, to me, while C the language is super simple and easy to write, I
always find reading it a chore. Folks using 'clever' hacks, rarely using built
in types, lack of nice standard library, and so on, make it a bit of a pain to
follow unless you are prepared to invest a non-insignificant amount of time. I
rarely dive into such things for this reason...

~~~
monoideism
> Not sure if I'd agree with extreme disadvantage, perhaps slight

I disagree. Without knowledge of C, you're unlikely to have read low-level
networking code, for example, which is pretty fundamental to an in-depth
understanding of modern software.

I do agree that C can be a pain to read, mostly because of the crazy macros
that a lot of production code tends to use.

~~~
axaxs
Fair point. Personally, I learned far more about network programming from
Beej's famous guide[1] than any code I dug into. Then again, it's one of those
things where you don't know what you don't know. Even so, I think it should be
required reading for every programmer!

[1]: [https://beej.us/guide/bgnet/html/](https://beej.us/guide/bgnet/html/)

~~~
monoideism
Totally agree about Beej's. But which language is Beej's tutorial in? C, of
course!

Another classic requiring C is "Unix Programming Environment" by Kernighan and
Pike (old C, but still).

------
29athrowaway
Learning C is a good idea because:

\- Some APIs only support C. On other languages, you can use 3rd party
bindings, or use a C interoperability library/API, but this may have a
performance overhead, and it may not abstract you from C types.

\- Some industries mostly use C, or languages similar to C.

\- Some software has real-time requirements. A garbage collector can introduce
non-deterministic delays.

\- Some software needs fine-grained control over memory management and have a
predictable memory layout of data.

\- Some software needs a low performance overhead, e.g.: when you run your
software on low spec hardware/embedded devices, or you need to save power on a
battery-powered device, or make the most out of current hardware.

Finally, the choice of C doesn't mean you only have to use C. C can
interoperate with other languages when they offer a C API.

------
yaitsyaboi
I think C is useful and cool, but I strongly disagree with the final sentence
of the post. I think it's a terrible language for beginners. I think it's a
good language for proficient coders who want to get to the next level.

If you have a niece or nephew who likes computers and comes to you about it
and you try to foist The C Programming Language on them, you will have done
them a terrible disservice. 90% of people will find using Python and it's
friendly packages for everything to be so much more delightful than C.

~~~
ernst_klim
> I think it's a terrible language for beginners.

Yeah, I concur:

[https://news.ycombinator.com/item?id=22008971](https://news.ycombinator.com/item?id=22008971)

------
blackrock
Recently, I wanted to write something in C, just to see how long it would take
me. This was just an experiment.

I got stuck at some elementary string manipulations.

So I said, forget this. I pulled out Python, and solved it in a few minutes.

This proved to me, that while C has its place, it just does not meet the
programmer productivity of other more modern languages.

Nevertheless, we need a modern replacement for C. But honestly, I just don't
think Rust is it.

~~~
jackhalford
Manipulating a string can be a complex operation in terms of memory and CPU
instruction. For systems programming you don't want to hide that complexity.

e.g in Rust you `a+b` two strings, it is a trivial rust line but it won't
compile down to trivial assembly.

There's a case to be made for languages that closely map the way processors
works, like C.

~~~
SAI_Peregrinus
Though C doesn't closely map to the way processors work. It closely maps to
the way the PDP11 worked, but for modern processors it's pretty far. It
doesn't expose any of the ideas of caching, for example.

------
naveen99
Xeus cling gives me hope [https://www.learnopencv.com/xeus-cling-run-c-code-
in-jupyter...](https://www.learnopencv.com/xeus-cling-run-c-code-in-jupyter-
notebook)

------
Rerarom
In my CS degree we learned C with malloc/free in the first semester. Now
they're learning Python.

~~~
alpaca128
I think that's a good idea. C is a fantastic second language to learn in order
to know what's happening in the background, but for a total beginner it can be
needlessly frustrating.

~~~
Rerarom
But you can first learn the subset of C which doesn't use pointers and such,
just normal variables and loops (which I studied in high school).

------
6c696e7578
I believe you can use rust for things like refrigerator chips.

[https://www.google.com/search?client=firefox-
b-d&q=rust+ardu...](https://www.google.com/search?client=firefox-
b-d&q=rust+arduino)

------
RickJWagner
I defer to one of the world's foremost authorities on C:

[https://www.youtube.com/watch?v=Ye8mB6VsUHw](https://www.youtube.com/watch?v=Ye8mB6VsUHw)

------
zozbot234
(2017)

