Results 1 to 5 of 5

Thread: school coding standards

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2001
    Posts
    837

    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.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2001
    Posts
    837

    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.

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: school coding standards

    Quote 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

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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:
    Quote 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.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width