[seqfan] Re: Programming languages

hv at crypt.org hv at crypt.org
Wed Sep 20 13:38:53 CEST 2023


John Mason <masonmilan33 at gmail.com> wrote:
[...]
:With objects: 24 seconds
:Without: 24 seconds
:So apparently my fears were unjustified.
:Does anyone have a similar experience?
:Does anyone want to tell me I'm using the wrong programming language anyway?

Premature optimization is the root of all evil. :)

Generally, I'd expect to write the fastest code in the language(s) I'm
most familiar with.

In most cases, however, I start off not knowing much about a problem I'm
investigating: at that stage speed and flexibility of development are more
important than speed of execution.

As such I tend in almost all cases to start off exploring and prototyping
in Perl (which I know very well), and rewrite in C (which I know pretty
well) only when I'm fairly confident that a) I won't get execution time
down to something reasonable just with Perl, and b) I know what algorithms
and data structures I'm going to need in C.

Of particular value is a good profiler: for Perl we are blessed with an
especially good one, Devel::NYTProf [1]. I'm not aware of anything
remotely as powerful for Java (or for C/C++).

Hope this helps,

Hugo van der Sanden

[1] https://github.com/timbunce/devel-nytprof


More information about the SeqFan mailing list