At first glance, it may seem like C has been left in the dust by newer, fresher, more exciting languages — C_is_45 years old, after all — butGitHub isn’t exactly the most accurate pictureWhat Is Git & Why You Should Use Version Control If You’re a DeveloperWhat Is Git & Why You Should Use Version Control If You’re a DeveloperAs web developers, a lot of the time we tend to work on local development sites then just upload everything when we’re done. This is fine when it’s just you and the changes are small,…Read Moreof the software industry. GitHub has a_huge_bias toward open source and trendiness.
You might have heard that C is a “lower-level language.” In the context of programming, the “level” is a description of how close you are to the computer’s native instruction set. The lower the level, the closer you are to writing machine code. The higher the level, the more abstraction is done by the language to take you away from writing machine code.
C is a lower-level language with some abstraction. You can write code that’s fairly close to the hardware and directly manipulate memory, whereas in a higher-level language like Java, the language itself handles memory through a garbage collector.
Image Credit: Casimiro PT via Shutterstock
While this is part of what makes C difficult to learn, it’s also why C programmers tend to be more in tune with how computers work.In order to write good C code, you have to think like a computer thinks: memory management, input/output streams, byte order, etc.
Lower level languages than C do exist (e.g. Assembly), but C is about as low level as you’ll want to go. It retains most of the power and control of lower-level languages, but is abstracted just enough for human-readable code that won’t make you tear your eyeballs out.
Some programmers like to say that “once you know one programming language, you pretty much know them all.” Though an encouraging sentiment, it’s not quite true — unless you learn C.
The thing is, moving from one language to another is smoothest when you move up in abstraction. Going from a lower-level language like C to a higher-level language like Python is rather easy because Python holds your hand more. But going from Python to C? Not so easy.
Image Credit: Sashkin via Shutterstock
Or consider another example. C# is a popular first language for newbies today, especially for those who want to get into game development (because the beloved Unity engine uses C#5 Free Game Development Software Tools to Make Your Own Games5 Free Game Development Software Tools to Make Your Own GamesThanks to these awesome free game development software tools, a game that might’ve required one year can now be made in six months or faster, sometimes without any code). But even though the C# language is highly abstracted and easier to use, newbies often get confused because they don’t understandwhat’s being abstracted.
By learning C, you’re essentially learning the foundations of modern programming.If you can really understand C, you’ll be able to pick up any other language because nearly every modern language is higher-level than C.
The low-levelness of C comes at a cost: complexity and tedium.
Think of it like making a ham sandwich. In a higher-level language, you might use a makeSandwich(“ham”) method that produces a ready-to-eat sandwich. In C, you’d have to write your own makeSandwich() function that gathers and prepares all the necessary ingredients, assembles the sandwich, then puts everything back.
Image Credit: Zakharchuk via Shutterstock
On the one hand, being able to control every aspect of your sandwich is great. You might even be able to write a faster makeSandwich() that skips certain steps that you don’t care about. But sometimes you just want someone to make you a sandwich, and food made for you often tastes better than food you made yourself.
Most modern languages were born in response to shortcomings in another language: C++ in response to C, Java in response to C++, C# in response to Java, etc.By learning C, you can better understand why certain languages are designed the way they are and better appreciate the convenience offered by higher-level languages.
Most modern programming languages are used for the same three things: business apps, web and mobile apps, and data analysis.
Higher-level languages are great for these because there’s no need to dive into the nitty-gritty details of computer architecture. Instead, rapid development cycles and robust hand-holding reign king — two of the main benefits to using a higher-level language.
Image Credit: Inspiring via Shutterstock
But if you want to develop software that directly interfaces with hardware, you’ll need a lower-level language — and C is the most used.Notable applications include operating systems, programming languages and compilers, embedded systems, game engines, etc.
For example, the Linux kernel is written in C and Assembly. Popular languages like Python, PHP, Perl, and Ruby are implemented in C. Did you know that even C is written in C? And since many embedded systems have strict resource limits, C is often the language of choice because it has very little overhead.
There are two ways to guarantee a job in the software industry:
- Specialize in high-demand positions.
- Specialize in low-supply positions.
Since mostcoding boot campsCoding Boot Camp for Beginners: Should You Take One?Coding Boot Camp for Beginners: Should You Take One?Comprehensive coding boot camps provide an entry into the coding space. Find out what they are, what you’ll learn, and if it’s the right fit for your programming journeyand online training courses push newbie programmers toward high-demand languages, you could set yourself apart by learning C instead.This can open up many job opportunities that just aren’t available in higher-level languages.
C is not easy to learn, especially if it’s your first ever programming language. That’s why we recommend reading these three articles before diving in:questions to ask yourself before learning to code,how to learn programming without the stress, andtricks for mastering a new programming language7 Useful Tricks for Mastering a New Programming Language7 Useful Tricks for Mastering a New Programming LanguageIt’s okay to be overwhelmed when you are learning to code. You’ll probably forget things as quickly as you learn them. These tips can help you to better retain all that new information.Read More.
But if you’re serious about learning C, definitely start withC Programming Language, 2nd Edition(often referred to as “K&R”). It’s basically the C programming bible. It’s pretty old, but everything in it still applies to C today. Once you’re through, you can read up on the changes that occurred in the C89, C99, and C11 language revisions.
If you can’t afford that book, then start withThe C Book. It’s no longer in print, but still available online in HTML form in its entirety.
What do you think? Is C outdated and useless or should new programmers still learn it before they explore more modern languages? Share your thoughts with us below!