You are not logged in.

#1 2010-04-27 11:19:39

Natook
Member
Registered: 2010-04-27
Posts: 2

Programming and Linux

Hi!

I've just set up my eee 901 to use Arch Linux (with lots of help from the awesome wiki and forums) and I'm ready to get programming on it.

Now I'm wondering if there is a recommend way or convention to set up folders, projects, and so on on Linux.

I'll be coding in ruby (for the first time) and java (which I'm used to).

Offline

#2 2010-04-27 11:22:24

Zeist
Arch Linux f@h Team Member
Registered: 2008-07-04
Posts: 532

Re: Programming and Linux

My only recommendation is to use a version control system like for example git even on random personal projects. It makes life a lot easier.


I haven't lost my mind; I have a tape back-up somewhere.
Twitter

Offline

#3 2010-04-27 11:51:19

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Programming and Linux

I definately second the recommendation for using a VCS.  If you haven't already, I also recommend becoming at least vaguely familiar with a capable text-editor (vim and emacs are the usual candidates).

For directory structure I have a 'projects' subdirectory under ~/, which is further subdivided into the name of each project.  From their the structure is whatever is suitable for the type of project and language (to an extent) you'll be working with.  I'm not familiar with ruby or java so I'm not sure whether their are any strict conventions used there.  Anyway, if the directory structure is self-exlanatory, it's probably fine.

Once a project reaches a certain size, you may also want to consider using a build-system of some sort.  I suspect rake may be a convention for programs implemented in ruby; java I'm not sure about.

Offline

#4 2010-04-27 12:46:38

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: Programming and Linux

Isn't a tiling window manager supposed to be helpful for programming, too?


no place like /home
github

Offline

#5 2010-04-27 12:59:54

Zeist
Arch Linux f@h Team Member
Registered: 2008-07-04
Posts: 532

Re: Programming and Linux

demian wrote:

Isn't a tiling window manager supposed to be helpful for programming, too?

Depending on your development environment it can be. I find it quite helpful.


I haven't lost my mind; I have a tape back-up somewhere.
Twitter

Offline

#6 2010-04-27 13:08:13

JezdziecBezNicka
Member
From: Cracow, Poland
Registered: 2009-12-03
Posts: 89

Re: Programming and Linux

As for folders - each git repo (i.e. each project) should in a separate directory, but you don't need to create additional sub-directories for any branches of that project (git stores them internally and lets you swich from one to another).

I have "~/doc/projects/#{project_name}"

For ruby, use emacs, jedit etc. For java, please use eclipse or netbeans; writing java in vim is like using scissors to chop wood...


This is my signature. If you want to read it, first you need to agree to the EULA.

Offline

#7 2010-04-27 14:17:58

losl
Member
Registered: 2009-10-25
Posts: 25

Re: Programming and Linux

A tiling window manager would be good for you because it maximizes the amount of space on your screen.

If you want to get things done well, use a VCS like git. Learn how to branch your projects effectively. I found that Understanding Git Conceptually is really helpful to get started with git.

Offline

#8 2010-04-27 14:53:10

alexandrite
Member
Registered: 2009-03-27
Posts: 326

Re: Programming and Linux

demian wrote:

Isn't a tiling window manager supposed to be helpful for programming, too?

I have found that to be the case.  It's quite nice to have your editor/terminal (or ide I guess) nicely, automatically laid out next to a web browser or man page terminal.  I definitely recommend it.

As for some of the OT's questions, if I were you I would make one directory for projects and then give each project a directory inside that one.   That should keep everything organized, and your VCS and stuff will appreciate only seeing the files that are a part of your project. 

For complex projects, more subdirectories may be nice.  Like a src/ for the code itself, then maybe share/[project name] for extra resources etc.  After all, if you actually complete something, I'll bet you'd like to package it sometime, and it would be nice to do that without having to change a bunch of path names and stuff in your code.

Last edited by alexandrite (2010-04-27 14:59:28)

Offline

#9 2010-04-27 19:56:44

Natook
Member
Registered: 2010-04-27
Posts: 2

Re: Programming and Linux

Ok, so

