Showing posts with label setup. Show all posts
Showing posts with label setup. Show all posts

Projects directory structure


Background

For a very long time, I was following a directory structure very similar to what many others do: there was a directly projects in my home directory, that contained a list of all projects I was or am working. Some projects weren’t trivial and contained multiple modules, but the structure of projects directly was very simple. Project by itself would hold the source code project inside.
However, the further I go with project, the more issue I have with this structuring approach:
  • Where should I put a documentation? Should it be next to the source code? Should it be in git?
  • What about various media that is related to the project but has nothing to do with source code?
  • What about the data, which also irrelevant to the source code, but important for data analysis?
  • and many other questions.
Although the questions are different, they actually about the same topic: where do I put files that are not related to the source code in any way?

Workspaces

And today I’ve realized, that the problem is due to my outdates approach to structuring files. It came from days where my responsibility was mostly coding project, and source code was a central for my work. And while the responsibilities changed, the approach stayed the same.

Nowadays, I need more than just source code for most of the projects. Except source code, I need to collect data, notes, documents, articles and posts. And instead of placing documents into $HOME/docs/$PROJECT and data into $HOME/data/$PROJECT and source code into $HOME/projects/$PROJECT, I better put everything into same folder. And I didn’t find a better name for this type of folders than workspace. 

And goal is to switch from structure
$HOME/projects
    project1/
        .git/
        module1/
        module2/
        pom.xml
        todo.txt
    project2/
to 
$HOME/workspaces
    workspace1/
        docs/
        data/
        dev/
            todo.txt
        source/
            .git/
            module1/
            module2/
            pom.xml
        charts/
    workspace2
        docs/
        ideas/
        source/

Versioning

And then I faced a new question – should I put a whole workspace under version system control? If docs and data and whatever other resources are important for the project, why shouldn’t those be versioned and kept safe and readily available using version control system, like Git?

“That is actually a good idea!” I though, “But it would be better to have different git repositories for each part of the workspace. As documents and code are changed at different times and for different reasons.”

And that’s the decision I’ve made – it is a good practice to use version control for all parts of the workspace, but do not put a whole workspace into a single repository. 

Workspace is just a collection of various resources coupled by the same topic. So it is ok to have a desire to keep workspace organized and reproducible – it should be easy to create a new workspace, that someone else can use if need. This also makes the idea of separate repositories a good one – no everyone cares about data or docs.

The desire to put a whole workspace into single repository can be too strong at different moments, mostly b/c of the reasons described in previous paragraph. And that’s where Git submodules can be helpful.

Summary

What was good before might not be good anymore. We should revisit our approaches when we change or our responsibilities change. 

The previous structure that I’ve used for project directories was good for my needs. But my needs changed and thus the structure is not anymore. 

I need more than just have a structure for the source code or single project. I need a new way to organize files, that would cover a set of documents, source code and data for one or multiple related projects. 

And my solution to it is “workspace”.

My Setup

A few weeks a go I found for my self again a nice website usethis.com with interviews of different people who describes their setup. I found a lot of intersting there, and decided to share my own setup. Although I believe it is pretty standard these days.

So, I have a desktop and 2 laptops. My desktop is based on Mac Mini late 2012 where I replaced 4g with 16g ram. I'm using OS X 10.8 in order to support the hack that allows me using my Seiki 4k TV as monitor. I have also Dell 24 monitor, but not using it anymore. My personal laptop is MacBook Pro w/ Retina '13. The other is my work laptop Lenovo ThinkPad T420 with Ubuntu on it. I have 6g ram and 120g SSD drive there, so its pretty ok.

I have Nexus 4 as my phone and Nexus 7 as my tablet.

I also use BitTorrent Sync to sync projects and personal files (including books, videos and photos) between my desktop, laptop and mobile devices. Very handy, as I always have my files available everywhere. Highly recommended!

I use Kindle 3 and Paperwhite as my readers. Actually, I prefer to use Kindle App to read ebooks on my mobile devices. I'm actively using Pocket for reading articles both on mobile gadges and on desktop/laptop. I found it very helpful to keep reading more and more. For sharing links between devices and browsers, I'm using SyncTab. With a new plugin for FF it works for me even better.

I recently switched from Chrome back to the Firefox. In FF I'm fan of plugins like Tree Style Tab, Evernote Clearly, SyncTab and GreaseMonkey.

IntellijIDEA and PyCharm is what I'm usign for developing on Java and Python. I also use SublimeText as text editor for scripts, html and notes. Next plugins for Sublime as invaluable for me nowadays: MarkdownEditing, Markdown Preview, Git and GitGutter. I'm actively using Markdown for my notes. And keep notes, private and public projects on GitHub.

I have also operational notes and todos, which I keep in Evernote. Again, Evernote apps are installed just everywhere - desktop/laptop and mobile devices. However, for my bookmarks, I got back to Delicious. They are not in the best times of thei life, but works good so far for me. As for RSS reader, I finally got used to Feedly, althought still missing Google Reader a lot!

As for the music, I use Spotify to listent to music on my devices, but also have ipod shuffle, which is always with me.

On OSX I'm also using iterm2 with zsh and brew.

My preferred games on mobile devices are Andoku and 2048.

For backing up data and sharing, except BTSync and Evernote, I also use Google Drive and Dropbox. I also upload my photos to Flickr.

I think, I'm done now...

And yeah, some picture:

picture