Reputation: 3135
It seems to be an 'accepted concept' in the popular culture of programming languages that 'C is portable assembler'. I have first heard this at least 15 years ago. But when did it really become part of the popular culture?
Note: if you don't agree that 'C is portable assembler', please just skip this question. This question is about 'popular culture of programming'. I'll add a comment to this question which you can up-vote for those who disagree with that statement.
Upvotes: 29
Views: 11722
Reputation: 3571
The moment they started extrapolating/ misinterpreting definitions of words :)
Assembly language: symbolic representation (a.k.a. mnemonics) of the numeric machine codes and other constants needed to program a particular CPU architecture.
Assembler: A program to convert assembly language into machine language.
C: A programming language which
(1) is not a mnemonic of a particular CPU architecture
(2) cannot be fed into an assembler
P.S:Feel free to downvote this answer as much as you want :)
Upvotes: -1
Reputation: 490438
From the Introduction to the first edition of The C Programming Language:
C is a relatively "low level" language. This characterization is not pejorative; it simply means that C deals with the same sort of objects that most computers do, namely characters, numbers, and addresses.
[ ... ]
Again, because the language reflects the capabilities of current computers, C programs tend to be efficient enough that there is no compulsion to write assembly language instead.
[ ... ]
Although C matches the capabilities of many computers, it is independent of any particular machine architecture, and so with a little care it is easy to write "portable" programs ...
At least the general idea of combining portability with the general capabilities of assembly language seems to have been there almost from the beginning.
Upvotes: 48
Reputation: 320671
The concept of C being "portable assembler" stems for the simple fact that most "pop-culture level" C programmers are too lazy to learn the language "hard" - academic - way, and instead prefer to "learn" from practice, in most part by associating the language commands with the implied underlying machine code. Most of these associations are based on rather ridiculous misconceptions about the language, which latter surface here (and on other forums) as questions along the lines of "I have 20 years of experience in C programming but I don't understand why my type-punning hack no longer works". Nevertheless, most of those "portable assembler" types actually take pride in their approach, considering everybody else not sufficiently competent to see assembly behind the C code :)
In other words, the only people who see C as portable assembler are the people who never bothered to learn the language. It is indeed just a pop-culture. C is not a portable assembler, and it is not really a matter of "agreeing" or "disagreeing" with it, but rather a matter of knowing it as a hard fact. The "popular culture of programming" you seem to be mentioning has very little connection with the professional C programming world.
Upvotes: 6
Reputation: 245479
My guess would be the first time that there was a higher level language than C.
That would make C portable, but still fairly low level (and at least in some minds, the closest you can get to Assembler and still be portable).
Upvotes: 1
Reputation: 391962
That was why C was developed. From the very, very beginning, C was designed for portability.
Upvotes: 13