[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Low-level vs. High-level programming (was My First Computer)
In article <bcqv6a$d0a$4@sparta.btinternet.com>,
Kevin Lawton <kepla@btinternet.com> wrote:
> Kelly Hall <hall@priest.com> wrote:
> | "Kevin Lawton" <kepla@btinternet.com> wrote in message
> | news:bcplc6$b5e$4@titan.btinternet.com...
> || One thing I have noticed is that
> || programming languages seem to evolve to absorb the processing power
> || available to them. Assembler and C are massively powerfull and
> || efficient, but require much skill to use properly. The result is
> || small fast programs which can get the best performance out of the
> || hardware they are running on.
> |
> | In my opinion, *programs* can be fast and efficient; programming
> | languages themselves are rather neutral. For example: a good
> | programmer can implement a fast and efficient algorithm in Java that
> | would outperform a bad algorithm in C.
>
> I think it would take a brilliant Java programmer and an extremely bad C
> algorithm for that situation to arise.
Not at all: you could do it yourself! For instance, implement a
bubblesort in C and a quicksort in Java, and sort a large number
of items. Which code do you think will run fastest?
> My point was that given programmers of reasonably similar competency,
> the C code will be smaller
I don't think so - Java bytecode is actually quite compact.
> and quicker than the Java.
THAT will depend on the platform. And it'll be very very hard to
find a Java compiler and a C compiler which produces code for the
same platform -- then you'd need to find either a C compiler emitting
Java byte code, or a Java compiler emitting native code.
The main disadvantage of Java here is the lack of an actual hardware
platform able to directly execute Java bytecode.
> Also, I would not expect the C programmer to take much longer than
> the Java programmer to write their program, though Java programmers
> appear to be paid a littlew more than C programmers. Net result,
> similar development costs but less efficient Java programs.
Wait a little here -- the development costs doesn't merely include
"writing the program" -- it also includes debugging and maintaining
the program. And here Java offers a lot of advantages: array bounds
overflow are always caught, and memory management is automatic. Some
of the most hairy bugs in C programs (particularly large and complex
programs) often include "wild pointers" or memory leaks, but this can
never happen in a Java program.
--
----------------------------------------------------------------
Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN
e-mail: pausch at stockholm dot bostream dot se
WWW: http://www.stjarnhimlen.se/
http://home.tiscali.se/pausch/