[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 <l%1Ia.120$RK2.11917426@newssvr21.news.prodigy.com>,
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.

True.  But the programming languages are NOT neutral; a good
programmer could write good code in Java that would be beaten by good
code in C, simply because of all the additional work a Java program
has to do.  And even when the language itself is neutral, the
implementation itself may not be -- if writing a try/catch block
causes significant overhead, a perfectly good algorithm which uses
them will be hurt big time.

>By the time you figure in development time (writing a web server in assembly
>will likely take a lot more time than writing a web server in Java) and
>account for best usages in each language (I'll probably spend more a lot
>more time analyzing when data is allocated and freed in C than in Java), I
>find Java isn't all that inefficient for my desktop and server programming
>needs.

Sure, but you have the power to burn.  If something's going to be used
in a situation where it's lightly loaded or doesn't need to perform
well, by all means optimize for development time.  On the other hand,
if you're going to be running heavily loaded at the limits of current
hardware, you're going to need to spend some development time looking
at performance.


-- 
Matthew T. Russotto                            mrussotto@speakeasy.net
"Extremism in defense of liberty is no vice, and moderation in pursuit
of justice is no virtue."  But extreme restriction of liberty in pursuit of 
a modicum of security is a very expensive vice.