Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: The perils of being tricky

by mstone (Deacon)
on Jun 04, 2005 at 19:12 UTC ( [id://463571]=note: print w/replies, xml ) Need Help??


in reply to Re: The perils of being tricky
in thread The perils of being tricky

You don't have warnings turned on, do you?

Not for the quick and dirty stuff. I use -w and strict at specific points in my development process, but usually I stick to techniques that I know to be clean.

It's probably just a personal thing, but I find that constantly using warnings is worse for me than checking my work at intervals. If I get a warning during continuous use, I just correct it and move on. My primary goal at that point is to make sure my latest piece of code produces the result that I want. When I use warnings at intervals, each warning pass is a specific test of the code's integrity. My only concern at that point is whether the code is clean, so I take the time to find ways to make sure my code stays clean in the future.

Mistakes like this one show me when I'm playing with things I shouldn't play with at all. If I need mechanical assitance to write a piece of code correctly, I probably won't be able to read it six weeks from now. And IMO, writing code that even I can't read without assistance is a problem. If I can't find a version that works, is clean, and is easy for me to remember, I write the technique off as being too tricky and look for other solutions.

Replies are listed 'Best First'.
Re^3: The perils of being tricky
by kaif (Friar) on Jun 04, 2005 at 19:24 UTC

    However, the +(..) "trick" is very well-known and comes up very often (for me at least). It's documented in perlop and is worth knowing.

    Cool trick, though!

      However, the +(..) "trick" is very well-known ...

      No arguments there, and if you're used to it, by all means run with it. That just means it's part of your personal style.

      Me, I prefer not to think about syntax precendence if I can avoid it. That isn't a 'better' way of looking at things, it just means we have different regional dialects. ;-)

Re^3: The perils of being tricky
by gaal (Parson) on Jun 05, 2005 at 07:22 UTC
    That's like saying you only write code you know to be bug-free :-)

    I know I make mistakes all the time. That's why I use as much unintrusive help as I can get. I'm not making an ideology of sloppiness, of course, but I don't chastise myself unduly for things that can't be helped. Oh, perl found a problem in my code? My bad; let's move on.

    (Of course I'm a better coder now than I used to be. I do learn from my mistakes; I just try not to spend overly much time on the learning itself. Also, warnings in this case and in many like it would have saved you from a real trap.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://463571]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-25 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found