8 Replies - 1877 Views - Last Post: 29 November 2008 - 11:34 AM

#1 maffelu  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 43
  • View blog
  • Posts: 190
  • Joined: 21-August 08

Coding Standards, do most employers have them

Post icon  Posted 21 November 2008 - 06:08 AM

Hi!

I was wondering what the standards are when you get a job as a C# programmer as to structure in C#. I've gone through alot of structural changes in my way of coding the last 6 months(starting of at the spagetthi-stage).
Right now, I put almost all of my codes in classlibs and almost no code in my forms(when working with forms). When a button was pressed in my old programs, I had basically all my code under the button event, but now I have almost no code there, just pointers to other classes where the code is.

What's the rule? Where should the code be placed in a program :rolleyes:

Is This A Good Question/Topic? 1
  • +

Replies To: Coding Standards, do most employers have them

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1525
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: Coding Standards, do most employers have them

Posted 21 November 2008 - 07:11 AM

there is really no standard. Sometimes, the company that you work for will have standards. The company I work for has a few, but they aren't totally enforced. Others don't have standards and you can really just code how you want.
Was This Post Helpful? 0
  • +
  • -

#3 Grondhammar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 19-November 08

Re: Coding Standards, do most employers have them

Posted 21 November 2008 - 08:32 AM

It sounds like you're learning the entire range of "rules" for structuring code, and that's good because (as eclipsed said) that's exactly what you'll run into when employed -- everything from spaghetti code to code so class-bound that you spend more time trying to trace the call stack than is good for you.

In my current job we have established guidelines tending towards the heavy class use side. Generally speaking, the larger the organisation, the higher value there is in class definition and re-use. So, if you're working as a lone coder you can expect previous systems to be a lot more loosely structured, while in a 40-coder team everything will be classed downwards to fairly granular functionality.

Hope this helps, good question.
Was This Post Helpful? 0
  • +
  • -

#4 maffelu  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 43
  • View blog
  • Posts: 190
  • Joined: 21-August 08

Re: Coding Standards, do most employers have them

Posted 21 November 2008 - 09:34 AM

Great, that's what I want to hear. Then I assume whatever company hires me tells me their secret style.

Another question(if anyone still reads this one), is there a rule when to create a static method and when not too? Cause I find some of my methods works alot faster when I set them as static because if I have like 4 methods (in various classes) that I use alot, it's easier to just put them as static if I'm not gonna use any of the other methods in that class as much.
Any thoughts?
Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Coding Standards, do most employers have them

Posted 21 November 2008 - 11:54 AM

Most companies I've ever worked for have had a "Coding Standards" document that you are required to look through when you join their department. Most of these documents have naming conventions that are required, whether to use Camel Casing or whatnot. Sitepoint has a great article on why companies employ a coding standards document.

In my experience most companies employ coding standards so no matter who is looking at the code they know things are always going to be in the same format, same naming conventions ect. Unlike eclipsed4utoo all companies I have ever worked for strictly enforce their coding standards. The last company I worked for wouldn't even approve a code review if the standards weren't followed. Remember one thing, if the company you work has such a document, and requires you to read it, follow it.

Below are two examples of how most of the ones I've been required are formatted, and a lot of companies follow these standards

Attached File  CSharp_20Coding_20Standards.zip (101.95K)
Number of downloads: 170
Attached File  IDesign_CSharp_Coding_Standard.zip (209.38K)
Number of downloads: 464
Was This Post Helpful? 0
  • +
  • -

#6 ValPaliy  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 12
  • View blog
  • Posts: 1,395
  • Joined: 06-December 07

Re: Coding Standards, do most employers have them

Posted 22 November 2008 - 05:25 AM

No standards, simply art as long, as an application works.
BTW, PsychoCoder - thank you very much for the examples.

This post has been edited by ValPaliy: 22 November 2008 - 05:26 AM

Was This Post Helpful? 0
  • +
  • -

#7 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Coding Standards, do most employers have them

Posted 22 November 2008 - 11:45 AM

I think I'm going to move this to the Corner Cubical, since it isn't a programming question par say :)
Was This Post Helpful? 0
  • +
  • -

#8 csmanoj  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 150
  • Joined: 06-August 07

Re: Coding Standards, do most employers have them

Posted 29 November 2008 - 11:24 AM

We have very strict standards. Right from naming to the controls we use. It's made sure it's uniform before it's moved for production.
Was This Post Helpful? 0
  • +
  • -

#9 csmanoj  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 150
  • Joined: 06-August 07

Re: Coding Standards, do most employers have them

Posted 29 November 2008 - 11:34 AM

oops ... sorry, duplicate post went here!

This post has been edited by csmanoj: 29 November 2008 - 11:36 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1