Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

2. Dynamic Web Pages > 5. Better Searching with Regular Expressions

Chapter 5. Better Searching with Regular Expressions

In the last chapter, you did one of the most common things programmers do: Write code that solves a problem, but is ugly, messy, and a little hard to understand. Unfortunately, most programmers leave code in that state because…well, it works.

Bad code is like sloppy plumbing or a poorly constructed house framing. At some point, things are going to go bad, and someone is going to have to fix problems. And, if you’ve ever had an electrician tell you what they’ve got to charge you because of the guy who did it wrong before him, then you know how expensive it is to fix someone else’s mistakes.

But here’s the thing: even good code is going to fail at some point. Anytime you’ve got a system where humans are involved, someone will eventually do something unexpected, or maybe just something you never thought about dealing with when you wrote your code. And that’s when you’re the electrician, trying to fix things when the customer’s unhappy—but there’s nobody else to blame.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial