Are there more efficient programming languages that I should be aware of?

Javafans answer was a bit sarcastic because it doesn't really make sense to ask about efficiency around an open (which is maybe a thousand times slower than the following test you are worried about.

There are faster languages about, for example C/C++ and assembly language. But that doesn't mean that YOU are faster in programming them. Or that it is as much fun programming in them. Tasks that are done in perl with a few lines need sometimes hundreds of lines in C. Pray that you have a fitting library at hand.

For example, Hashes are used extensively in modern languages like perl, they are the bred-and-butter data structure and used for 80% of all data storage in a program. In C/C++ you can either:
a) use a self-made data structure perfectly fitting the job, you only need 5 days instead of 1 to write the program and it might be noticably faster or not.
b)use a hash library to get nearly the comfort of perl but also the same speed as perl for the handling of the data structure

Don't get me wrong, if speed is all you care about, then use C/C++. If you need to write programs that have to make full use of every single memory bit and processor cycle of your machine, use C/C++. If you need to write low level hardware driver stuff, use C/C++. If you want to write programs faster, securer, testable, have better debugging, with more ease, have more libraries to choose from, want to use hashes and regex and other modern features extensively, want to program for the web or other high-level areas (i.e. far form the hardware), use perl.

Note that you can combine perl and C-code (with limits) so it is often possible to write perl code and optimize the critical code parts with C code, if run time is critical


In reply to Re^2: file test operations by jethro
in thread file test operations by neutron

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.