|
-
Sep 29th, 2007, 11:02 PM
#1
Thread Starter
Fanatic Member
school coding standards
I'm taking a class required for my major that is supposed to teach us coding style and program design (since we've already had 2 classes that teach basic Java). The problem is they are using FindBugs and CheckStyle plugins in Eclipse and want us to adhere to strict coding style standards. We can opt to follow different standards as long as it has the same elements. I was wondering if you guys had any better suggestions?
They want arguments to start with a/an/the, followed by an underscore, followed by the argument name, or the name - underscore - numeral. For example: the_index, the_starting_point, an_animal, thing_1, thing_2.
Local variables must be all lower case with words separated by underscores: local_variable.
Instance variables begin with "my_" such as: my_color.
I'm cringing at the thought of writing code like this. I would rather have camel case arguments and local variables: thisIsMyVariable, and just a leading underscore for instance variables.
Is there any other way to do this so that all three types are different from each other and from the normal way to name classes and methods?
I might ask if I can do: _instance, arg_argument, local_variable. I guess that wouldn't be too bad. Any other ideas?
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Oct 1st, 2007, 12:33 AM
#2
Re: school coding standards
There are 2 types of standards (Global, Local)
the global ones can be found on the sun website - And by the way they are local to Sun - And there are the local standards which any company specifies so that all code looks the same instead of having too many ways of doing the same thing (Or in other words keep all code readable to people who understood a small piece of it).
If your school uses different standards than the ones your used to... Well, get over it and get used to how they do things. It might not be the best way but it'll get you a good grade
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Oct 1st, 2007, 08:22 PM
#3
Thread Starter
Fanatic Member
Re: school coding standards
I'd never work for a company that was that strict about it.
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Oct 2nd, 2007, 09:20 AM
#4
Re: school coding standards
 Originally Posted by DNA7433
I'd never work for a company that was that strict about it.
You'll always be a freelancer then
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Oct 2nd, 2007, 10:50 AM
#5
Re: school coding standards
Standards are there for a reason, if everyone was allowed to do what ever they wanted, they wouldn't be standards, would they? Every shop has their own set of rules. We're pretty ruthless with ours. We have to be. We can't afford to have 12 different "personal standards". If some thing wasn't coded or named right, during the code review, it is sent back. I've had stuff returned to me, and I've returned stuff to others.
Even working freelance your own personal standards may not work. Depends on how hard nosed the client wants to be about the code you are selling them conforming to their standards.
-tg
added:
 Originally Posted by DNA7433
I'd never work for a company that was that strict about it.
And I'd NEVER work for a company that didn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|