Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/15/04 01:31
Read: times


 
#83113 - Why do people use C?
Responding to: ???'s previous message
I simply cannot understand why people install a very large (20MB or so) program to their PC just to assemble a file when a simple program that fits on a floppy disk will work perfectly.

In PC terms, 20MB is very small indeed for a Program!

But, as I said earlier, the 20MB does not just assemble a file - the vast majority consists of other "performance enhancing" extras.

I find it easy to migrate from 8051 to avr, and even to PIC asm code in since I am familiar with assembly.

But each of those assremblers has an entirely different instruction set; with 'C', there is only a small subset that's specific to any particular target.

I just do not see the advantage to C programming, especially when assembly makes so much more sense to me anyways.

In general, a High Level Language (HLL) - including 'C' - has the advantages of improved programmer productivity, and improved code portability.
Of course, you will go through a less-productive phase whilst you're actually learning a new language, but once you get the hang of it you will see the advantages!

'C' has particular advantage if you want to bring in 3rd-party software, which is increasingly common these days:
http://www.8052.com/forum/read.phtml?id=82854

I disassembled a some 8051 C code I downloaded and a very simple delay loop wasted so much code space in C it made me wonder why people use C???

Most likely because it was bad 'C'; not because the language itself is bad - see http://www.8052.com/forum/read.phtml?id=83067

Call me ignorant, I am one of those people that believe "if it ain't broken, DON'T FIX IT"!

The main thing that's "broken" with assembler is that it is extremely laborious to write and entirely non-portable; these are the things that are "fixed" by moving to a HLL

In my opinion, C programming is for PC programs.

Definitely not true - most PC programs are C++ at least these days!
There are definitely significant advantages to be gained in many embedded applications (even on the 8051) by using a HLL.

I believe that assembly is the way 8051 was intended to be programmed

If this were the case, why did Intel (designers of the 8051) produce PL/M-51 - a language at a similar level to 'C'?

The 8051 doesn't care what source language you use - all it knows is binary opcodes!

for someone to just learn 8051 C programming first, without fully understanding assembly can sometimes be very confusing.

Now that is an entirely different point.
Of course, you cannot hope to do anything efficiently in any language if you don't understand the underlying architecture!
See http://www.8052.com/forum/read.phtml?id=83067 and replies




List of 58 messages in thread
TopicAuthorDate
asm vs C            01/01/70 00:00      
   HLL            01/01/70 00:00      
      asm vs C            01/01/70 00:00      
      C and other HLLs            01/01/70 00:00      
   modern - productive            01/01/70 00:00      
   Lunch            01/01/70 00:00      
   Speed writing vs speed running.            01/01/70 00:00      
   C            01/01/70 00:00      
   Belt or suspenders?            01/01/70 00:00      
   Learn C Then...            01/01/70 00:00      
      beware            01/01/70 00:00      
   This advice is great            01/01/70 00:00      
      I love C !!!            01/01/70 00:00      
         Easy migration            01/01/70 00:00      
      3rd party            01/01/70 00:00      
   Having recently started converting...            01/01/70 00:00      
   Learning C for tte 8051 and 8-bit uC            01/01/70 00:00      
      Obviously there is a reason...            01/01/70 00:00      
         as to reasons            01/01/70 00:00      
         Obviously there is a reason...            01/01/70 00:00      
            8051 vs C :)            01/01/70 00:00      
               8051 efficiency            01/01/70 00:00      
                  a 51 for handling large amount of data            01/01/70 00:00      
               8051 vs C - answer is wrong            01/01/70 00:00      
                  addendum to post Andys above            01/01/70 00:00      
                     asm.vs.C forever            01/01/70 00:00      
                  click, click, click            01/01/70 00:00      
                     Eh??            01/01/70 00:00      
                  8051 vs C - answer is wrong            01/01/70 00:00      
                     Don't believe all you hear!            01/01/70 00:00      
                     the C myth            01/01/70 00:00      
                        myth            01/01/70 00:00      
               Then Don't Do that            01/01/70 00:00      
                  Exactly!            01/01/70 00:00      
                  why only?            01/01/70 00:00      
                     Right tool for the Job            01/01/70 00:00      
   asm VS C            01/01/70 00:00      
      Which C?            01/01/70 00:00      
         ?            01/01/70 00:00      
            Handly, But            01/01/70 00:00      
            Both i think            01/01/70 00:00      
               Neither!            01/01/70 00:00      
         Compiler on a floppy?            01/01/70 00:00      
      Why do people use C?            01/01/70 00:00      
         Code Complete            01/01/70 00:00      
            Ironic            01/01/70 00:00      
      Re: asm VS C            01/01/70 00:00      
         re:asm vs C            01/01/70 00:00      
            derivatives of same            01/01/70 00:00      
               portability            01/01/70 00:00      
               re: portability            01/01/70 00:00      
                  (non-)portability            01/01/70 00:00      
                     re:            01/01/70 00:00      
                        re:            01/01/70 00:00      
   What do you want?            01/01/70 00:00      
      HLL            01/01/70 00:00      
         Personal dislike...            01/01/70 00:00      
   A comment to ASM versus C            01/01/70 00:00      

Back to Subject List