• "I format my code  like that",  yes but every developer format his code differently ...
  • "Why having java collection if you can not use the directly", this speak of course against encapsulation and clear APIs...
  • "I put accessors at the end" "i want to see relevant code at the beginning of classes and in the same order as execution" simply b... and not object oriented at all, they do not think about object message but files
  • "I never  use the keywords this, it is not needed"

At the end, You can discuss for hours, just for .... nothing, people don't like to change, just auto format code, sort methods and most of them are lost/complains/recommit their code on yours...
In order to force them or remove  difference between coding practice, why not bringing Checkstyle in your organization?

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard. 
Checkstyle is highly configurable and can be made to support almost any coding standard. An example configuration file is supplied supporting the Sun Code Conventions. As well, other sample configuration files are supplied for other well known conventions. ¨

The best Eclipse plugin is available at  http://eclipse-cs.sourceforge.net/

The only practicable way of  is either to 
  • Bring all developer in a room, and let them vote all together which features is a warning, an error, or if it should not be removed from the common set of rules, but the discussion will be quite loud. You will hear a lot of "I do not need it, I know how to develop..."
  • Force them to use the common SUN/Other standard without discussion. This may work in a bug company/team.


Eclipse has a cleanup functionality (Windows - preferences - java - code styles - cleanup), which can be triggered at each save of a file (only in 3.3). I am personally using it since 2 months and refuse to live without. My settings are quite ambitious but reflect my intentions to keep my code as neutral as possible, it remove unneeded stuffs, format and add parenthesis where it is needed automatically.

- Add 'this' qualifier to unqualified field accesses
- Add 'this' qualifier to unqualified method accesses
- Qualify accesses to static fields with declaring class
- Qualify accesses to static methods with declaring class
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Convert control statement bodies to block
- Add paranoiac parentheses
- Remove unused imports
- Remove unused local variables
- Add missing '@Override' annotations
- Add missing '@Deprecated' annotations
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Sort all members
- Organize imports
- Format source code

About sorting method

A quite interesting discussion at Javaworld can be read here.  A lot of users have post responses, and of course still do not get the point that the  object code is not linear, so manual human sorting based on this flawed assumption is only a failure. It is more than a failure also because every developer will sort code differently...so the more neutral behavior is Eclipse alphabetical sorting.
Eclipse or any IDE have 3 magic keys: (F3) for opening declaration of the element, (F4) Open Type hierarchy and a back button (ALT - LEFT). You don't/can't have to read the code like a book, just to jump from one method to the other with F3 - back, use call hierarchy (CTRL -ALT - H).  If you want to understand the execution flow, it is better to look at the sequence diagram ....
  Moreover, I do not often stay in an object very long, because I always try to spread responsibilities across objects.
 
comments powered by Disqus

You might like also

JDK 6 Release Candidate
Java Platform, Standard Edition 6 is a major feature release. Significant features and enhancements in Java SE 6 since the prior major release, J2SE 5.0 are all listed on that page. You can download the Release Candidate HERE …
4514 Days ago
No Thumbnail was found
From www.devsource.com"Scripting languages have long been regarded by the programming world as poor country cousins, somehow inferior to the "real" programming languages. Yet, according to Evans Data Corp.'s Fall 2004 North American Development Survey, a lot of "real" programmers are adding scripting to their arsenals of programming tools. The research firm reports that over 41 percent of the 666 developers surveyed use Perl, 32 percent use PHP, and 15.6 percent use Python, with considerable overlap (other scripting languages were not …
5112 Days ago
No Thumbnail was found
Sample Chapter are provided courtesy of Addison Wesley Professional and can be read at www.informit.comWhat Is Refactoring? A refactoring is a "behavior-preserving transformation" or, as Martin Fowler defines it, "a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior" (Fawler, page 53) read more here …
5158 Days ago
No Thumbnail was found
A collections of links, this time. A lot of persons have already done a stunning job:Sun Java Center - J2EE Patterns: The J2EE Patterns presented here, a collection of J2EE-based solutions to common problems, reflect the collective expertise and experience of Java technology architects in the Sun Java Center over the past three years.Wiki pattern catalog with some famous contributors like Kent Beck and co.The server side: get the latest informations on Patterns.Javaworld a list of articles …
5177 Days ago
No Thumbnail was found
In this article, an excerpt from Test-Driven Development: A J2EE Example (Apress, 2004), author Thomas Hammell helps you select the right tools for getting started with test-driven development (TDD) ... Following the Keep It Simple, Stupid (KISS) and You Aren't Gonna Need It (YAGNI) rules of extreme programming (XP), each tool listed in the following sections fits into the TDD process ... more Here …
5219 Days ago
No Thumbnail was found
SableVM is a highly-portable Java virtual machine written in C, and implementing the Java virtual machine specification, second edition. I ti s currently able to start and use Eclipse 3.1 On the JVM side, Java on BeOs is making huge steps …
5225 Days ago
No Thumbnail was found
Some links that may help You preparing the SUN java certification... Free SCBCD 1.3 Study Guide Free SCWCD 1.4 Study Guide Free SCDJWS 1.4 Study Guide SCDJWS 1.4 Quiz Free IBM Certified Associate Developer Study Guide www.javaranch.com and more precisely HERE …
5240 Days ago
No Thumbnail was found
Meta-Patterns: Design Patterns Explained Moisés Daniel Díaz Toledano. Email : This email address is being protected from spambots. You need JavaScript enabled to view it. www.moisesdaniel.com MetaPatterns can be contemplated like a form of understanding the underlying mechanisms of patterns and the form in which they work, and even as a new patterns’ classification. The principal objective of patterns is capturing good practices that allow us to improve the quality of the design of systems, determining objects that support useful roles in a specific context, encapsulating complexity, and making it more flexible.We can observe …
5289 Days ago
abnormal situation,exception, exception handling,
Articles: A very good document, if you want to improve your code, Click HERE to download it This paper informs about design and implementation of error handling facilities in business information systems. It presents a pattern language for the object oriented design of components needed for error handling and also present sample code in different programming languages (C++, Java, Cobol, Smalltalk). List of Patterns Error Object, Exception Hierarchy , Error Traps, Assertion Checking Object, Backtrace , Centralized Error Logging, Error …
5309 Days ago
No Thumbnail was found
Books:Softwares:AnalysisStructural Analysis for Java "SA4J is a technology that analyzes structural dependencies of Java applications in order to measure their stability. It detects structural "anti-patterns" (suspicious design elements) and provides dependency web browsing for detailed exploration of anti-patterns in the dependency web. SA4J also enables "what if" analysis in order to assess the impact of change on the functionality of the application; and it offers guidelines for package re-factoring." MetricsMetrics sourceforgeeclipse plugin …
5317 Days ago