Originally posted by Roshni Singhania:
...in SCJD part of the 1.5 certification book, it says that it should be on the same line or the marks could be reduced if we put it on the next line...
Originally posted by fred rosenberger:
indeed, anywhere you work will have a style guide. contrary to what some folks will tell you, no style is better or worse. you should follow whatever guide is appropriate for the project. If you are doing a SCJD project, use their style guide. if you are doing the JavaRanch cattle drive, use theirs.
Originally posted by Ilja Preuss:
... I totally agree - except for the fact that *my* coding style is the only true one...
Originally posted by Shashi Kala:
And I don't think that marks get reduced for this reason.
We�ve seen people fail the exam because they put the curly braces on the line below the method declaration rather than immediately following the declaration (on the same line), violating the official Java Coding Conventions. While this infraction alone probably might not cause you to fail, the points deducted for code convention violations might be the ones that sink you where you otherwise might have squeaked by.
The Assignment is graded by giving your application a starting number of points and then deducting points for violations including minor things (curly braces in the wrong place) and major things (locking doesn�t work in every situation).
Marc and I are tending this part of the bar, so Marc's right. What he says goes.
Originally posted by marc weber:
That's only correct if your coding style happens to match my coding style.
Originally posted by Ernest Friedman-Hill:
The "brace-on-the-same-line" style originated with Kernighan and Ritchie's "The C Programming Language". They have gone on record saying that this was only done to save vertical space in the book, enabling them to keep listings together on a single page.
Originally posted by Rob Ross:
Just thought you'd want to know.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton