[comp.sys.acorn] Languages

jung@einstein.physics.buffalo.edu (Alexander Jung) (02/12/91)

In article <1991Feb10.180855.17062@cns.umist.ac.uk>, rogersh%t1a@uk.ac.man.cs writes:
|>   [cited stuff deleted] 
|> 	Complete nonsense - Pascal is far more similar to C than BASIC.
|> Pascal & C are block structured, BASIC isn't. BASIC isn't actually
|> structured at all! Pascal & C are typed, BASIC isn't (at least not
|> much). Furthermore C is far more productive than either precisely
|> because it is terse and packs more power into each line of source
|> code. Also I could mention the preprocessor and the fact
|> that the language of *choice* in almost all commercial systems
|> software is C. BASIC is good for quick hacks and fast turnaround. Pascal
|> is good for beginners (it is a teaching language after all), but if
|> you want the real McCoy, C is the only solution. Lack of casting in Pascal
|> is one very good reason for preferring C over Pascal. Vastly superior
|> I/O and standard libraries is another.
|> [more on superiority of C vs. BASIC & rest of the world, also cut out]

Ok, before the holly war on programming languages starts up on this newsgroup
also, I'd like to add my 0.02 $US:
	I like Basic on my arch because it keeps programs small and simple (yeah,
I know the Interpreter chews up some ROMspace, but even with this in account the
programs written in Basic are most of the time smaller than compiled C-programs
with their sources).
	Another (old)point is that the turnaround time for basic is
even with a SCSI-disc not compareable to C (takes about 1 min to compile an
average sized prog).
	I could not find any real superior construct in C (apart from strong
typing) that is not included in Basic V. 
But now closer to the points you make:
- you claim that Basic is not structured at all; this is true for some old
  standards (see C 64), but no longer for Basic V, which has all tha
  capabilities of a modern structured language (do, while , repeat until, Proc,
  Functions, local Variables...)
- you say C ''is far more productive than either precisely
  because it is terse and packs more power into each line of source
  code.`` I do not think that this packing is the very best thing since bread in
  slices, mainly because a normal human being can't understand a real packed
  line of source code after three weeks, and the compiler can't anyway (i.e. has
  no special optimisations for tense lines)
- you say ''that the language of *choice* in almost all commercial systems
  software is C.`` This is true, but Cobol is also the language of choice for
  most comecial people....
- you say ''Strong typing - yes. Strong typing without the ability to cast
  between these types - no thanks.'' I can not really follow this argument, since
  the only place I need casting in my C programs is for constants or in system
  programming, which I prefer to do in assambler.
- you claim ''The great advantage of C is it's *lack* of built in rubbish. All
  the i/o etc. is in standard libraries, reducing the load image size of programs
  which don't need (or want) a pile of utility functions linked in.``
  I have not seen any linker on the arch that does that (picking funktions out
  of libraries), the only one I know of (hi acorn) links the whole library to
  the code, so this goes down the street...
- (last one) you state ''Absolute not true - compiled BASIC is only a tenth the
  speed of efficiently written compiled C, and 1/12 that of raw ARM code.``
  I don't write the speed dependent parts of my programs in any high level
  language (apart from some pseudo code I use for structuring), but right down
  in Assembler, but compared to other machines this Basic is really fast enough
  (faster than Turbo C on a 25MHz 386 ....)

(Hope my quoting technique is not to weird)

----------------------------------------------------------
Alexander Jung (temporary at Buffalo, N.Y.)
jung@einstein.physics.buffalo.edu
----------------------------------------------------------
Famous last words:
   1) "Don't worry, I can handle it."
   2) "You and what army?"
   3) "If you were as smart as you think you are, you wouldn't be
       a cop." 






-- 
----------------------------------------------------------
Alexander Jung (temporary at Buffalo, N.Y.)
jung@einstein.physics.buffalo.edu
----------------------------------------------------------

osmith@acorn.co.uk (Owen Smith) (02/12/91)

In article <8415@castle.ed.ac.uk> ecwu61@castle.ed.ac.uk (R Renwick) writes:

>BASIC V, Pascal and C are for wimps!

Most of my programs need to talk to the wimp :-).


