# Coding

Virgo has a strong emphasis on maintainable, or "clean", code. If you need a really good introduction to coding, we recommend " Code Complete". If you are already a proficient programmer and want to write really clean code, read " Clean Code". If you are not an expert in writing Java, read " Effective Java".

Virgo code is thread safe unless specifically stated. Achieving thread safety in Java is not easy. We recommend " Java Concurrency in Practice" for a good grounding in Java concurrency.

Coding guidelines are here.

A Contextual Bash History can be very useful, guide here.

## Eclipse Setup

1. Install the Virgo IDE tooling into Eclipse as described under the Tooling tab.
2. Install AJDT into Eclipse. This is necessary so that Virgo projects which use AspectJ are correctly woven when rebuilt under Eclipse.
3. Install egit into Eclipse. This step is recommended but not absolutely essential since it is possible to perform git operations on the command line or using some other git GUI tool.
4. Build the Virgo git repository you want to import into Eclipse as described under the Build tab. Ensure you see BUILD SUCCESSFUL.
5. Import the projects of the chosen git repository by using File->Import->Git->Projects from Git. Then click Next and add the git repository, select it, and click Next. Select the "Import existing projects" wizard and click Next. Check the projects you want to import (typically org.eclipse.virgo.xxx where xxx corresponds to the repository - other projects such as test bundle projects and any inside the build-xxx and virgo-build directories are unlikely to be of interest) and click Finish.
6. If you see lots of errors, you probably need to define a suitable classpath variable, e.g., KERNEL_IVY_CACHE, to point to the Ivy cache which has been built in the local copy of the git repository (actually to the ivy-cache/repository folder).
7. There should be no errors (marked in red). Occasionally, the build paths get out of step with the build.versions file and need updating.