Last week on Thursday I joined a Microsoft webcast and Andy Hunt was the speaker. At one point, Andy was asked the question what language he will use for something simple. He answered c, which appeared quite interesting to me.

To me, if it is non-GUI, I would use Perl or Ruby, and Perl was my favorite for a long time. For GUI, I would pick C#, but Perl/Tk or FxRuby are also on my list.

By the way, c is a great language and one of my favorite.

What's your pick?

Replies are listed 'Best First'.
Re: Language for something simple
by moritz (Cardinal) on Mar 08, 2010 at 07:36 UTC

    "simple" is always relative.

    In Perl it's very simple to do some basic string processing, uniquifying values through hashes and so on.

    In C it's very simple to write some calculation which just need a million arithmetic calculations.

    In Prolog it's very simple to search for relations in a graphs (for example determine cousinship relations between two people).

    In many languages it's simple task to write a program or a problem that is mostly solved by a ready-made library already exists.

    And finally "simple" also depends on how familiar you are with a language.

    Perl 6 - links to (nearly) everything that is Perl 6.

      It's true, whether it is simple to do something in a language is, a lot times, determined by the libraries that are readily available.

      Take this a step further, in today's world, it is not only about whether you have couple of libraries handy, often times it is also about whether you have a framework for certain jobs, this is particularly true for all web applications.

      In the same webcast, it was jokingly (or not so much jokingly) mentioned that now people probably use 14 frameworks in one application. For example, in a ASP.Net web application, you may use entity framework for database access, jquery (as a framework) to ease javascript development, and don't forget that ASP.Net itself is a framework...

Re: Language for something simple
by JavaFan (Canon) on Mar 08, 2010 at 08:01 UTC
    For something "simple", I would expect most people pick their favourite general purpose language, as any non-domain-specific language will do the trick. I would expect that in this forum, the majority of the people would pick Perl for the task.

    I'd expect that in the general programming community, the majority of the programmers would not pick Perl (because they either don't know the language, don't like the language, or have a different favourite language).

    And I'm not surprised there are people that pick C.

Re: Language for something simple
by talexb (Chancellor) on Mar 09, 2010 at 15:12 UTC

    Having developed code in C for fifteen years before discovering awk and then Perl, I know that for anything to do with file manipulation I'd use Perl, hands down. I can remember writing C utilities many times, writing argument parsing and file manipulation routines over and over again, thinking to myself, "This is stupid -- I haven't even got to the part that I want to do yet!"

    Don't get me wrong -- C is an awesome language, and it's blazingly fast; but it's a bit like building a house using individual 2x4s rather than the pre-built Walls that Perl provides. :)

    Alex / talexb / Toronto

    Team website: Forex Chart Monkey, Forex Technical Analysis and Pickpocket Prevention

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      But maybe there are "pre-built Walls" for C also ?
Re: Language for something simple
by Anonymous Monk on Mar 08, 2010 at 03:35 UTC
    What is something simple? Perl, perl, perl, if perl doesn't fit, jscript/javascript/c depending on the target.
Re: Language for something simple
by Svante (Sexton) on Mar 10, 2010 at 11:33 UTC

    I use Common Lisp whenever I can. If that is not possible, my next choice is Perl.

    Update: Yes, I realize that this may not be popular on this site. :)

    Anyway, when looking at Perl 6, there is a lot of Lisp greenspunning its way here. There is thus hope for conciliation.

Re: Language for something simple
by spx2 (Deacon) on Mar 09, 2010 at 04:48 UTC
    Just assembly language, because it's not fancy.
Re: Language for something simple
by Xiong (Hermit) on Mar 17, 2010 at 06:35 UTC

    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?