Well, I'm an old hardware jock; so I tend to think the simplest solution to a simple challenge is to connect a piece of wire from the hot side of the battery to the load (and hope the load is already grounded). That approach can fall short of expectations in several ways, which is why we have more advanced methods for setting binary state.

Bypassing a number of increasingly complex but very simple approaches, we come to some sort of prebuilt application, like Excel, which requires little thought but can do quite a bit, so long as the class of problem is within the range the tool is designed for. I'm proud to say that if someone has already built not only the wheel but the whole car, I'm willing to just get in and drive it.

If you feel that you must build your own wheel, then I heartily suggest Perl as your tool for most purposes. You can write a one-liner for simple, simple problems; a short script for not-so-simple problems; a longer script with a few modules for still somewhat simple problems; or a big honking script with any number of modules exhaustively tested by the Perl Community for simple problems that have outgrown their starter pot.

There may be tasks for which other languages are better but I daresay most of these can also be handled well enough in Perl. Hardware resources -- time, memory, storage -- are all so cheap today (which is one reason I don't do hardware anymore) that Perl is a fine choice even if some gain in efficiency is promised by another. And if you're really concerned about performance, your task is not simple, is it?

In reply to Re: Language for something simple by Xiong
in thread Language for something simple by PeterPeiGuo

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.