Re: Bind Module for Perl



Jens Luedicke <jens luedicke gmail com> writes:

I recently started to do some Perl hacking again and missed a few
syntactic notations I knew from C++.

FWIW, those notations exist in C++ mostly because the language doesn't
have proper closures, which Perl does have.

The syntax is basically the same. My approach is just a little
different (maybe with a little more overhead). The syntax offered by
Class::bind is probably more readable (which is very important to me).

Readability is important. However, you might want to consider that a
very fundamental feature of the Perl language is quite likely to be
*much* more readable to Perl programmers than a module reinventing that
feature so one can do the same thing with different syntax.

If your module helps you write and understand your code better, that's
cool. But maybe you also want to consider getting used to Perl idioms if
you want to write Perl. It'll make life easier both for you when trying
to understand other's code, as well as yourself, when ever being faced
with contributors to your project that don't happen to have strong roots
in the C++ world.


Also note that there's various modules similar to yours on CPAN that
implement some more advanced features that are not as easy as they could
be with plain closures. Sub::Curry and Sub::Curried come to mind, and
I'm sure there's more.

Attachment: pgpemNoHBH1qR.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]