Current version: 0.1.4 | Current status: Alpha/Stable | This page is optimized for Mozilla!

JCast-X

Download

Contribute

Developers

Tools

Use the source by understanding these guidelines









This is a brief guideline that expresses IMHO common sense to all übercoders out there. I believe we can create great code if we just keep the discipline. Here are some reminders, read them at least once to strengthen your synapses. JCast-X started out as a project to help me learn more about Java, the main force behind JCast-X was, and should still be, to have a lot of fun while coding. To achieve that let your code be simple and easy to understand. If you need to implement abstract and advanced things be descriptive and use comments to explain. Keep in mind that others should be able to learn from your code. Take your time! Seriously, this project will stay free of deadlines. A new milestone is reached when its reached, not when time runs out.

Complete JavaDoc Headers.
Every class + method + variable should get a properly filled out JavaDoc header. The class should get an extra description, if possible a little usage example. Required is the usage of @param, @return and @throws tags.

Member variable prefix "m_"
For better understanding, all member variables should start with the prefix m_. Through this, inherited variables of abstract classes are better perceived.

Simplicity => Readability => Quality + Performance
Follow these simple rules while hacking away for JCast-X.

Keep your code as simple as possible:

  • Classes < 25 Methods
  • Methods < 1 Screen full of code
  • Lines shorter than 80 chars
Try and use comments to explain the inner workings of your code. Be descriptive! For example always explain inside the conditional case what you expect and not the state of variables:
Wrong:
if ( count < 0 ) {
  // Count is below 0
  ...
  code
  ...
}
Right:
if ( count < 0 ) {
  // So far we didnt count any newlines 
  ...
  code
  ...
}
The difference is simple, in the latter case anyone reading the comment inside the condition will understand what the author tried to achieve. If for any reasons a problem related to the condition occurs, it is easier for any reader to see the problem.

Make your code readable by using "space" in your code plus fully qualified comments. Wrong:

if (m_readBytes <= 0) { break; }
Right:
if ( m_readBytes <= 0 ) {
  // I guess we are at the end of file...
  // This breaks file read, iteration through playlist continues...
  break;
}
Also Right:
if ( m_readBytes <= 0 ) 
{
  // I guess we are at the end of file...
  // This breaks file read, iteration through playlist continues...
  break;
}

Use the collections framework provided by Java, in general look at java.util.* and make use of the tools available.

Create unit-tests for all classes in order to keep up code quality by reducing likelyness of change-bugs. Ask other developers/friends to take a look at your code and give your feedback. (Given enough eyeballs, all bugs are shallow). Further please read the JCast-X development process document.


Page version: $Revision: 1.5 $