On 07/01/12 1:50 PM, Dave Caroline wrote:
On Sat, Jan 7, 2012 at 6:16 PM, Toby Thain<toby at
telegraphics.com.au> wrote:
On 07/01/12 11:38 AM, Liam Proven wrote:
So yes, I think it's important that
you learn all this stuff. But do I
think you should start with a low-level language like C? No! Students should
not have to deal with buffer overruns, manual memory allocation, and the
like in their first exposure to programming.
So some education teaches Java a cough "safe language" and we get slow
memory hogs
because they know no better! yes they do need a proper education with
low level code in C or assembler etc and why the
other solutions are slower
This is all addressed by Bloch even in that short extract.
eg from the Haskell wiki
(
http://www.haskell.org/haskellwiki/Introduction#What_is_functional_programm…)
Whereas the C program describes the particular steps the machine must
make to perform a sort -- with most code dealing with the low-level
details of data manipulation -- the Haskell program encodes the
sorting algorithm at a much higher level, with improved brevity and
clarity as a result
This is actually very important ^^
(at the cost of efficiency unless compiled by a
very smart compiler):
Haskell can of course be "faster" than C, for the rare times when that
actually matters. But you know that already from your research, I'm sure.
It is a fallacy that programs written in assembler and C are "fast"[*].
It is a fallacy that programs written in dynamic/functional/other
languages are "slow". It is a fallacy that "fast" and "slow"
are always
the primary consideration.
It is not a fallacy that programmers expend too much effort in writing
confused and unmaintainable code, sometimes chasing those false grails.
--Toby
* an illuminating anecdote:
http://erlang.org/pipermail/erlang-questions/2011-November/062240.html
Cost of efficiency seems to be a problem not acknowledged by
proponents of most high level languages.
Dave Caroline