| ??? 10/14/02 21:05 Read: times |
#30786 - RE: Programming the Embeded Systems with C |
I read this email from Russell McMahon:
C (and any HLL) is a power-tool used to do things faster. Assembler is a tradesman's hand tool capable of finer detail and more control but harder to use and slower in the hands of all but the most skilled. A novice can find the job uncompleteable with the hand tool but can also make an awful mess with the power-tool. There is a place in most people's toolboxes for both. (metaphor courtesy of Ken Mardle). Many here use C. Many know both. Almost all who use C also use assembler sometimes. Some who know C use assembler most of the time. C is faster to get results with for most people. When mixed with assembler you get results which are good enough for most purposes. A few experts claim they are as quick or quicker with assembler as with C (and it may be true) and that everyone else can be as well (which isn't true) and that everyone should learn to use only assembler (which isn't true). C is usually slightly less efficient in code space than a good assembler program. In some cases a good assembler program will be MUCH smaller and or faster than a good C program. A good C program may be faster and or smaller than a badly written assembler program. C is easy to make mistakes in. Assembler is even easier :-) How good the C's optimising abilities are is a critical factor. Generally but not always, the dearer the C the better it is at making small fast code. Grown men will kill each other over this statement. It is a really really really good idea to be able to use assembler even if you mostly use C as you can leap into assembler when really really necessary, and sometimes it is. Also, all C's will SOMETIMES not do what you expect or want and being able to look at the assembler code they (should) produce and understand what it is (or isn't) doing is a big bonus. Some would say it is essential. When a compiler goes wrong you are completely stuck if you can't work out why it does what it does. No amount of insisting that it SHOULD do what they say it should do will save the project that it fails to work on. With assembler its usually your fault :-). (Sometimes its the processor's fault but that's not a language issue per se). You will find many people to disagree with, and slightly fewer people to agree with each of the above thoughts. |



