Readable Code - Remove Checking null
Readable Code – Checking NULLWe must have come across these lines of code many times
//JAVA
bool func(String name)
{
if ( (name != null) && (name.equals("true") ) {
...
} else {
...
}
}
A better way to code this would be
//JAVA
bool func(String name)
{
if ( "true".equals(name) ) {
...
} else {
...
}
}
Labels: Java, readable code
Posted by - at 8:36 pm | 0 comments read on
Programming - Code Browsing Made Easy Using ctags+gvim
Using ctags+gvim for code browsing...The following command generates a tag file for C/C++ ONLY, you can extend the exclude list for more specific one.
ctags -R --languages="-Java,-JavaScript,-HTML,-Perl,-Sh" < directory name >
For listing all supported languages use
ctags --list-languages
Posted by - at 6:51 am | 0 comments read on