Re: Hey, what is all this 'off topic' posting?
- From: Bob Monsen <rcsurname@xxxxxxxxxxx>
- Date: Mon, 05 Sep 2005 13:59:46 -0700
On Mon, 05 Sep 2005 12:40:58 -0400, keith wrote:
> On Sun, 04 Sep 2005 20:17:37 +0200, Frank Bemelman wrote:
>
>> [quoted text muted]
>
> Macros are far more than (even sort of) subroutines. They can do
> conditional processing too. A few years back (when I was doign such
> things) I had a set of x86 assmebler macros that would do PL/I-like
> branch constructs (IF/THEN/ELSE, SELECT/WHEN in both forms, LOOP, UNTIL,
> etc.). Assembler macros are *much* more than (sort of) subroutines. If
> that's all you're using macros for, I can see why you don't much like ASM.
It's the duckling syndrome. We always love whatever we bonded to as a
child.
I like C because it's what I 'grew up' with. I've done lots of asm coding,
but it is always painful when I have to hack out the loop control
structures yet again using compare and branch instructions (or write the
macros using some arcane assembler to do that on a new architecture), or
explicitly allocate and reuse local variables, or remember which status
bits get whacked by which instructions, or try to remember the calling
registers or stack allocation for a called routine.
C does all this for you, at a small price in efficiency, but doesn't get
in your way like many other HLLs. I think the level of abstraction is just
right for most software that touches hardware. That is probably why most
OS, driver, and embedded software is written in it, and has been for 25
years. If you need more speed or more space, there are hard core
optimization options, and you can always profile and optimize by hand in
assembler.
Yet another good thing about C is that it's pretty standard. Nearly
everybody can read it after a few minutes instruction (unless you've
macroized it to look like cobol) Assembler with macros tends to look like
a private language, and intuiting higher level structures can be
daunting.
C was designed to be a portable assembly language, and, in my
opinion, does a great job at that task, and many others. Quick to write,
often portable, easy to read, handles annoying details that can be the
source of bugs, but lets you whack away at hardware without trying to
protect you from yourself. Flexible, malleable, can be used to write
drivers, operating systems, or AI. It's a good language.
--
Regards,
Bob Monsen
If a little knowledge is dangerous, where is the man who has
so much as to be out of danger?
Thomas Henry Huxley, 1877
.
- Follow-Ups:
- Re: Hey, what is all this 'off topic' posting?
- From: keith
- Re: Hey, what is all this 'off topic' posting?
- From: John Woodgate
- Re: Hey, what is all this 'off topic' posting?
- References:
- Hey, what is all this 'off topic' posting?
- From: Bob Monsen
- Re: Hey, what is all this 'off topic' posting?
- From: SioL
- Re: Hey, what is all this 'off topic' posting?
- From: Frank Bemelman
- Re: Hey, what is all this 'off topic' posting?
- From: keith
- Re: Hey, what is all this 'off topic' posting?
- From: Ken Smith
- Re: Hey, what is all this 'off topic' posting?
- From: Frank Bemelman
- Re: Hey, what is all this 'off topic' posting?
- From: keith
- Hey, what is all this 'off topic' posting?
- Prev by Date: Re: Bush is either a liar, or an idiot, or both.
- Next by Date: Re: Bush is either a liar, or an idiot, or both.
- Previous by thread: Re: Hey, what is all this 'off topic' posting?
- Next by thread: Re: Hey, what is all this 'off topic' posting?
- Index(es):
Relevant Pages
|