in reply to There is no wrong way-and there is no right way either.

I believe that there is no the wrong way, and no the right way to do something. There are several right ways to do something, and equally as many wrong ways. Some ways are more right or wrong than others.

Simply "getting the job done" isn't enough to qualify for righthood. What if you wrote a CGI to verify credit card transactions, and it worked great, passing every test case flawlessly, but it took three hours per run? Sure, it works, and it gets the job done, but I'd call that a wrong way.

I'd also have issues with code that works well and quickly, but is so obfuscated that even the guy who wrote it six months ago can't make sense of it.

Others have already mentioned security issues, as well.

There are many approaches to most problems, and some are better than others. In most cases, it's true that there is no single solitary correct way to do something. But most solutions can be viewed as (if you dislike the terms "Right" and "Wrong") "Good" or "Bad".

It all comes down to your criteria for goodness. If you're writing a quick half-pager to do some file maintenance chore, and you're just going to be running it yourself, and only once, then sure. Skip taint checks and -w, and if it takes an hour, who cares. That sort of thing might ingrain some bad habits into you that'll affect your next production program, though...

"Getting the job done" depends on what exactly that job is. More often than not, the scope is a lot bigger than you think. That one-off program will turn out to be handy next time you have a similar task, so you'll hack a bit to add a feature, then the guy down the hall mentions something that he could use it for, so you pass it along and he hacks a bit. And so on, until finally that little one-off program turns into a tangled 30-page behemoth that the entire company's web site relies on, and it's still not using taint checks...

Code always lives longer than intended. If you don't believe me, ask the COBOL guys who got called out of retirement for that little Y2K issue.

There's More Than One Way To Do It. But Some Ways Are Better Than Others. And Other Ways Are Just Plain Stupid.
(darn, a bit wide for a t-shirt)

---
I'm too sexy for my .sig.