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
Maybe you should think about what your decision would mean for files. If you don't include the trailing slash at the end of a directory name you'll have to add it to the start of the file name.
Now, if for some reason, the path leading up to the file is missing when you concatenate strings, you end up with something like /filename which is not just a file but an absolute path from the root directory (wherever that may be in that context).
That's why I end my paths with a slash and keep files as files.