News for hackers. Stuff that matters.
Re:Show HN: Send a slack msg with AWS IoT button by Rjevski on Sunday July 30, 2017 @10:33AM (#14886096)
But why would you ever use such an awkward language to do this task?
Re:Show HN: Send a slack msg with AWS IoT button by tyingq on Sunday July 30, 2017 @10:40AM (#14886126)
Perl is actually not a bad choice for matching a Mac address, and invoking some external event. Why would it be awkward?
Re:Show HN: Send a slack msg with AWS IoT button by Rjevski on Sunday July 30, 2017 @10:44AM (#14886144)
Well it's more about the language being needlessly complicated and having 10x different ways to do the same thing, not to mention the language (Perl 5 that is - 6 is a different story) lacks essential concepts like object orientation and exceptions (you have to get "shims" like Moose or Try::Tiny from CPAN to fill those gaps). Why would you choose something like this instead of Python or Ruby?
Re:Show HN: Send a slack msg with AWS IoT button by tyingq on Sunday July 30, 2017 @10:52AM (#14886186)
>lacks essential concepts like object orientation and exceptions

Perl does OO without Moose. There is a tiny bit of boilerplate, but it's essentially bless() and 1 or 2 lines in the constructor.

Try/catch blocks are indeed an add on. The traditional pattern is more golang like, returning an error code, then using Carp or similar for stack traces.

>Why would you choose something like this instead of Python or Ruby?

That might be an interesting discussion for a large codebase, but for something limited in scope like this, I just don't see the problem.