Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!oliveb!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga Subject: C versus Assembly, which one? Message-ID: <56707@sun.uucp> Date: 15 Jun 88 21:35:26 GMT References: <312@pedro.UUCP> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 54 In article <312@pedro.UUCP> pete_ashdown@pedro.UUCP (Pete Ashdown) writes: > Thanks for your suggestions. I may just turn back to examining 'C'. I > have already done program #1 to some extent in assembly. Should I turn > back to 'C' or should I keep going with assembly? I'd be curious to > find out from other 68000 assembly programmers (like Mark R.) how they > got started. If they went from 'C' to assembly or just started out in > assembly. Well whether to program in C or Assembly or Modula-2 for that matter depends on some of the parameters of the project. Anyone who is serious about systems programming/design should probably learn several languages if only to get through the nuances of "do {statement} while (expr);" and "REPEAT BEGIN statement END UNTIL expr;" And into the concepts of loops that check their parameters at the end of the loop versus loops that check their parameters before executing the loop etc. Once you understand programming at that level, using any given language is simply a vocabulary switch. Then you can decide what language to use based on it's other strengths. These being generally classed into the groups such as readability, efficiency, maintence, and time to completion. Using C, Assembly, and Modula-2 as examples I break them down as follows : C provides a 'minimalist' high level language, interfaces between modules are provided but only loosely enforced, details of actual register usage is abstracted although it can still be influenced, time to completion is fairly short but readability and maintainability sometimes suffer. Assembly provides the maximum utilization of system resources and processing power. When this is a 'drop dead' requirement nothing else will suffice. Assembly language provides no support for maintaining module interfaces and is often abused (push something on the stack and then execute it is a common example). This makes it difficult to share work among undisciplined programmers. Nothing enforces readability and styles vary wildly so this can also be a problem when someone 'new' picks up some existing code. Assembly usually has the highest delivery and maintenence costs of any language except APL. Modula-2's biggest strengh is it's enforcement of routine interfaces. When multiple programmers share a task they can design to an interface and know that when their code links the interface has not changed. It's considered "wordy" by many programmers and often suffers from "moduleitis" where every possible subroutine gets it's own module. Generally, the code does what the program indicates and it is often the most maintainable code of the bunch. Look at your needs and then pick your language. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.