Click here to Skip to main content
15,909,747 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: O(my) Pin
Daniel Pfeffer1-Aug-15 22:45
professionalDaniel Pfeffer1-Aug-15 22:45 
GeneralRe: O(my) Pin
harold aptroot2-Aug-15 1:58
harold aptroot2-Aug-15 1:58 
GeneralRe: O(my) Pin
PIEBALDconsult2-Aug-15 6:33
mvePIEBALDconsult2-Aug-15 6:33 
GeneralRe: O(my) Pin
harold aptroot2-Aug-15 6:41
harold aptroot2-Aug-15 6:41 
GeneralRe: O(my) Pin
PIEBALDconsult2-Aug-15 6:46
mvePIEBALDconsult2-Aug-15 6:46 
GeneralRe: O(my) Pin
PIEBALDconsult2-Aug-15 8:34
mvePIEBALDconsult2-Aug-15 8:34 
GeneralO(yes^3) Pin
Bassam Abdul-Baki4-Aug-15 7:20
professionalBassam Abdul-Baki4-Aug-15 7:20 
GeneralHow Disciplined Of A Coder Are You? PinPopular
Kevin Marois1-Aug-15 8:18
professionalKevin Marois1-Aug-15 8:18 
I'm a C#/WPF guy, and every single one of my classes is coded as follows:

I use regions, and I have the following regions always in this order (assuming there's code there for it):
Constants
Event Declarations
Private Fields
Properties
Dependency Properties
Commands
CTOR
Public Methods
Method Overloads
Private Methods
Event Handlers

In each one of these sections, the items are always in alphabetical order. Why? because when you come in after me and open one of my classes, knowing I code this way, you'll always know where the piece you're looking for is.

I never put code in an event handler, except a call to a private method. Why? Assume you have a bunch of code in a ListBox SelectedItem event. Then you change ListBox to a ComboBox... now you have a bunch of code to do. For a button click.. you're almost certainly going to do multiple things, and all that code doesn't belong in MyButton_Click.

I always correct spelling errors. Why? because I'm not lazy and leaving it is just wrong.

I always use XAML comments. Why? So when you use my class you'll know what things do.

I always comment where appropriate, and I always keep comments current. Why? You already know why.

When a class is finished, I always remove and sort namespace usings. Why? Less code is better.

Now this is just me... I'm anal like this. What about you? I'm curious how other people code.
If it's not broken, fix it until it is

GeneralRe: How Disciplined Of A Coder Are You? Pin
PIEBALDconsult1-Aug-15 8:35
mvePIEBALDconsult1-Aug-15 8:35 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Kevin Marois1-Aug-15 8:47
professionalKevin Marois1-Aug-15 8:47 
GeneralRe: How Disciplined Of A Coder Are You? Pin
newton.saber1-Aug-15 10:28
newton.saber1-Aug-15 10:28 
GeneralRe: How Disciplined Of A Coder Are You? Pin
pkfox1-Aug-15 21:10
professionalpkfox1-Aug-15 21:10 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Ravi Bhavnani1-Aug-15 8:35
professionalRavi Bhavnani1-Aug-15 8:35 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Kevin Marois1-Aug-15 8:42
professionalKevin Marois1-Aug-15 8:42 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Ravi Bhavnani1-Aug-15 8:45
professionalRavi Bhavnani1-Aug-15 8:45 
GeneralRe: How Disciplined Of A Coder Are You? Pin
PIEBALDconsult1-Aug-15 9:20
mvePIEBALDconsult1-Aug-15 9:20 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Gjeltema1-Aug-15 12:10
Gjeltema1-Aug-15 12:10 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Camilo Reyes1-Aug-15 14:09
professionalCamilo Reyes1-Aug-15 14:09 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Mycroft Holmes1-Aug-15 14:29
professionalMycroft Holmes1-Aug-15 14:29 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Mike Hankey1-Aug-15 9:09
mveMike Hankey1-Aug-15 9:09 
GeneralRe: How Disciplined Of A Coder Are You? Pin
CPallini1-Aug-15 10:59
mveCPallini1-Aug-15 10:59 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Nelek1-Aug-15 11:00
protectorNelek1-Aug-15 11:00 
GeneralRe: How Disciplined Of A Coder Are You? Pin
CPallini2-Aug-15 6:40
mveCPallini2-Aug-15 6:40 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Ron Anders1-Aug-15 10:58
Ron Anders1-Aug-15 10:58 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Ravi Bhavnani1-Aug-15 12:55
professionalRavi Bhavnani1-Aug-15 12:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.