When defining a path to a directory as a variable or constant, should it end with a trailing slash? What is the convention?
pwd in Unix shows your curre
I know this is an old thread but I thought I'd share what I do. If possible, I'd normally allow for both and do something like this (if it was PHP):
$fullPath = rtrim($directory, '/') . '/filename.txt');
That way, if the directory is defined in a config file, it doesn't matter whether the next person to change it includes the trailing slash or not.