February 2013
Intermediate to advanced
258 pages
7h 26m
English
A crippling file path is one that immobilizes your code, preventing it from running on anybody else’s computer but yours. We all know this problem. I’d be surprised if you’ve never looked at a piece of code and said, “We shouldn’t hardcode that path here,” knowing that the explicit reference to a certain location in the filesystem is going to come back to haunt you later.
Regardless of how well-known this code smell is, it’s surprisingly common. Furthermore, there’s more than one way to cripple your mobility with file paths, so let’s take a look at an example that lets us explore some of them.
The following example shows a simple test case that reads a document from the file-system using an absolute file ...
Read now
Unlock full access