Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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:

  1. Making it common meant when talking about projects and emailing stuff everyone is on the same wavelength and knows where to look.
  2. 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:\Work\Development\<Customer>\<project>\Code\<solution>\ the code

I guess actual path is irrelevant for this question but added for completeness.

share|improve this question

3 Answers 3

up vote 4 down vote accepted

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:\work\Development\...

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...

share|improve this answer

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.

share|improve this answer
    
+1 for "Hard-coding paths will only lead to issues". I'd say it's a recipe for disaster, as it may cause hard-to-diagnose bugs and introduces a dependency to a certain setup that may not be present. –  sleske Dec 5 '12 at 11:21

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 Documents\Visual Studio 20xx\Solution folder

Where <user name> differs for each developer machine.

share|improve this answer
    
Thanks. I think his point was more around if there are scripts, references to other projects etc then having development in the same structure would help mitigate any problems. –  dreza Dec 4 '12 at 23:06
2  
Any references to scripts can be made flexible by using a relative path such as .\scripts (derived from the Solution folder), rather than a fixed path. –  Robert Harvey Dec 5 '12 at 1:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.