Project directory - check
vim (with pretty colorscheme...) - check
Eclipse - check
tiling window manager - Hm, I need to read up on that one. I've chosen FluxBox as window manager for now
Git - Good idea. I just need to think of a place to keep a repository

Thank you kindly for your tips!

Offline

#10 2010-04-27 21:28:08

Peanut
Member
From: Norway
Registered: 2009-05-24
Posts: 99

Re: Programming and Linux

Natook wrote:

Git - Good idea. I just need to think of a place to keep a repository

You don't need a separate repository.

Git is a fully decentralized version control system, meaning that instead of having a server/client-setup (like subversion), every copy of the Git repository (the "working copy") comes with the full history of the repository, and is in itself a valid Git repository.

You should therefore just setup your project folder to be your local git repository, and just commit locally.

If you still want to commit to a server (to share your code with other people/machines, or as a safety backup), check out github.

Offline

#11 2010-04-27 21:57:16

Peanut
Member
From: Norway
Registered: 2009-05-24
Posts: 99

Re: Programming and Linux

By the way, if you're looking for a place to start... A simple man gittutorial, alternatively available on-line, will teach you the basics you need in less than 15 minutes.

After that, make sure you check out the Git Community Book, which is an excellent resource when it comes to learning more about Git. At least chapters 3 (Basic Usage) to 4.1 (Ignoring files) are quite essential smile

Offline

#12 2010-04-27 22:31:27

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: Programming and Linux

Natook wrote:

Eclipse - check

Not knocking down your choice in using an IDE, but if you have vim, why use eclipse? You can compile java with javac.

Offline

#13 2010-04-27 22:47:03

Horris
Member
Registered: 2009-04-05
Posts: 30

Re: Programming and Linux

Berticus wrote:
Natook wrote:

Eclipse - check

Not knocking down your choice in using an IDE, but if you have vim, why use eclipse? You can compile java with javac.

Why use Eclipse??

If you have to develop a big project (with more than a few classes, I'm talking about a project composed by several projects) your choice is a IDE like Eclipse or NetBeans.
Is impossible handle only with vim + javac.

Besides code completion, quick fixes and so...

Offline

#14 2010-04-28 01:45:47

mongrol
Member
Registered: 2010-01-06
Posts: 31

Re: Programming and Linux

I code on my Netbook several times a week at lunchtime and on the bus home. I use following.

* Project folder ~/dev/<projectname>
* wmii (tiling wm, fantastic on netbook)
* wim with Taglist, Omnicppcomplete and Darkburn theme
* RapidSVN client for version control. My code is held on googlecode.
* cmake/make/gdb for building.

My workflow is simple. Boot in wmii, alt+enter brings up terminal in my src folder already. then vim <file.cpp>. I then use :tabe in vim to open multiple files.
For building I have use cmake for cross platform (I use a Mac at home). So alt+enter to bring up another terminal alt+s ot use Stack Window mode then type "make", then ./tractionedge (my executable). Flip back to vim using alt+k.

I also have a script that launchs a documentation from cppreference.com in firefox when I need docs. It's very efficient and wouldn't even think about using a GUI IDE on a netbook. Eclipse would be horrible on a 1024x600 screen.

Offline

#15 2010-04-28 03:16:54

alexandrite
Member
Registered: 2009-03-27
Posts: 326

Re: Programming and Linux

@Horris: Vim can do code completion.  I do agree you should use an IDE for something that complex, but I just felt I should mention that.  A lot of people underestimate vim's capabilities.


@OP: I would suggest wmii for your window manager.  It's a bit simpler than most of the other dynamic tilers, but still allows you all the control you might want.

Offline

#16 2010-04-28 10:56:22

BlackIkeEagle
Package Maintainer (PM)
From: Belgium
Registered: 2008-09-24
Posts: 78

Re: Programming and Linux

i would say vim and some plugins is all you ever need

enable omni-completion in vim <C-X><C-O>

NERD_tree
Tlist
minibuffexplorer

nice colorsheme, and done


- Arch64 / Arch32 -- Desktops & Mediacenters & Laptops & home Servers
- MyAUR
- MyArchWiki
- pgp key: 0x796CA067

Offline

Board footer

Powered by FluxBB