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.

I've started toying with some Mac development and wonder where the best place to store the code is?

Generally on my windows box, I'd store all my code in c:\Code\

On the Mac it's in /Users/Liam/Code/

Will this cause me any issue with permissions when running web code?

share|improve this question

closed as primarily opinion-based by GlenH7, Snowman, MichaelT, durron597, enderland Jun 25 at 14:35

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

    
What does "MAC" stand for? –  user34530 Feb 26 '12 at 23:25
2  
No idea why this has been voted to be closed twice. It's a perfectly legitimate question. –  LiamB Feb 28 '12 at 9:49

1 Answer 1

up vote 9 down vote accepted

Your home directory is a great place to store your code on a Mac/Ubuntu (Linux based system).
I would still create sub directories under it as appropriate. I usually organize by project, with a few extra directories for whatever, e.g.

/home/myname/project_pear  
/home/myname/project_pear/upgrade/  
/home/myname/random_java_code  
/home/myname/Dropbox/my_open_source_awesome_project  

The other thing I do which is really "big" for me is to create aliases in .bash_rc (Ubuntu) or .bash_profile (Mac). I have so many now I put them in a separate file called .bash_aliases. (which I keep on Dropbox of course...) and include it with:

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

For instance, for the above, I might create a 'mup' alias that does a cd /home/myname/project_pear/upgrade, then I can just type mup at the command line to do that long cd!

Another hint - when you copy working code into a unix based system, you will often find that executable say 'insufficent permission'. However you can frequently fix that with chmod +x filename (modify the file so that is has eXecute permission.

share|improve this answer
    
This is great, thanks for the tip on the Bash_Aliases. I found on a mac if I go - alias code="cd /Users/Liam/Code/" i now map Code straight to my Code directory. –  LiamB Feb 26 '12 at 20:43

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