From: lithgow@usl.com (Malcolm Lithgow)
Newsgroups: comp.sys.acorn
Subject: Re: Oh no ! More .....
Date: 5 Oct 92 03:55:05 GMT

[In message "Re: Oh no ! More .....", Clive Jones writes:]
>For me, the argument is NOT between C and assembler, but between a
>high-level language and a low-level one.
>
>John's position - that Arm assembler is more readily ported to new
>platforms than C is *very* shaky.

This is not John's position. He is saying that ARM assembler is just as
easily ported to new implementations of the ARM as C is. Quite a
different kettle of fish, hmmm? (Lucky Gavin didn't say this. ;->)

>For a start, assembler programmers
>would need a new assembler in order to upgrade code, in direct
>analogy to the new C compiler needed by C programmers.

As John points out, with the old assembler and a code manual a new
assembler will take a couple of hours to write.

>Most importantly, higher-level programs are easier to write.

I presume this should be: "Most importantly, programs are easier to
write in higher-level languages."

This is true. However, if design, and testing are taken into account
along with coding, the advantages aren't as great as most people
believe.

>It's
>easier to build powerful procedure libraries.

This is either a re-statement of the above argument, or it is rubbish.

Libraries are easier to build in a high-level language because coding
is faster and easier in a high-level language. However, the advantages
for libraries are even smaller in this case, since design is so much
more important, and takes a proportionately larger chunk of the
development cycle.

>It's easier to interwork
>code from different programmers in a large project, and to define the
>interfaces between those code segments.

This, however, is complete rubbish. It is no easier to 'interwork' code
from different programmers into a large project. It is no easier to
define the interfaces between those code segments.

Look at how precisely, elegantly, and simply the assembly language
interfaces to RISC OS are described. Look how easily people completely
seperated from the main development group can add/change functionality
to the OS.

Can anyone explain how HLL's make it easier to define interfaces or
allow modular development?

> The parts of code I write in assembler are typically
>floating point emulators (100k of source - all in armcode, so I can
>hardly be accused of having a blinkered view of the stuff)...

True. But you could have a blinkered view of programming methodology,
no? (So could I, of course.)

> However, only a fraction of the
>typical project needs to be in armcode - run a C program with function
>call profiling, and you'll soon realise that, between the extremes of
>C on the one hand and Armcode on the other, coding say 1% or 2% of a project
>in armcode can often tilt you over half way towards the speed
>efficiency of a 100% Armcode program.

Yes and no. The very difficulty of coding in Assembler encourages lots
of good behaviour: code re-use, careful design, minimal size/maximal
flexibility feature set, redesign when porting, careful testing,
extensive modularity, extensive code documentation, etc.

On the other hand -- my current projects are all in C, because
portability is an overriding concern.

> If you need block-structuring to
>provide clarity in a particularly complex algorithm, then mixing in a
>bit of Pascal will also help.

I think something like WEB for assembler would be better at providing
clarity than 'a bit of Pascal'.

>You need to trade off source clarity,
>development effort, maintenance effort, runnable image size, execution
>speed and portability - and they contradict.

And most people have severe misconceptions about them, because they
don't use proper development methodologies.

>Where the boundaries lie
>for a given application is a matter of taste, but if you rigidly take
>an extreme position you run the risk of wasting a lot of your time, or
>pricing your product out of the market for that 10% speed increase, or
>not being able to make that Unix version you need, or coming unstuck
>when you need someone else to add some code to your application.

Indeed. But it doesn't stop people rigidly taking an extreme position.
Just look at the US Defence requirements: everything written in Ada!
Talk about stupid! And look at almost any university graduate, who has
a pathological and totally unwarranted hatred of anything wearing the
label of BASIC, and believes that only DSP's should be programmed in
assembler, and that you can't write modular assembler programs.

It amuses (and depresses) me how modern programmers look on themselves
as so enlightened and wise, since they can use C, Pascal, UNIX,
Windows, etc. and yet the poor fools can't make a decent design for a
word-wrap program if you give them a year. (I'm not referring to anyone
on comp.sys.acorn*, of course, which has people producing some of the
best work in the world.)

Reminds me of the typical attitude that most inhabitants of
industrialised countries have in this Age of Arrogance, actually.

Anyway, 'nuff said.

-Malcolm.  lithgow@usl.com  These are merely my opinions.