Skip to content

Code Style

Andrey Kurilov edited this page Nov 29, 2016 · 11 revisions
  • Indent code with TAB having width of 4 characters
  • Code line width: 100 characters
  • Long line example:
nextSubTask = new BasicPartialMutableDataIoTask<>(
    ioType, nextPart, srcPath, dstPath, equalPartsCount, this
);
  • If something may be declared as final it should be declared as final
  • The sole class implementing the interface X usually has a name BasicX
  • Take care about the performance:
    • Avoid frequent objects instantiation
    • Avoid unnecessary frequent allocation
    • Avoid I/O threads blocking
    • Use thread locals (encryption, string builders)
Clone this wiki locally