Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Yesterday, for the last day of The Perl Conference (formerly known as YAPC) in Glasgow, Scotland, Curtis "Ovid" Poe delivered a very inspiring keynote address on the future of Perl.
Ovid's idea was to imagine where Perl 5 would stand in ten years from now. These are some of the things Perl would have in 10 years in Ovid's vision:
This subroutine should work correctly if the subroutine is called with a positive integer, but a number of things could go wrong: what will happen if no parameter is passed to the subroutine? or if the parameter is a negative integer, say -3? or if the parameter is a positive number but not an integer, e.g. 3.14? or if the parameter is not a number but a string? (Note that there would also be a problem with a large integer, but that's a different story.) For the above subroutine to be correct, you would need to add probably half a dozen boiler plate code lines to guard against invalid input, for example maybe something like this:
With (non experimental) function signatures and proper typing, all you would need might just boil down to something like: I think this would look quite cleaner. I hope the video of Ovid's talk will on-line soon. Comments are welcome. Update (Aug 23): ovid created a new meditation explaining his views with some details here: Recap: The Future of Perl 5. In reply to The Future of Perl 5 by Laurent_R
|
|