Hey FCC campers,
Well the C language is the father of programming, am wondering if i need to learn C even if am not gonna use it ! If yes why ? If not why ?
Hey FCC campers,
learn what you need to learn, learn what you need for your projects or job
or learn it because you think it’s interesting
you don’t need to learn anything in particular tho
The UNIX Bell Labs team (Brian Kernighan, Dennis Ritchie and colleagues) created C because they wanted something more flexible than the FORTRAN, COBOL, Algol, PL/I languages that ruled the computing world in 1970. They originally created it to be simple, so they could build out the various parts of UNIX . Linux and FreeBSD are the heirs to their UNIX, and are everywhere.
Why learn C? Here’s why.
to learn how to create simple programming tools in the Linux environment. By using C you’ll get some down-to-the-metal experience with core Linux concepts like processes, pipes, filesystems, etc. That experience will serve you well when you use other languages.
if you want to do embedded-systems programming (that is, make programs for devices).
if you want to work on systems like games where performance is everything.
Why not learn it?
Its text-handling is dangerously lame, and you can pick up the kind of habits that benefit cybercreeps more than anybody else.
Debugging C programs is a colossal pain in the xxx neck. It doesn’t have exceptions. It does have some decent debugging tools, though.
If I were you I’d learn it well enough to do a few things in the LInux world I mentioned above.
I’m a big believer of learning a language or tool when you have a reason to. Without the motivation and direction of a goal I care about, I tend to find myself with a grab-bag of knowledge that I don’t know how to apply.
Do I need to learn C language?
If you want to sure. I’ve dabbled in it myself just out of interest. I’ve been doing this for 5 years and it hasn’t been useful to me but I don’t regret learning a little either. It isn’t going to get you any closer to landing your first entry-level dev job though if that’s what your goal is.
Is it essential you learn C to do web development? No, you can get by without it. Although as WASM becomes more prevalent down the road it may be to your benefit to learn C/C++, Rust, or something similar to make you even more employable.
If you have the free time and are looking for something new and interesting then there is no harm in learning C. But don’t bite off more than you can chew. If web development is your goal then concentrate on that first and make sure you are proficient before you decide to spend a considerable amount of time learning something else.
I agree that you should only learn what you have an actual reason to.
Basically you don’t have to learn C, but it has the potential to turn everyone who does into a better programmer. Or you could go with C++ which is a little bit more accessible and follows way more OOP principles, and will still allow you to learn most of what makes C different from almost every other language.
Learning multiple languages is a good idea, and I think learning about pointers and memory management helps you write better code in high level languages.
Personally though, I would not call C strict. It is unforgiving, but extremely permissive. But the language does less work for you and you need to implement many things by hand.
I don’t find C++ terribly accessible if you are just going to dabble a bit to understand low level concepts. C++ has the worst problems of both high and low level languages.
Knowledge will never been to your disadvantage. Try to learn. Everyone on the forum will help you.
Nitpicky, but I thought that by most measures C is considered weaker than JS, given it’s not really strict at all
Anyway, learning different languages with different approaches helps one better understand programming, and it’s generally time very well spent but it’s also generally not immediately helpful. I’m getting better at Rust, but I don’t [currently] use it for anything, so in that sense it’s just for personal exercise. But at the same time I’m finding that I’m constantly thinking about what code is using what memory when I write JS, which is a generally good thing.
This is what I mean by nitpicky, sorry! I get there’s no agreed upon definitions, but think you mean statically typed? C afaics is extremely weakly typed (you can cast any type to any other, you can just tell the compiler that it’s a different type and it’ll believe you)
“To this day, many C programmers believe that strong typing just means pounding extra hard on the keyboard.”
The definitions are pretty useless anyway, as nobody can agree what they mean. I guess it would be relatively uncontroversial say ML and Haskell are examples of strongly typed languages because they can guarantee there aren’t runtime type errors (Ruby, Python etc are strongly typed as well, but they can’t guarantee no type errors prior to running the code because they’re not statically typed)
I suppose I did mean that C is statically typed, as opposed to strongly typed.
Just to be clear. You do not change the type, you change the value.
let number = '123'; // Number takes the string and returns a new value that is of type number console.log(typeof Number(number)); // number // It does not change the type of the original value console.log(typeof number); // string
I started out in C (semi-professionally). I liked it. I think I learned a lot from it. There are JS and computer concepts that I seem to understand better than some of my younger, “non-C” friends do, because I had to deal with them on a low level in C.
Do I advise people to learn C? No. The amount of time it would take is not worth the benefit. Unless you need C are are planning on specializing in something where C is important.
It would be like saying, “I want to learn Italian, but first I’m going to work on Latin for 5 years because it is the ‘mother of all languages’” (At least from a western European point of view, kind of.) True, learning Latin would make it easier to learn Italian and understand some where it comes from. But the time lost not studying what you want to study would far outweigh that.
And Is C the “father of programing”? There were dozens and dozens of languages before that. Why not study Assembler? Do it on punch cards? Hand solder relays and vacuum tubes? Should our Italian student study Etruscan before Latin? Maybe Proto-Indo-European?
Yes and no. C will do some type coercion for you and you can typecast willy-nilly with it making zero sense and the compiler just accepts it. The void type makes it pretty easy to muddle types.
Yeah, my experience with C and its “strictness”…
I can’t really say that it’s more or less strict than JS. I mean JS is more lax about types, imho (only one number type, etc.) but C will let you index past the size of an array and overwrite another data structures memory. There are many languages that are much more strict than either.
I guess I think that C’s value (at least in terms of teaching) is that it is so low-level - you really have to think about things like memory, addresses, etc. You have to be more aware of things that JS does for you in secret.
But again, unless you need to study C, or are one of those people that only sleeps 2 hours a night and are bored, I wouldn’t bother; with some diligent study, there’s nothing that you can learn in C that you can’t learn elsewhere.
Do I need to learn the C language: As others have said, need is not really why you would learn it. I became interested in C thanks to the awesome CS50 lectures (see freecodecamp.org’s YouTube channel) where the instructor led us through the fundamentals of computing and all the way to current languages, in a bird’s eye view of the landscape. It is a challenging language and in my opinion, if you can grasp it, most others would seem like ‘a walk in the park’ by comparison.
Why not learn C: well, it’s a matter of priorities. If you are short of time or have a deadline within which to accomplish something that does not require C, don’t go there. It’s tough and if are easily shaken, you will regret it.
It is a challenging language and in my opinion, if you can grasp it, most others would seem like ‘a walk in the park’ by comparison.
True, but you can run into some issues during the transition. For instance, I’ve been doing CS50, I’m now in week 6 (the week in Python, after 5 weeks in C) and, even though I already had some basic knowledge of Python before taking CS50, it’s been pretty confusing to transition from C’s static typing to Python’s dynamic typing. I find static typing adds more clarity to your code, while in Python it’s sometimes a bit confusing to know the type of a variable because it’s less explicit.
But, overall, I’d say learning C dramatically improved my skills (even if I still consider myself a beginner). Putting aside the confusing aspect of dynamic typing, I can now code much more easily in Python than I did before learning C. Because in C there’s no magic, you have to understand everything you’re doing and that knowledge transfers to other languages.
I’m sure there are many great programmers (especially in web development) who have never touched C, so it’s probably not an absolute necessity, but I’d say learning it definitely improves your programming skills, whatever language you choose after that.