I have never understood what is the ideal way to name a project, package, class. I do it in a random way which doesn't look professional at all. I know the class name should start with a capital alphabet. But what I don't really have trouble with is finding the names that are suitable and look professional. lets consider this example. If I am writing a program for fibonacci series i give names like this:
project name = fibonacci_project
package name = org.fib.code1
class name = Code1
Doesn't look neat right? How would you do it ?
There are some tips about naming:
LongClassName
DefaultTableModel
). Code1
is definetely not right, maybe FibonacciCalc
or something that contains Fibonacci
would fit better.Abstract
if it's an abstract classImpl
if it's an implementation of a particular interfaceThink about something more complex in which you have:
org.package.gui
org.package.core
org.package.extensions
For starters, it's Fibonacci.
See Sun's java naming conventions for some details on package / class names.
Aside from that, the general rule of thumb is - all your names should be descriptive:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With