4 ms·
This is a new fad and it undoubtedly leads to more maintainable code, but it still feels like a bad tradeoff to me: you get the verbosity of stricter languages
by lazyjones 14y ago
This is a new fad and it undoubtedly leads to more maintainable code, but it still feels like a bad tradeoff to me: you get the verbosity of stricter languages without the benefit (compile-time errors) at worse performance than plain Perl. I'd rather write something new in Scala or Go nowdays than in strict "modern Perl" style / Moose (and I've used Perl almost exclusively for the past 13 years).
- singingfish 14y agoumm, verbosity? package Point; use Moose; # automatically turns on strict and warnings has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int'); sub clear { my $self = shift; $self->$_(0) for qw/x y/} 1;
- colomon 14y agoVerbosity. class Point { has Int $.x is rw; has Int $.y is rw; method clear() { $.x = 0; $.y = 0; } } :)
- dkoch 14y agoPerl 6 is / will be sweet :)
- colomon 14y agoPerl 6 is sweet, and will be sweeter when it has better performance. :)
- deleted 14y ago[deleted]
- singingfish 14y agoLooks like a noble attempt to remove perl5 and ruby pain in the arse points simultaneously. Wonder if it will ever come to anything ...?
- draegtun 14y agoPerl 5.18 may have the following: use mop; class Point { has $x = 0; has $y = 0; method clear { ($x, $y) = (0, 0) } } ref: https://github.com/stevan/p5-mop/blob/master/t/000-examples/001-basic-example.t https://github.com/stevan/p5-mop/blob/master/t/000-examples/...