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.

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
    
What does "MAC" stand for? –  todofixthis Feb 26 '12 at 23:25
1  
No idea why this has been voted to be closed twice. It's a perfectly legitimate question. –  LiamB Feb 28 '12 at 9:49
add comment

1 Answer

up vote 7 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
add comment

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.