I have a question about code conventions for the certification.
I am using Maven for my build process and I am using tools such as checkstyle and PMD. I don't recall seeing a concrete requirement to abide by the standard Java code conventions so I am unsure as to whether candidates would lose marks if they don't strictly conform. I understand that if I'm not consistent in my formatting across the entire source base then it would make the code harder to read and the marker may have a negative view on this. Also in terms of maintainability it would be better to be as consistent as possible.
However, there are a couple of aspects of the standard conventions I would prefer to change, for example, the 80 character line width restriction I would like to increase to between 120-140. Also, due to the environment in which I currently work I am used to putting brackets and so on on new lines and find this more natural e.g.
That said, I would hate to drop marks just for some personal preferences so if necessary I will stick to conventions.
Is there anyone who has not followed strict conventions and scored full marks?
I scored full marks (in 2009), but followed the sun coding conventions, even the 80 characters per line one. In my current development I think that's one of the few which is updated to more present standards.
But I guess the most important thing (like you already indicated) is being consistent through your complete project (use a formatter in your IDE). I think that's more important than just following oracle/sun's coding conventions (but it's not a guarantee).
Thanks for that. I think for the sake of being safe I will stick to the conventions as much as possible.
I am using eclipse Indigo as my IDE and I was using the Java Conventions formatter and a couple of save actions, but I am finding that it is not correctly removing trailing white-space from JavaDoc comments (actually it even inserts them when there aren't any), which is causing checkstyle to fail. Also it is not correctly wrapping lines even though the line width is set to 80, there are various lines that are 85, perhaps even 95 lines long...
I think I'll need to spend some time checking all of the Eclipse settings and try reformatting the code...
I completely ignored the 80 character line width restriction. I noted in my choices.txt that 80 characters makes code less readable. Nowadays it's easy to put 160 chars on a line.
You won't fail for such minor unimportant things
It's been a while since I have taken the certification exam, so take this post with a huge grain of salt.
As a person whose job is to do code reviews, small deviations from the standard might be minor inconveniences, but you put many of them together and they become a huge problem. It's like getting stabbed with a plastic fork. One stab, you can ignore; ten stabs, annoying; 100 stabs, stop it!!!; 1000 stabs, kill me please. If you are deviating from a well established standard, don't deviate too much