In our team meeting today a senior member brought up the proposal that we should be having a common location/structure for our development solutions.
A couple of his points were:
- Making it common meant when talking about projects and emailing stuff everyone is on the same wavelength and knows where to look.
- If there is ever the need to hard code a location path then it will work across all developers pc’s.
He had a more few points to back up his suggestion but I unfortunately got distracted during the discussion and so didn’t hear all of them. I have no issue with the idea and can see it’s merits but I was wondering if it is common or even recommended that all developers place their code in the same folder structure. Or do developers like to have the flexibility of location solutions where-ever they want? We currently use SVN for our version control.
In this case his recommendation was to place all code in:
c:WorkDevelopment<Customer><project>Code<solution> the code
I guess actual path is irrelevant for this question but added for completeness.
0
I would suggest you not enforce or enact such a standard because the only benefit will be that it allows you to hide problems in the code base where everything works using this hard coded path right up until the program is deployed to a clients site and they keep getting an error
FileNotFoundException 'c:workDevelopment...
People say it will help building the system because you can hard code these paths, but what you end up with when you have hard coded stuff in your build system is a slow-growth of fixed garbage making it harder for you to restructure or refactor your system. Ultimately these hard-coded bits in build systems always have to be replaced over time, and are unnecessary.
So there’s one risk, and the potential benefits are exactly ? I’ve seen this tried at places I’ve worked and I have seen these errors crop up and I have yet to see a single benefit whatsoever in those places…
I’d say that the developer’s particular set-up is down to the developer. I’m not sure if I agree with the “everyone being on the same wavelength idea” – it seems a little vague to me, and this has never been brought up at any company I have ever worked at. But none of that particularly mattered to me, until I read this:
If there is ever the need to hard code a location path then it will work across all developers pc’s.
I have never found the need to hard-code a location path, aside from in prototype code, which would never normally get committed (or at least not to the shared development branch). Every standard programming language library should have a method to get the location of the currently executing binary.
Sometimes, that’s just not possible, like a document store for a web application for example. In which case, you can use a configuration file to direct your application to the correct location. Once again, most standard programming language libraries will have something appropriate to solve this issue with minimal fuss.
Hard-coding paths will only lead to issues later on. What if your application will be deployed to a server which has it’s massive RAID array on the D: drive? Will you maintain two separate branches for this? Will you remember to edit a source file every time you deploy a new version? I’d be very interested to hear about a use case that would demand this.
1
I don’t think it really matters where a given developer’s working set goes. The source control system can still keep track of it. Visual Studio puts them in
c:documents and settings<user name>My DocumentsVisual Studio 20xxSolution folder
Where <user name>
differs for each developer machine.
2