<E.P.Sporgersi> wrote:
> On Sat, 15 Dec 2012 02:24:16 +0000, Peter Corlett wrote:
>> Although if you were a Python programmer---or at least anything like the
>> ones I've met---you would assert that the language is perfect and therefore
>> programs in it are by definition elegant and contain no bugs.
> Being forced to learn that at the moment, for more or less precisely that
> reason. I wish that some of the Pythonites would come to recognise that if
> they feel moved to write the words "But you shouldn't want to do that
> anyway", it means that they probably didn't understand the question.
I find that Python is much improved if you ignore its community. You are likely
to get a more sensible answer if you asked a veteran Perl hacker. Although the
answer is just as likely to recommend a *third* language more appropriate to
your problem domain than to suggest a particular CPAN module.
> Like the one on FgnpxBiresybj who, when asked how one might pass an object to
> a function by reference, started a long treatise on why references are evil
> and should be avoided at all costs.
That's two people who don't understand Python's calling mechanism. Did somebody
point out that it's call-by-value, but what one thinks as an object in a
variable is actually a reference to an anonymous object, and so it looks and
works like call-by-reference to the uninitiated? And if so, how large was the
resulting mess due to exploded brains?
I can definitely get behind some of the sentiment after having seen some rather
exciting action-at-a-distance bugs caused by a rookie programmer in Java
reusing a POD object passed to a library rather than allocating a new one such
that the "old" object kept changing in sympathy with the "new" one, and also
see the point-of-view of those weirdoes who advocate functional programming
because it makes a whole class of pointer aliasing problems go away. But since
the day job usually involves writing Perl, I prefer to write defensive code
that isn't utter drivel rather than blindly follow arbitrary rules as to which
language features I should use.
I think my favourite daft rule was one site that wanted me to iterate over
*huge* datasets, which were best modelled as (tied) hashes, but I was not
permitted to use each() because they were once bitten by a misunderstanding as
to how it worked. Yes, each() is fundamentally broken. No, that doesn't mean it
should never be used.