Click here to Skip to main content
15,892,517 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: That's rude, latest Adobe flash update Pin
Ernst Iliov Stavro Blofeld13-Feb-14 4:16
Ernst Iliov Stavro Blofeld13-Feb-14 4:16 
GeneralRe: That's rude, latest Adobe flash update Pin
tgrt13-Feb-14 5:08
tgrt13-Feb-14 5:08 
GeneralRe: That's rude, latest Adobe flash update Pin
Nicholas Marty13-Feb-14 4:18
professionalNicholas Marty13-Feb-14 4:18 
GeneralRe: That's rude, latest Adobe flash update Pin
Eddy Vluggen13-Feb-14 4:59
professionalEddy Vluggen13-Feb-14 4:59 
GeneralRe: That's rude, latest Adobe flash update Pin
Johann van der Smut13-Feb-14 18:22
Johann van der Smut13-Feb-14 18:22 
GeneralRe: That's rude, latest Adobe flash update Pin
jschell13-Feb-14 9:05
jschell13-Feb-14 9:05 
GeneralRe: That's rude, latest Adobe flash update Pin
sloosecannon14-Feb-14 8:24
sloosecannon14-Feb-14 8:24 
GeneralCoding Standards Pin
Matt U.13-Feb-14 3:19
Matt U.13-Feb-14 3:19 
Coding standards with my employer are strange based on everything I've ever known, everything I've ever read, everything I've ever been told. They are set in their ways and I don't think anything could change their mind on these internal standards. Here are a few:

1. Excessive commenting -- practically every operation in code has a preceding comment. No matter how descriptive the code is, and no matter how simple the operation may be, there is a comment such as the following:

C#
/// <summary>
/// This is an addition method.
/// </summary>
private int Add(int a, int b)
{
    // Add the two numbers and return the result
    return a + b;
}

private void Process(MyFileObj myFile)
{
    // Make sure the parameter is not 'null'
    if (myFile != null)
    {
        // Strip all the bad data from the object
        myFile.StripBadData();

        // Add the file to the collection
        _myFileCollection.Add(myFile);
    }
}


2. Variable declaration -- this may not be so bad, so please correct me if I'm wrong. But I've never seen it done this way. According to their standards, all variables in a method must be initially declared at the top of the method, before anything else is done:

C#
private MyClass MyMethod()
{
    int count = 0;
    MyClass someObj = null;

    // Iterate over the file collection
    foreach (MyFileObj file in _myFileCollection)
    {
        // Make sure the file's name is not longer than 20 characters
        if(file.Name.Length <= 20)
        {
            // Copy the file to a new location
            file.CopyTo(@"C:\SomePath\" + file.Name);

            // Increment the counter
            count++;
        }
    }

    // A lot of other code
    // ...

    // Setup the class that will be returned
    someObj = new MyClass();
    someObj.FileCount = count;

    // Return the class that has the data we need
    return someObj;
}


The "MyClass someObj" isn't referenced until the very end of the method. Why should it be declared at the very top of the method? Maybe I'm missing something? I've never declared objects until the time I need them.

These are just a few examples. There are some other things I don't really agree with, but I can't change any of them.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.

GeneralRe: Coding Standards Pin
Ennis Ray Lynch, Jr.13-Feb-14 3:25
Ennis Ray Lynch, Jr.13-Feb-14 3:25 
GeneralRe: Coding Standards Pin
Matt U.13-Feb-14 3:29
Matt U.13-Feb-14 3:29 
GeneralRe: Coding Standards Pin
Kirk Wood14-Feb-14 15:40
Kirk Wood14-Feb-14 15:40 
GeneralRe: Coding Standards Pin
Argonia13-Feb-14 3:25
professionalArgonia13-Feb-14 3:25 
GeneralRe: Coding Standards Pin
Matt U.13-Feb-14 3:32
Matt U.13-Feb-14 3:32 
GeneralRe: Coding Standards Pin
Marco Bertschi13-Feb-14 3:34
protectorMarco Bertschi13-Feb-14 3:34 
GeneralRe: Coding Standards Pin
Argonia13-Feb-14 3:45
professionalArgonia13-Feb-14 3:45 
GeneralRe: Coding Standards Pin
jschell13-Feb-14 9:09
jschell13-Feb-14 9:09 
GeneralRe: Coding Standards Pin
John Nurick14-Feb-14 1:25
John Nurick14-Feb-14 1:25 
GeneralRe: Coding Standards Pin
jschell14-Feb-14 10:15
jschell14-Feb-14 10:15 
GeneralRe: Coding Standards Pin
Gerry Schmitz14-Feb-14 10:15
mveGerry Schmitz14-Feb-14 10:15 
GeneralRe: Coding Standards Pin
jschell17-Feb-14 11:47
jschell17-Feb-14 11:47 
GeneralRe: Coding Standards Pin
Shameel13-Feb-14 3:35
professionalShameel13-Feb-14 3:35 
GeneralRe: Coding Standards Pin
Kornfeld Eliyahu Peter13-Feb-14 3:40
professionalKornfeld Eliyahu Peter13-Feb-14 3:40 
JokeRe: Coding Standards Pin
Richard Deeming13-Feb-14 3:43
mveRichard Deeming13-Feb-14 3:43 
GeneralRe: Coding Standards Pin
Matt U.13-Feb-14 4:30
Matt U.13-Feb-14 4:30 
GeneralRe: Coding Standards Pin
Jonathan C Dickinson13-Feb-14 21:44
Jonathan C Dickinson13-Feb-14 21:44 

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.