Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The overall trend is Perl died everywhere.

Huh? Is that offering a false choice between total dominance and death?

> Perl has positives, Perl's weirdnesses have positives.

I am not going to generally argue for one language over another. Most languages have good and bad, and a learning curve to doing things right. Perl has a learning curve too, and while there is more than one way to do it, that doesn't mean that every way is equally maintainable over time.

When I look at languages I can do interesting things with, Perl is at the top of my list along with Lisp, Rebol, and Red. These languages have a degree of mutability in the language which allows you to do things that might otherwise not be particularly possible. There's a strong lisp heritage that runs through the entire set.

Now consider something like this:

     package My::class;
     use PGObject::Util::DBMethod;

     use Moo;
     with 'My::PGObject::SimpleRoleWrapper';

     has foo => (is => 'ro', required => 1);
     has bar => (is => 'rw', required => 0);

     dbmethod foobar => (funcname => 'foobar',
                       funcschema => 'myclass');

     dbmethod save_new => (funcname => 'save', 
                         funcprefix => 'foobar_',
                         funcshema  => 'public',
                       strict_args  => { bar => undef });
What this would do is create a class with two properties (foo and bar), and two methods. The methods are delegated to stored procedures, and properties mapped into procedural arguments by name (the second example overwrites $self->bar with undef). I have created a class that does something with only declarative code. The code is neat, clean, understandable, and predictable. Again I could build something like this in Rebol or (once there is Pg support) Red, and this sort of thing could be done in Lisp too.

This gives Perl a lot of power, and once the framework is done, learning to code Perl in the framework (with or without Perl knowledge) has an easy learning curve. The code is easily maintainable and it is robust.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: