Considering the number of code problems strictures and warnings can help alleviate or eliminate, some won't answer questions or offer help regarding code which is written without them. Is that a good enough reason to convince people to use them?
Re^5: Avoiding silly programming mistakes
Replies are listed 'Best First'.
If people don't want to answer questions, then don't answer them. Don't answer them with answers that don't help to solve the problem; that's just clutter, and clutter reduces usefulness. Specially clutter that's found over and over and over again. If you can't contribute towards a useful answer, and you can't stop the urge to scribble something in the textbox and hit the "create" button, at least be original. Don't be Borg.
If you ask for directions in a city where you are unfamiliar, would you welcome answers that say "you're better off wearing seat belts"? Over and over again? Regardless whether you are wearing them or not, it's not a useful answer.
The OP was about avoiding silly programming mistakes. The responses given do that. The OP has since clarified the question, but that doesn't change the usefulness of the initial responses.
I use Perl in order to avoid classes of potential errors, such as dangling pointers. I use certain modules (such as DBI) to avoid other classes of potential errors (such as SQL injection). Then, there are the ways to improve using Perl to avoid other classes of errors (such as = in a conditional test vs. ==). After that, there is experience which is what the OP was attempting to ask for. That's what my response addresses.
As for this thread . . . have you ever tried to explain something to someone 10 years younger than you? That feeling of "Why can't you just understand the deeper subtleties" is what we're feeling right now with regards to your responses.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
So you're homeless and you walk up to a soup kitchen. You ask "Can I have something to eat, it would solve my hunger problem.". They hand you potato soup. You reply "I don't like potato soup".
There response is "Potato soup is high in calories and our nutritionist says it's the best food for someone in your situation. We've chosen this as the best food and everyone else seems to like it."
You may not like it. It may not be what you were looking for. But many people have thought about the problem longer than you have and they have come up with a good solution.
If you would like to add to the menu, that is great. If people like it they'll do it. But complaining about volunteer help with strawmen (seatbelt analogy) and ad hominem (borg comment) attacks is pointless.
What are your strategies for avoiding those 'doh' moments? ...are there things I could do now to reduce the number of silly mistakes I make?
-- not how to avoid object destructor confusion which is a solved issue. use strict and use warnings might be a bit trite but it is the best advice to a newbie who asks for newbie advice, not "use 4-arg substr instead of lvalue substr" or almost any of the rest of the PBP. Which for the most part would not be good advice but showing off.