Just to throw my thoughts into the raging maelstrom, now I'm here, I HATE
BASIC! Unfortunately, I've been working on BASIC programs most of the time
recently :-(. Soon I'll have to do a fair amount of assembler work :-( :-(.
These things are sent to try us. Sigh.

Owen (a C programmer, lost in the wilderness).
 

The views expressed are my own and are not necessarily those of Acorn.

gks@doc.ic.ac.uk (Gary K Smith) (02/12/91)

Well, I thought I'd add my bit to this discussion. In my opinion, there is
no 'best' language. Each person prefers to use a different language for
different reasons. In general, appart from a few very specific things,
all the languages do exactly the same, ie create a way write your own
applications without an assembler.

Personally, I use C most of the time, because it can be compiled, and is
therefore a more suitable language for professional development than BASIC.

I also use BASIC, but this is mainly to create Data files and other things,
where it's not worth the bother of getting a program compiled and written.
Another disadvantage is that it is slower, and you only find the syntax errors
when you get to them at Runtime.

As for Pascal, I never use it, but this is only because I have to use Modula 2
here at university for my coursework, and I don't find as good as c, and I am
told that Pascal is similar.

Anyway, as I said above, the 'best' language depends upon the users preference,
and it is silly to keep on highlighting the 'good' points of each language.



				Gary.
--

aoliver@acorn.co.uk (Ashley Oliver) (02/12/91)

BASIC V, Pascal and C are for wimps!  Try a real language like BCPL! Data typing's only needed by wimps
that put bugs in their programs [:-) 

        -Ashley Oliver
:::::::::::::::::::::::::::::::::::::
:Breac aig na h-uile fir-stiuiridh!!:
:::::::::::::::::::::::::::::::::::::

goodwin@oyez.enet.dec.com (Pete Goodwin) (02/12/91)

In article <59196@eerie.acsu.Buffalo.EDU>, jung@einstein.physics.buffalo.edu (Alexander Jung) writes...
>	I could not find any real superior construct in C (apart from strong
>typing) that is not included in Basic V. 
>But now closer to the points you make:
>- you claim that Basic is not structured at all; this is true for some old
>  standards (see C 64), but no longer for Basic V, which has all tha
>  capabilities of a modern structured language (do, while , repeat until, Proc,
>  Functions, local Variables...)

BASIC is not a fully structured language. It has IF-THEN-ELSE-ENDIF, CASE etc.
but it's missing the other part of structured languages - structured data
types.

Whenever data structures are manipulated in BASIC you'll see code like:

buffer%!0 = 1
buffer%!4 = 12
buffer%!8 = 14

which is not very readable. I'd use BASIC V if it had structured types, but it
doesn't. Hence I'll use either PASCAL or C. Since ANSI C Release 3 comes with a
much better support package, that's what I tend to use most.

Pete

rjb17@ely.cl.cam.ac.uk (Richard Black) (02/13/91)

In article <1991Feb11.105227.15182@and.cs.liv.ac.uk>
rkl@and.cs.liv.ac.uk writes:

> I was dabbling in C on our HP UNIX boxes a while back and I was shocked at
> the complete lack of warning about the following:
>
> hello(param1,param2)
> int param1,param2;
> {
>    printf("Param 2 = %d\n",param2);
> }
>
> main()
> {
>    hello(1);
> }
> 
> Yes folks, I forgot a parameter and THERE WAS NOT EVEN A WARNING FROM THE
> COMPILER !

There should not be a warning from the compiler. It is a K&R compiler not
an ANSI compiler. Besides which you have deliveratly used a K&R style
definition. Even "gcc - Wall -pedantic" gives

acorn.c: In function hello:
acorn.c:2: warning: return-type defaults to `int'
acorn.c:4: warning: implicit declaration of function `printf'
acorn.c:5: warning: control reaches end of non-void function
acorn.c: In function main:
acorn.c:8: warning: return-type defaults to `int'
acorn.c:10: warning: control reaches end of non-void function

And doesn't warn of the incorrect number of parameters. This is correct
K&R behaviour.

> I put it through lint too and NO WARNING AGAIN !

Really? Transcript follows...

--/Nfs/forties/usr14/rjb17 $ arch
hp9000s300
--/Nfs/forties/usr14/rjb17 $ lint acorn.c

acorn.c
==============
(10)  warning: main() returns random value to invocation environment
warning: argument unused in function:
    (2)  param1 in hello


==============
function called with variable number of arguments
    hello       acorn.c(3) :: acorn.c(9)
function returns value which is always ignored
    printf

What did you do, lint > /dev/null or something?

R.

wainhous@kcl-cs.UUCP (Andy) (02/13/91)

In article <5102@acorn.co.uk> aoliver@acorn.co.uk (Ashley Oliver) writes:
>BASIC V, Pascal and C are for wimps!  Try a real language like BCPL! Data typing's only needed by wimps
>that put bugs in their programs [:-) 

C is, of course, derived from BCPL.
                 Hence the C --^

On the subject of languages, is there anyone out there that actually likes C++?


Andy.

has@ukc.ac.uk (H.A.Shaw) (02/14/91)

    BASIC V has one other advantage.  You have to send out source. :-)  I
learnt a lot about WIMP programming by looking at the code for the Acorn
applications that came with my Arc.  Especially !Madness and !Help
(Interprocess Comms.) and !Alarm (changing icons on the fly)  Of course you
have to understand BASIC's (Acorn's) really odd way with records!
    Of course if you are writing commercial software BASIC V has one huge
disadvantage.  You have to send out source. :-(

Email: has@ukc.ac.uk                         | Howard Allan Shaw.
                                             | The Unit for Space Science.
Phone: +44 227 764000 Extn: 3785             | Room 165, Physics Laboratory,
                                             | The University,
                                             | Canterbury, England.  CT2 7NZ

Gavin.Flower@comp.vuw.ac.nz (02/15/91)

Although my days of writing systems in BASIC (on an 8-bit BBC model "B")
are over.  I think that the BASIC on the ARC is highly structured.  For
writing small programs, and simple systems, it beats both "C" and COBOL.

"C" and COBOL come into there own when at least one of the following apply:-
   - you are very fluent in "C" or COBOL, but not Arc BASIC
   - writing large complex programs
   - writing of medium to large systems
   - several people sharing the programming effort
   - established libraries of code in "C" or COBOL
   - portability is important
   - speed of run time execution is a significant factor

Where the elapsed time between having an idea and having a working program
is crucial, Arc BASIC has a great advantage over compiled languages in
several situations.

Assembly language is fine for speed, but it is not very portable.
Optimising for one procesor such as an ARM2 means you have rewrite
to optimise for an ARM3 which has a cache.

"C" versus COBOL:
                   COBOL tends to be mini/mainframe based - a lot of people have been trained in it (including me - shock horror) and there is massive
mnumber of large systems needing to be maintained in it.
                  "C" exists on the most number of processor architectures
and varieties of operating system as well providing the greatest flexibility
in developing systems on "micros" or in UNIX (my own micro, A310,
has 8 times the
processing power of an old ICL4/72 mainframe which used to control
a thousand banking terminals).

I think the best answer is to develope good optimising "C" compilers
and use assembly code only for really crucially time dependent functions.

adam@ste.dyn.bae.co.uk (Adam Curtin) (02/19/91)

In article <2043@xenon.kcl-cs.UUCP> wainhous@kcl-cs.UUCP (Andy) writes:
>On the subject of languages, is there anyone out there that actually likes C++?

Yeah, started it 15 months ago after 6 years C programming, never looked back.

Applications are designed and implemented faster, code size and execution speed
similar (sometimes better, sometimes worse), orders of magnitude improvement in
maintenance ... fun, too.

It's a bit of a culture shock after C. The familiarity of the syntax lures you
into thinking you know it already, but the OOP paradigm requires a completely
different approach. It's great.

Wanna make something of it? :)

Adam
-- 
/home/research/adam/.signature: No such file or directory

dbh@doc.ic.ac.uk (Denis Howe) (02/20/91)

In article <1991Feb12.092955.19872@decuk.uvo.dec.com> goodwin@oyez.enet.dec.com (Pete Goodwin) writes:
>BASIC is not a fully structured language. It has IF-THEN-ELSE-ENDIF, CASE etc.
>but it's missing the other part of structured languages - structured data
>types.
>
>Whenever data structures are manipulated in BASIC you'll see code like:
>
>buffer%!0 = 1
>buffer%!4 = 12
>buffer%!8 = 14
>
>which is not very readable.

In C you would have an include file giving names for the constants.
Does anybody have an equivalent for WIMP programs in BASIC? All you
need is lots of assignment statements but you might also want
something like C's preprocessor to replace the symbolic names with
numbers for a smaller, faster production version.

It's not structured data types but it would help to make WIMP programs
in BASIC a lot more readable.

--
Denis Howe <dbh@doc.ic.ac.uk>    C C       C C
   +44 (71) 589 5111 x5064      C   C N=N C   C
    DiazaBicycloHexene ?         C C       C C

mathew@mantis.co.uk (mathew) (03/01/91)

csuaw@warwick.ac.uk (Patrick Clark) writes:
>   I HATE C++ , C is just about tolerable but C++ is awful. Ive nicknamed it C
> cr*p  cr*p. And I hate it ! .... By the way C++ supporters ( there must be
> some ! ) can anybody give a GOOD use for multiple inheritance ?

Hint:

Your comment reminds me of the BASIC programmer who remarked that C was crap,
and asked if anyone could think of a use for structures and unions.

Take it to alt.hackers.self-taught.


mathew.