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


in reply to Re: When my script doesn't work, I ...
in thread When my script doesn't work, I ...

I'm always surprised when I hear someone's used the Perl debugger. First of all, please don't mention debugger in assembler context. Because, well, in those days debugger tool was 'a-must-have tool'. Nowadays I think it is not.

In general case, you need a debugger to see a) control flow and b) variable state. In modern reality when it is simplier to edit script file and add some 'print' statements to see both (a) and (b) I see no need in debugger at all. Again: it is true only for high-level programming, for language interpretators, and possibly false for C language, for example. Especially for gcc -O2 =)

More deeply, I think it is a best practice to make -- as many as it is possible -- of your functions to be side-effect free and test them using QuickCheck (haskell), PropEr (Erlang) and mix it up with unit testing, Test::More at least. And again, the state of variable data you can always print out turning on some 'DEBUG' macro or alike.

Please nota bene -- I have no intention to offend you. And I, for sure, can be wrong.