Exceptions relieve the programmer of tedious writing boilerplate code -- without removing the semantics of said code -- and they allow the programmer to arrange the code so that error handling code is more separate from the main program logic.
@zebra24 : It's always helpful to have the regexp version for mass changes. Here's a few tricks to make that a little more palatable:
Very magic. eliminates lots of escaping by assuming the special nature of characters:
s/\v()/"\1"/g
Given that we're taking the whole match, we can skip the grouping, and since we aren't matching on the whole word we can skip the word-delimiters:
s/\v\w+/""/g
Which is something that I might actually stand to use instead of the manual method. Patterns full of backslashes, especially, make my eyes bleed. Cheers!
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
@zebra24 : It's always helpful to have the regexp version for mass changes. Here's a few tricks to make that a little more palatable:
Very magic. eliminates lots of escaping by assuming the special nature of characters:
Given that we're taking the whole match, we can skip the grouping, and since we aren't matching on the whole word we can skip the word-delimiters:
Which is something that I might actually stand to use instead of the manual method. Patterns full of backslashes, especially, make my eyes bleed. Cheers!
Reply To This Comment