Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can knowing C actually hurt the code you write in higher level languages?

People also ask

Can you say you know C if you know C++?

A lot of the time, yes that's true. C++ is mostly backwards compatible with C. However it is very possible to write C code that will not compile as C++... usually by using a C++ keyword as a variable name or something.

Should all programmers know C?

In the modern high level languages, the machine level details are hidden from the user, so in order to work with CPU cache, memory, network adapters, learning C programming is a must.

Is C considered a high level language?

Examples of low level programming languages C and C++ are now considered low-level languages because they have no automatic memory management.

Is it easy to learn other programming languages if I know C?

C is certainly the basis of a lot of other languages - but there are plenty of great programmers with good jobs who never learned it. Absolutely. C isn't that hard to learn actually. There aren't a lot of concepts to understand.


Neither knowing C nor knowing the lower-level details of implementation hurt you -- in themselves. What can and will hurt you is if you consistently think and work in terms of the low-level details, even when it's inappropriate.

The old saying was that "real programmers can write FORTRAN in any language." If you do the same using C, it's not an improvement. If you're writing Lisp, write Lisp. If you're writing Python, write Python. What's appropriate and reasonable for C is not for either of those (or any of many others).

A great programmer needs to be able to think at many different levels of abstraction, and (more importantly) recognize and apply the level of abstraction that's appropriate to the task at hand.

Knowledge of C's level of abstraction doesn't hurt. Ignorance of alternatives can (and will).


knowledge doesn't harm. ever. Those that wrote bad code in higher level language is because they didn't master properly the higher level language, bad developers.


To a bad developer, any type of knowledge can be dangerous.

To a good developer, any type of knowledge is an asset.


Using languages - natural (spoken) or artificial (programming) - requires the mind to adapt in a certain way. Each language has it's own grammar, it's own vocabulary (APIs) etc. If you're mostly a Java programmer and switch to Ruby, you will at least follow the thought patterns of a Java programmer, if not write what is basically Java code in Ruby. It takes a bit of effort and practice until you begin to feel comfortable in the new environment (Ruby grammar, Ruby APIs) and start writing Ruby code.

So, the process is perfectly normal and any adverse effect of previous patterns is very short lived. What's more important, every language you learn broadens your horizons and makes learning the next one easier. Enjoy the journey. :]