Slashdot Mirror


Searching for the Best Scripting Language

prostoalex writes "Folks at the Scriptometer conducted a practical survey of which scripting language is the best. While question like that is bound to generate flamewars between the usual Perl vs PHP, Python vs Perl, VBScript vs everything crowds, the Scriptometer survey is practical: if I have to write a script, I have to write it fast, it has to be small (less typing), it should allow me to either debug itself via a debugger or just verbose output mode. sh, Perl and Ruby won the competition, and with the difference of 1-2 points they were essentially tied for first place. Smalltalk, tcc, C# and Java are the last ones, with Java being completely unusable in scripting environment (part of that could be the fact that neither Java nor C# are scripting languages). See the 'Hello world' examples and the smallest code examples. Interesting that ICFP contests lately pronounced OCaml as the winner for rapid development."

21 of 673 comments (clear)

  1. Slashdot Code Auto Answer by Anonymous Coward · · Score: 5, Funny

    Hello, I am the Slashdot Source Code. The answer is Perl. This question is now answered.

    Thank you for visiting Slashdot.

  2. flamewar volley 1 by nocomment · · Score: 4, Funny

    where's php?
    print "hello world";

    --
    /* oops I accidentally made a comment, sorry */
    /* http://allyourbasearebelongto.us */
    1. Re:flamewar volley 1 by JWSmythe · · Score: 2, Funny


      I'm playing with a script now, to see the most obnoxious way to do it. :) Hmmm, converting it to binary may end up really obnoxious.. Right now, it's just convering characters to their ASCII numbers, binary numbers would make it huge.

      Thanks for the idea!

      --
      Serious? Seriousness is well above my pay grade.
  3. What about batch files?! by Anonymous Coward · · Score: 1, Funny

    You can do dozens, literally dozens, of things with batch files!

    Only partially joking, though, as batch files using 4DOS/4NT are really quite powerful.

  4. C++ by daserver · · Score: 2, Funny

    C++ was also praised: "C++ is a fine programming tool for many applications."

  5. You're right... by rsilvergun · · Score: 2, Funny

    ...I mean, look at all those clear, concise Brainf**k programs out there.

    Seriously, there's something to be said about a programing language that forces good practices (read: python). I indent and comment my code pretty well/consistantly, but a lot of people don't. And while I don't program professionally, I could certainly empathize with people who do debugging Perl code.

    --
    Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
    1. Re:You're right... by rsilvergun · · Score: 2, Funny

      Because then I've got to take over maintaining their code.

      --
      Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
  6. Re:Biased by p2sam · · Score: 2, Funny

    psam@einstein ~ $ java qwer
    public keyword is not needed for execution
    psam@einstein ~ $ cat qwer.java
    class qwer {
    public static void main( String[] args ) {
    System.out.println( "public keyword is not needed for execution" );
    }
    }

  7. Re:The eternal quest... by TastyWords · · Score: 3, Funny

    Hmmm.
    Good Point.
    We'll incorporate it into our next build.

  8. Re:Biased by Martin+Blank · · Score: 4, Funny

    No, no... He values maintaining a job. With one-character class names, he's the only one that can really trace the workings. Ergo, he's the only one who can maintain it, and thus unfireable.

    --
    You can never go home again... but I guess you can shop there.
  9. Re:Biased by Anonymous Coward · · Score: 2, Funny

    As the old saying goes:

    "Do you have job security?"

    "Yes? Do you have code to prove it?"

  10. Now by LittleLebowskiUrbanA · · Score: 1, Funny

    Begun the great scripting languarge holy war has.

  11. Re:I used to think Python was great for _everythin by rpbailey1642 · · Score: 3, Funny

    Speaking of web stuff and perl, my (former) boss always said "Perl is great. In fact, if you smash your hands down on the keyboard, you're halfway to having a working web server." Not trolling here, attempting humor.

  12. Re:/Nick 1337h4x0r by Ray+Radlein · · Score: 2, Funny

    I never really thought about it before now, but damn, l337-speak can look like exceptionally grotty perl code when it wants to...

  13. Ah. by Estanislao+Mart�nez · · Score: 3, Funny

    So perl regexps are cryptic and hard to read even if you know regexps already. Thank you.

  14. Re:Biased by Mad+Marlin · · Score: 2, Funny
    That job security through code obscurity thing really doesn't work because the ones who do the hiring and firing probably have no idea what it is you do other than "some computer stuff" and they probably don't have any clue that the whole system is going to crash a couple months after you're gone.

    Which is when they realize how good of a programmer you are, and hire you back for twice your previous salary.

  15. Re:What about readability? by RovingSlug · · Score: 2, Funny
    int doit(char *in, int limit) {
    char x[256], y[256], z[256];
    // ...
    if(limit > 0) {
    return strcat(x,strcat(y,z)); }
    }

    Jesus christ. Did you just return a pointer to a stack allocated buffer? Oh. My. God. Please burn this C code and forget you ever wrote it.

  16. Re:What about readability? by Anonymous Coward · · Score: 1, Funny

    Fixing all that (except for the Unicode bit) is left as an exercise for the reader.

  17. Pure Shell Grep by Pan+T.+Hose · · Score: 2, Funny

    There's lots of other subtle biases. For example, in the "grep" example, the sh code simply called grep. If he wanted to be pure about the scripting he'd not have had any way of doing a RE in sh (since it doesn't have true RE handling builtin, it only has globs through 'case') and if he was going to use external calls then why didn't he just do 'exec grep "$@"' or otherwise afford the use of external command execution to the other languages too?

    OK, here it is:

    #!/bin/sh

    # 2004-06-13T12:33:55+0000

    # pth shgrep - a minimal shell grep implementation
    # Copyright (C) 2004 Pan Tarhei Hosé, PhD.
    # http://developers.slashdot.org/~Pan%20T.%20Hose/
    # http://developers.slashdot.org/comments.pl?sid=110 875&cid=9411049
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 2 of the License, or
    # (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program; if not, write to the Free Software
    # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

    [ a$1 == a ] && echo "Usage: $0 pattern < file" && exit 1
    while :; do read a || exit; [ "${a/$1/}" == "$a" ] || echo $a; done

    Just a quick hack I wrote right now in less than a minute, I am sure one could write it better. A quick test:

    pth@ws0:43:~/sh/shgrep$ ./shgrep arse < /usr/share/dict/words
    arsehole
    arseholes
    arsenal
    arsenals
    arsenate
    arsenic
    arsenide
    [...]

    Seems to work fine. Is it pure enough?

    --
    Sincerely,
    Pan Tarhei Hosé, PhD.
    "Homo sum et cogito ergo odi profanum vulgus et libido."
  18. Re:Practical? Bah, humbug. (Pythonic bias warning. by Anonymous Coward · · Score: 2, Funny

    Youdon'treallyexpectsomeoneactuallyreadingthatpost ,doyou?

  19. Re:What about readability? by Anonymous Coward · · Score: 1, Funny

    Because no one writes comments you insensitive clod!