in reply to Re: Module Bloat and the Best Solution
in thread Module Bloat and the Best Solution

To further emphasize this point, there are a number of edge-cases that most programmers will never encounter, even in such a "simple" problem as unique-ing a list. For example, undef and "" will both be treated the same way, which may not be appropriate. Two-faced scalars may not be handled correctly. Objects and references will certainly not be handled correctly. A library, on the other hand, can solve this problem without you even needing to know that the edge-cases existed. That is the big win.

(Note: This isn't to say that the library always does it right. The version of uniq() in List::MoreUtils doesn't handle two-faced scalars correctly, but it does handle objects and references correctly, as expected.)


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re^2: Module Bloat and the Best Solution

Replies are listed 'Best First'.
Re^3: Module Bloat and the Best Solution
by oxone (Friar) on Nov 09, 2007 at 16:17 UTC
    >>A library, on the other hand, can solve this problem without you even needing to know that the edge-cases existed<<

    Unfortunately you can never take it on trust that any given library *will*, so it's still really down to you to try and think of all the edge cases, test them, and then possibly fix them. Sounds like your own example bears this out.

      I think you mean "you and everyone else who uses the library and could possibly run into the same bug", which is a rather different point.