Learning C in 2016

Hey everyone. This is the first post in my series of posts about my experience with learning C in 2016. Today, I'll start with "Why?". So, Let's do this.


Why?


I think some of you may be wondering, why should you learn C in 2016? I mean it's 2016 (21st century) and you should be learning some high level languages like python, ruby, haskell, rust, swift, java etc. and just doing stuff rather than sitting on gdb terminal, banging your head against the table for hours because you double freed a pointer in your code. So, why c? Well, even though C is old (44 years old), it's still found everywhere (Kernels, drivers, embedded systems, real-time systems, etc). And, there's reason for it. Some of it includes wide availability, thin layer of abstraction, smallness, efficiency, lightweight-to-nonexistent runtime support etc. 

C is quirky, flawed, and an enormous success. While accidents of history surely helped, it evidently satisfied a need for a system implementation language efficient enough to displace assembly language, yet sufficiently abstract and fluent to describe algorithms and interactions in a wide variety of environments. - Dennis M. Ritchie

It's also broken. Undefined Behaviors in C are almost impossible to evade.It is full of design choices that made sense in the 1970s but make zero sense now. Everything from its unrestricted, wild use of pointers to its severely broken NULL terminated strings are to blame for nearly all of the security defects that hit C. It's very difficult to write secure code in C. 

The C programming language’s only failing is giving you access to what is really there, and telling you the cold hard raw truth. C gives you the red pill. C pulls the curtain back to show you the wizard. C is truth. - Zed Shaw


And, Of course, with great power comes great responsibility. But, I digress, I think you should learn C if you can answer yes to any of these:
  1. Do you want to Contribute to *nix Kernel or write your own?
  2. Do you want to write system drivers or programs for embedded systems, real-time systems?
  3. Do you want to understand Operating Systems and other low-level stuff?
  4. Do you want to write performance critical programs?
  5. Do you want to learn defensive and robust programming?
  6. Do you want to be a better programmer? 

I hope this was helpful to you in any way and don't forget, In the next post I'll be talking about the tools and resources you may need and how to use them effectively. 
see you later! 


- 0xelectron

"It's 5.50 a.m.... Do you know where your stack pointer is ?"  



No comments:

Post a Comment