Live data from Hacker News

Why Perl Didn't Win

outspeaking.com

61–70 of 157 posts

Re: Why Perl Didn't Win

#61
post #16

if ain't php ,think will stick to perl.. first web base language learn..

why down vote,since it my first web base language in 2001. By that time,php is new and .net is version 1. When i got visual studio dvd,my pc run slow. So i moved to php and stick till now.

Re: Why Perl Didn't Win

#62
post #51

Earlier quoted context omitted.

But in those languages, the equivalent to ($x == "foo") will return false (almost) all of the time. The poster here says that this expression is true (almost) all of the time in Perl. Why?

But what is $x? Integer? String? Character? Some_Object? How do you evaluate this, depends on the context. Wasn't that the whole point of a dynamic language anyway?

No, not at all. Type coercion is orthogonal to type safety.

Re: Why Perl Didn't Win

#64
post #17

Perl lost because PHP took its place on the web development front. Perl lost because Python/Ruby took its place on admin front. Perl lost because the new version took forever to get ready and broke compatibility with the old code.

1. True

2. Linux Admin? maybe. UNIX admin? I'd say Perl still on, as it's installed by default (yeah not popular anymore, but a LOT of legacy system still run)

3. cannot comment, as never used new Perl, since UNIX still shipped with old-ish Perl

maybe, just maybe it's not just winning & losing :D every language will find it's place eventually.

Re: Why Perl Didn't Win

#65

Earlier quoted context omitted.

> For the "Enterprise!" developer pool, there's Java. The 500 line methods are still hard to slog through, though. Great straw-man there. I didn't realise that javac required 500 line methods before compilation. > In which case, the language of mandate doesn't matter much. It's a lot easier to pass two collections to a method in Java than to a sub in Perl.

--- Java --- List aList = Arrays.asList( new int [] { 1, 3, 5 }); // probably missing some more type stuff in Map aMap = new HashMap (); aMap.put( "name", "Joe"); aMap.put( "ID", "42"); // I need to check if Java 8 has map literals a la Groovy... doSomething( aList, aMap); ... void doSomething( List aList, Map aMap) { System.out.println( "First: " + aList.get( 0) + ", Name: " + aMap.get( "name") ); } --- Perl --- &do…

Incidentally, I find the -> operator more readable than the explicit dereference ${} stuff:

    printf "First: %d, Name: %s\n", $list_ref->[ 0 ], $hash_ref->{ 'name' };

Re: Why Perl Didn't Win

#66

Earlier quoted context omitted.

This sort of distinction exists in other languages though: Java has == and equals. OCaml has = and == etc. (Not that Perl doesn't have its issues; but this is very low in that list imho)

Those languages are far more maintainable and their communities have far more respect for practices which prevent programming errors. I don't particularly care how many forms of equality or comparison a language has as long as the compiler or runtime is capable of telling me the particular one I'm using is probably wrong. If == can't be used with strings the damn interpreter should tell me so instead of silently and…

You should have used strict and warnings. RTFM, I know.

Btw, Java will silently compare references instead of value. Learning a language != increasing vocabulary.

Re: Why Perl Didn't Win

#67
> You need large absolute numbers of users to grow a library. That's why library ecosystems like that of Python, Ruby, and Node.js have grown large in recent years.

Thats where the author missed an important point. None of those library archives have the culture of PAUSE+CPAN to constrain a minimal code quality when it comes to configuration, documentation, regression test and installation. This minimal code quality is constrained by CPAN testers, when a module hits PAUSE, before the module is seen by the unwashed masses who access CPAN.

I've seen many library archives of other languages, but they are all full of junk, undocumented junk, untested junk, and junk that does not configure or install everywhere. The worst example was the LuaRocks system. The quality of the libraries in the Rocks archive had been so bad, that the church decided to remove the module keyword from Lua language, to get rid of this junk. But the code I see for Ruby/Rails, NPM/Node, or PyPy/Python is junk compared to even those Perl modules, that barely managed to convince CPAN testers.

You not only need the absolute numbers, but important you need a core group starting the ecosystem who constrain a coding culture. Raw numbers are not enough. A million apes wont write a Shakespeare novel.

Re: Why Perl Didn't Win

#68

Earlier quoted context omitted.

--- Java --- List aList = Arrays.asList( new int [] { 1, 3, 5 }); // probably missing some more type stuff in Map aMap = new HashMap (); aMap.put( "name", "Joe"); aMap.put( "ID", "42"); // I need to check if Java 8 has map literals a la Groovy... doSomething( aList, aMap); ... void doSomething( List aList, Map aMap) { System.out.println( "First: " + aList.get( 0) + ", Name: " + aMap.get( "name") ); } --- Perl --- &do…

> List aList = Arrays.asList( new int [] { 1, 3, 5 }); You can drop the inner array, asList takes variable number of arguments. > // I need to check if Java 8 has map literals a la Groovy... Sadly not, IIRC they've backed off from literals towards a Guava style static factory methods, which I'm not thrilled about. > I'm not seeing that much of a difference in parameter passing, other than the explicit reference/deref…

> Except now, I have two ways of working with Perl's collections, two separate sets of sigils, and all because I wanted to pass two collections into a function and Perl treats function arguments as a collection, and Perl implicitly flattens collections.

It's not really two sets of sigils, it's two concepts: "collection", and "pointer to collection". I guess coming from C that didn't bother me too much—once it sunk that references were just (safe) pointers, using them works almost exactly the same:

    int a = 1, *b=&a, **c=&b, ***d=&c;
    printf("%d %d %d %d\n", a, *b, **c, ***d);

    my $a = 1; my $b=\$a; my $c=\$b; my $d=\$c;
    printf("%d %d %d %d\n", $a, $$b, $$$c, $$$$d);
Perl even stole C's pointer syntax to make working with collections nice:

    my $a = [1,2,3];
    printf("%d\n", $a->[0]);

Re: Why Perl Didn't Win

#69

Earlier quoted context omitted.

> List aList = Arrays.asList( new int [] { 1, 3, 5 }); You can drop the inner array, asList takes variable number of arguments. > // I need to check if Java 8 has map literals a la Groovy... Sadly not, IIRC they've backed off from literals towards a Guava style static factory methods, which I'm not thrilled about. > I'm not seeing that much of a difference in parameter passing, other than the explicit reference/deref…

> Except now, I have two ways of working with Perl's collections, two separate sets of sigils, and all because I wanted to pass two collections into a function and Perl treats function arguments as a collection, and Perl implicitly flattens collections. It's not really two sets of sigils, it's two concepts: "collection", and "pointer to collection". I guess coming from C that didn't bother me too much—once it sunk th…

[deleted]
Post reply on HN