Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > perl.perl6.language > #5655
| Newsgroups | perl.perl6.language |
|---|---|
| Date | 2015-10-12 15:41 +0200 |
| Subject | To :D or not to :D |
| Message-ID | <20151012134136.GE3111@moon.overmeer.net> (permalink) |
| Organization | MARKOV Solutions |
| From | mark@overmeer.net (Mark Overmeer) |
Hi all,
Liz and Tux demonstrate powerful Perl6 code at each monthly meeting of
our Mongers in Amsterdam. Looking at their examples, I collected a few
questions of which I want to discuss the first one in this thread.
When I look at Merijns (Tux') code, I see a huge number of :D attributes.
https://github.com/Tux/CSV/blob/master/lib/Text/CSV.pm
Close to all scalar positional parameter (51x) carry the :D flag. I count
only 3 where the parameter does accept undef and the method is able to
handle it. I count another 3 where the :D is missing, but the method is
not able the handle it.
The same for examples Liz shows us in our core code: most scalar
positional parameters have :D.
Writing a sub which is able to handle undef is usually more work than
implementing "I expect sane values for all of the parameters".
Questions:
. are they using :D correctly?
. the simpelest code does not handle the undef case... but now needs
the more complex prototype to be correct.
. it feels like the wrong default: usually you have to do something
extra for the unusual cases, not the 90%+ usual cases.
. :D looks really ugly, don't you think? Try to explain to students
to add this smiley everywhere.
Can someone explain this to me? (Or point me to the correct place)
--
Thanks in advance
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark@Overmeer.net solutions@overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
Back to perl.perl6.language | Previous | Next — Next in thread | Find similar
To :D or not to :D mark@overmeer.net (Mark Overmeer) - 2015-10-12 15:41 +0200
Re: To :D or not to :D moritz@faui2k3.org (Moritz Lenz) - 2015-10-12 17:32 +0200
Re: To :D or not to :D mark@overmeer.net (Mark Overmeer) - 2015-10-12 21:51 +0200
Re: To :D or not to :D pmichaud@pobox.com ("Patrick R. Michaud") - 2015-10-12 15:25 -0500
Re: To :D or not to :D darren@darrenduncan.net (Darren Duncan) - 2015-10-12 13:30 -0700
Re: To :D or not to :D solutions@overmeer.net (Mark Overmeer) - 2015-10-13 00:32 +0200
Re: To :D or not to :D pmichaud@pobox.com ("Patrick R. Michaud") - 2015-10-12 20:05 -0500
Re: To :D or not to :D mark@overmeer.net (Mark Overmeer) - 2015-10-14 13:37 +0200
Re: To :D or not to :D email@froggs.de (Tobias Leich) - 2015-10-14 14:11 +0200
Re: To :D or not to :D moritz@faui2k3.org (Moritz Lenz) - 2015-10-13 09:17 +0200
Re: To :D or not to :D mark@overmeer.net (Mark Overmeer) - 2015-10-13 10:41 +0200
Backwards compatibility and release 1.0 rnhainsworth@gmail.com (Richard Hainsworth) - 2015-10-13 16:52 +0800
Re: Backwards compatibility and release 1.0 darren@darrenduncan.net (Darren Duncan) - 2015-10-13 15:33 -0700
Re: Backwards compatibility and release 1.0 moritz@faui2k3.org (Moritz Lenz) - 2015-10-14 11:54 +0200
Re: Backwards compatibility and release 1.0 mark@overmeer.net (Mark Overmeer) - 2015-10-14 12:12 +0200
Exploit the versioning (was Re: Backwards compatibility and release 1.0) darren@darrenduncan.net (Darren Duncan) - 2015-10-14 04:04 -0700
Re: Backwards compatibility and release 1.0 Smylers@stripey.com (Smylers) - 2015-10-15 09:47 +0100
Re: Backwards compatibility and release 1.0 email@froggs.de (Tobias Leich) - 2015-10-15 11:06 +0200
Re: Backwards compatibility and release 1.0 liz@dijkmat.nl (Elizabeth Mattijsen) - 2015-10-15 12:42 +0200
Re: Backwards compatibility and release 1.0 mark@overmeer.net (Mark Overmeer) - 2015-10-15 12:57 +0200
Re: Backwards compatibility and release 1.0 liz@dijkmat.nl (Elizabeth Mattijsen) - 2015-10-15 13:13 +0200
Re: Backwards compatibility and release 1.0 moritz@faui2k3.org (Moritz Lenz) - 2015-10-15 14:13 +0200
Re: Backwards compatibility and release 1.0 rnhainsworth@gmail.com (Richard Hainsworth) - 2015-10-15 12:48 +0800
csiph-web