in reply to Re^4: Adding Unique Elements to Array
in thread Adding Unique Elements to Array

My only argument was to show some sort of precedence, benchmark results and optional ways of doing things. Of course there are going to be sub-optimal ways of doing things, balancing out clarity and performance. I think it is inappropriate to charge either of those with "cargo cultism" or "micro-optimization".

The two ways presented were simply options at the disposal of the user. I agree undocumented or obfuscated code should be used with care or not at all, however I also know plenty of people that tend away from "use strict". To each their own.
--------------
It's sad that a family can be torn apart by such a such a simple thing as a pack of wild dogs

Replies are listed 'Best First'.
Re^6: Adding Unique Elements to Array
by Roy Johnson (Monsignor) on Mar 01, 2005 at 14:05 UTC
    When I pointed out that your examples were not good code, your response was to direct me, without further explanation, to another post which had recommended the same thing based on a slight speed advantage. So I had to surmise your reasoning: if you were defending the code based on the fact that someone else did it, it's cargo cultism; if you were defending the code based on the slight speed advantage, it's micro-optimization.

    The OP's question indicates a low level of experience (it is in the FAQ, after all -- perldoc -q duplicate). Novices especially need to be given good examples. You can't just throw bad examples at them without any warning. They don't have the experience they need to be able to judge for themselves.

    If you didn't realize that they were bad examples, well, that's why we have the ability to respond. Everybody throws out bad answers once in a while, and having them corrected is a Good Thing.


    Caution: Contents may have been coded under pressure.