Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strict Adherence to Coding Conventions?

 
Matt DeLacey
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just took peek at Java's Coding Conventions based on someone's post recently. One thing that struck me: they should you should do your braces as such
int myMethod () {
//code
}
That just drives me crazy! I prefer the good old:
int myMethod ()
{
//code
}
The rest of the rules I use or can live with changing them. How strictly do you think you have to adhere to that standard? I mean, I don't want to loose points, but it's also almost impossible for me to make myself write code the other way. It is much harder for me to read. What are your thoughts? I know it seems pretty trivial, but I'm going to download the assignment in 2 weeks and I'm getting nervous and wanting to get all my ducks in a row.
With Respect,
Matt DeLacey
 
balaji sambandam
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The sun code conventions clearly mentions it should be
int myMethod () {
//code
}
So I wouldn't take any risks of losing some marks for a silly
thing. Even I had the same thing in mind when I started
my assingment and got used to it.
Originally posted by Matt DeLacey:
I just took peek at Java's Coding Conventions based on someone's post recently. One thing that struck me: they should you should do your braces as such
int myMethod () {
//code
}
That just drives me crazy! I prefer the good old:
int myMethod ()
{
//code
}
The rest of the rules I use or can live with changing them. How strictly do you think you have to adhere to that standard? I mean, I don't want to loose points, but it's also almost impossible for me to make myself write code the other way. It is much harder for me to read. What are your thoughts? I know it seems pretty trivial, but I'm going to download the assignment in 2 weeks and I'm getting nervous and wanting to get all my ducks in a row.
With Respect,
Matt DeLacey

 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't give a rat's about achieving the highest possible score, personally. The exam is pass-fail, and while making 155 points the goal is a nice motivation, the bragging rights for perfection are suspect.
It's going to depend on the grader. I've seen both kinds: graders who deem themselves incontrovertibly bound by the rules, and graders who are far more concerned with *consistent* style.
You should be able to judge by your own feelings on "proper bracing" that someone else might feel as strongly about doing it the other way, right? That being said, how many points can you realistically attribute to that?
Do what you feel comfortable doing, I say. Just be consistent. If it's a couple points off because you did, I'm sure you'll be just as employable as anyone else who passed.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
[This message has been edited by Michael Ernest (edited January 11, 2001).]
 
Matt DeLacey
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sound advice. Wow! I'm honored. I used your book almost exclusively to get me through the Programmer's Certification. Certainly, I owe you a measure of thanks. Now, it looks like you'll be assisting me in my quest to obtain the Developer's Certification as well!

With Respect,
Matt DeLacey
 
sachin patel
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
can anyone tell me where can i look for coding conventions...
Thanks in advance....
------------------
Sachin,
****************************************************
Learn from others mistakes. Life is too short to make all yourself.
****************************************************
 
Sam Wong
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sachin,
The coding standard for Java can be found here
Sam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic