I often wondered why C Language is taught as the basis of programming languages everywhere. There are a lot of modern languages like Java, Python etc. which makes the syntax and programming easier. Why are we still holding the C Language up in the front as the basics of programming languages?
2
It’s not taught as the basis of Programming Languages. It’s taught as the basis of how the machine works.
A programming language displays some facade to the programmer. Some abstraction. In functional languages it is functions. In logic languages it is logic. In OOP languages it is objects. In C it is the machine.
C, while hiding away the implementation details of the hardware on which it runs (register names, memory management, etc), gives the user the impression it deals with a machine. A computer. This gives students better appreciation of how the computer works. Some universities don’t see “how the computer works” a necessary knowledge (it isn’t), so they don’t teach C.
4
Basically C is Every Programming Language minus the Frills.
For someone new to the world of Programming concepts like Polymorphism, Event Driven programming, Object Oriented Programming just don’t make any sense.
Remember that for a long time Computer Science existed inside Mathematics until the hardware technology was brought to the world. So now, you need a way for people to instruct the computer to achieve a certain objective. Most introductory level courses start by teaching how to implement a simple algorithm (like a Fibonacci Sequence or Factorial or whatever) as a computer program. You start with things like loops, conditions, functions, arguments etc. Instead of Interfaces, Classes, Singletons etc.
Things like Object oriented programming, Closures etc are a way to manage your code and architect your software application. Its the loops, conditions and arithemetic that actually do the real work! C is really good at teaching these things helped by the fact that There is a small, fixed number of keywords.
Less Language Learning, more Language Using.
When you learn C you automatically learn other languages.
C has been the inspiration for many many programming languages that have similar syntax. Personally I came from C to JavaScript and I felt right at home. According to Wikipedia
C influenced AMPL, AWK, csh, C++, C–, C#, Objective-C, BitC, D, Go,
Rust, Java, JavaScript, Limbo, LPC, Perl, PHP, Pike, Processing,
Python, Seed7, Verilog (HDL)!
When one tries Java / PHP / JavaScript / C++ after C, they just learn some new concepts like OOPS, Closures (or forget some like static typing) and don’t re learn loops, conditionals etc.
C is still in rampant use today.
C is used for System Programming, Developing OSes, Developing Servers, Databases, even Browsers and Virtual Machines.
C is blazzzingly fast!
The world’s most performant Servers are written in C.
Statistical, Mathematical and other Computationally intensive environments are written in C. The GNU Multi-Precision Library, the GNU Scientific Library, Mathematica, R language and MATLAB are completely or partially written in C
C has been used to actually make (not just influence) more languages.
You can find parsers for almost any language in C. The primary implementations of Python (CPython), Perl 5, R and PHP are all written in C!
C is almost exclusive for writing Device Drivers.
Whether Linux, Windows or Mac there is a great demand for C Engineers in Hardware companies and Software Companies making OSes for development of device drivers.
C is almost exclusive for writing code in Embedded Environments.
All your Micro Controllers, System on a Chip, and other Embedded hardware is written either in Assembly or in C. Infact this is a reason why many Electronics majors are also taught C.
The next great language will be again based off of C.
That doesn’t sound too unreasonable. C was appeared in 1972. C++ appeared 11 years later. JavaScript appeared 23 years later and C# arose 28 years later! All of them very strongly linked to C. C has withstood the test of time and there is still many more C like languages to come.
C will teach you theory and application.
Most importantly, the responsibility of an academic setup is not just just to teach you skills the industry needs, or you would need for a job but also equip you with enough theoretical and analytic skills so you can still stay relevant navigating the changes of the future.
2
I wouldn’t say that c is taught as “the basis of programming languages” very much, to be honest. Most introductory programming courses are in Java, with a handful in more esoteric languages (I know of universities that teach their intro to programming courses in ocaml and scheme, for example). Even before the shift to java, C wasn’t a popular choice for a first language; my course taught Pascal, for example, and I believe this was reasonably common.
What C is popular for is courses on low level programing, where hardware interaction is required, and there’s a good reason for that: few other languages are capable of handling that kind of job well, and C is ubiquitous in the embedded development industry.
1
C is often taught as the first language and often together with some other computer science course. It makes the understanding of the compsci easier and you also are closer to the hardware then Java and other languages.
3