Click here to Skip to main content
15,896,201 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralThought of the Day Pin
OriginalGriff2-Aug-19 4:44
mveOriginalGriff2-Aug-19 4:44 
GeneralRe: Thought of the Day Pin
glennPattonWork32-Aug-19 4:46
professionalglennPattonWork32-Aug-19 4:46 
GeneralRe: Thought of the Day Pin
W Balboos, GHB2-Aug-19 5:23
W Balboos, GHB2-Aug-19 5:23 
QuestionRe: Thought of the Day Pin
lopatir2-Aug-19 5:31
lopatir2-Aug-19 5:31 
GeneralRe: Thought of the Day Pin
PIEBALDconsult2-Aug-19 5:36
mvePIEBALDconsult2-Aug-19 5:36 
GeneralRe: Thought of the Day Pin
Jacquers2-Aug-19 20:51
Jacquers2-Aug-19 20:51 
Generalwoot! Pin
honey the codewitch2-Aug-19 4:31
mvahoney the codewitch2-Aug-19 4:31 
GeneralWhere do you put your slashes? (coding styles) Pin
charlieg2-Aug-19 4:26
charlieg2-Aug-19 4:26 
My question is somewhat religious and definitely mundane compared to the guy who wants to write an OS in .net, but I live in the world of maintenance code. My bugaboo is consistency. Take a project of veteran developers (they each have their own style) add a few whiz kids (who have their own styles), add code standards that are pretty much ignored, and shake. The results can be mind-boggling. I've seen coding conventions deal with many issues, but I don't think I've seen one dealing with filenames and their construction. In the project I am re-factoring now, the file system is fixed. The primary folders in the root are fixed, so we have something like:

\root
application
backup
archives

I have a lot of code that builds file specifications including folder names. A great deal of concatenation, removing slashes, adding slashes and what not, it just begs for errors. So instead of something like this:

C++
#define ROOT_FOLDER L"\\root"
#define APP_FOLDER L"application"
#define BACKUP_FOLDER L"backup"
#define ARCHIVE_FOLDER L"archives"


and then constructing complete file specs, I re-factored to something like this:

C++
#define ROOT_FOLDER L"\\root"
#define APP_FOLDER L"\\root\\application"
#define BACKUP_FOLDER L"\\root\\backup"
#define ARCHIVE_FOLDER L"\\root\\archives"


and deleted as much string formatting code that I could. Then I got to thinking, maybe there should be a trailing slash as well - which led me here to ask how others like to do this...

Thoughts?
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...

"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

GeneralRe: Where do you put your slashes? (coding styles) Pin
W Balboos, GHB2-Aug-19 4:31
W Balboos, GHB2-Aug-19 4:31 
GeneralRe: Where do you put your slashes? (coding styles) Pin
charlieg2-Aug-19 6:40
charlieg2-Aug-19 6:40 
GeneralRe: Where do you put your slashes? (coding styles) Pin
  Forogar  2-Aug-19 4:34
professional  Forogar  2-Aug-19 4:34 
GeneralRe: Where do you put your slashes? (coding styles) Pin
honey the codewitch2-Aug-19 4:48
mvahoney the codewitch2-Aug-19 4:48 
GeneralRe: Where do you put your slashes? (coding styles) Pin
Sander Rossel2-Aug-19 4:52
professionalSander Rossel2-Aug-19 4:52 
GeneralRe: Where do you put your slashes? (coding styles) Pin
OriginalGriff2-Aug-19 5:08
mveOriginalGriff2-Aug-19 5:08 
GeneralRe: Where do you put your slashes? (coding styles) Pin
charlieg2-Aug-19 6:41
charlieg2-Aug-19 6:41 
GeneralRe: Where do you put your slashes? (coding styles) Pin
OriginalGriff2-Aug-19 8:00
mveOriginalGriff2-Aug-19 8:00 
GeneralRe: Where do you put your slashes? (coding styles) Pin
charlieg2-Aug-19 8:46
charlieg2-Aug-19 8:46 
GeneralRe: Where do you put your slashes? (coding styles) Pin
honey the codewitch2-Aug-19 4:47
mvahoney the codewitch2-Aug-19 4:47 
GeneralRe: Where do you put your slashes? (coding styles) Pin
Sander Rossel2-Aug-19 4:55
professionalSander Rossel2-Aug-19 4:55 
GeneralRe: Where do you put your slashes? (coding styles) Pin
honey the codewitch2-Aug-19 4:56
mvahoney the codewitch2-Aug-19 4:56 
GeneralRe: Where do you put your slashes? (coding styles) Pin
OriginalGriff2-Aug-19 5:09
mveOriginalGriff2-Aug-19 5:09 
GeneralRe: Where do you put your slashes? (coding styles) Pin
honey the codewitch2-Aug-19 5:23
mvahoney the codewitch2-Aug-19 5:23 
GeneralRe: Where do you put your slashes? (coding styles) Pin
OriginalGriff2-Aug-19 5:31
mveOriginalGriff2-Aug-19 5:31 
GeneralRe: Where do you put your slashes? (coding styles) Pin
W Balboos, GHB2-Aug-19 5:42
W Balboos, GHB2-Aug-19 5:42 
GeneralRe: Where do you put your slashes? (coding styles) Pin
honey the codewitch2-Aug-19 5:44
mvahoney the codewitch2-Aug-19 5:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.