http://qs321.pair.com?node_id=998921


in reply to Re^2: How do you find keys of a Blessed Hash?
in thread How do you find keys of a Blessed Hash?

I upvoted you on the level 2 reply to Corion for having the honesty to express your frustration and because it triggered a superb answer by Corion.

I want to stress and double stress the truth of what Corion is saying: stripping down your code to the smallest bit is time consuming work, but it is still ESSENTIAL. If you have truly found a bug in Perl, then the maintainers need to know the smallest set of circumstances that cause it. This helps them quickly identify where in the Perl codebase the code relevant to creating the bug lives.

Stripping down code without disrupting a bug is an artform and sometimes requires great skill. In a way it is catch-22 for "young" (professionally speaking) Perl coders : if you had the skill and understanding of codeflow and syntax to do the stripping down you might not need help figuring out the bug in the first place.

Sometimes the good monks here can address that issue by asking people to post code, but that only works if they are doing small programs with few outside influences. Even if a newbee can't see where the codeflow or data initialization has gone wrong, a more experienced eye can. That's why we ask people to post code.

But as you point out, this is not the situation for you. Your programs aren't small and they have lots of outside influences (third party libraries). This leaves us with two possibilities: (a) you can strip it down and won't take the time (b) you are trying to write code that outstrips your mastery of Perl.

As a general rule, if one is writing code that is too complex for one to strip down on one's own to the smallest bit that reproduces the bug, then one is probably writing code beyond one's skill level in that particular language. Just as kids shouldn't swim beyond where they can swim back, or climb jungle gyms and trees beyond the point where they can get themselves down, one shouldn't aspire to write and design programs beyond the point one can independently strip down code to the smallest segment that reproduces the bug.

Assuming you are a good soul and not lazy, that leaves me with the thought that perhaps you are overreaching your skill with some of the programs you are trying to write. You may be a top notch C++ coder and can do fancy algorithm dances in C++ or Algol or Ruby or whatever, but each language has its own idiom and debugging assumptions. Perhaps you might want to consider working on more simple programs in Perl until you've become more skilled at isolating and reproducing bugs in small code snippets?