Click here to Skip to main content
11,410,379 members (57,416 online)

Welcome to the Lounge

   

For lazing about and discussing anything in a software developer's life that takes your fancy except programming questions.

Technical discussions are encouraged, but click here to ask your programming question.

The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct, no programming questions and please don't post ads.


 
GeneralRe: Transcendence PinmemberBrainiacV14-Feb-14 10:10 
GeneralRe: Transcendence PinmemberRafagaX16-Feb-14 11:40 
GeneralRe: Transcendence PinmemberSimon O'Riordan from UK16-Feb-14 23:54 
GeneralRe: Transcendence PinmemberC Grant Anderson17-Feb-14 10:12 
GeneralThat's rude, latest Adobe flash update Pinmember{dc7c68de-3931-43b9-9102-6dbe3972c5c3}13-Feb-14 5:02 
GeneralRe: That's rude, latest Adobe flash update PinmemberGregory.Gadow13-Feb-14 5:06 
GeneralRe: That's rude, latest Adobe flash update Pinmember{dc7c68de-3931-43b9-9102-6dbe3972c5c3}13-Feb-14 5:16 
GeneralRe: That's rude, latest Adobe flash update Pinmembertgrt13-Feb-14 6:08 
GeneralRe: That's rude, latest Adobe flash update PinprofessionalNicholas Marty13-Feb-14 5:18 
GeneralRe: That's rude, latest Adobe flash update PinprofessionalEddy Vluggen13-Feb-14 5:59 
GeneralRe: That's rude, latest Adobe flash update PinmemberJohann van der Smut13-Feb-14 19:22 
GeneralRe: That's rude, latest Adobe flash update Pinmemberjschell13-Feb-14 10:05 
GeneralRe: That's rude, latest Adobe flash update Pinmembersloosecannon14-Feb-14 9:24 
GeneralCoding Standards PinmemberMatt U.13-Feb-14 4: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:

/// <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:

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 PinmemberEnnis Ray Lynch, Jr.13-Feb-14 4:25 
GeneralRe: Coding Standards PinmemberMatt U.13-Feb-14 4:29 
GeneralRe: Coding Standards PinmemberKirk Wood14-Feb-14 16:40 
GeneralRe: Coding Standards PinmemberArgonia13-Feb-14 4:25 
GeneralRe: Coding Standards PinmemberMatt U.13-Feb-14 4:32 
GeneralRe: Coding Standards PinprofessionalMarco Bertschi13-Feb-14 4:34 
GeneralRe: Coding Standards PinmemberArgonia13-Feb-14 4:45 
GeneralRe: Coding Standards Pinmemberjschell13-Feb-14 10:09 
GeneralRe: Coding Standards PinmemberJohn Nurick14-Feb-14 2:25 
GeneralRe: Coding Standards Pinmemberjschell14-Feb-14 11:15 
GeneralRe: Coding Standards PinmemberGerry Schmitz14-Feb-14 11:15 
GeneralRe: Coding Standards Pinmemberjschell17-Feb-14 12:47 
GeneralRe: Coding Standards PinmemberShameel13-Feb-14 4:35 
GeneralRe: Coding Standards PinprofessionalKornfeld Eliyahu Peter13-Feb-14 4:40 
JokeRe: Coding Standards PinprofessionalRichard Deeming13-Feb-14 4:43 
GeneralRe: Coding Standards PinmemberMatt U.13-Feb-14 5:30 
GeneralRe: Coding Standards PinmemberJonathan C Dickinson13-Feb-14 22:44 
GeneralRe: Coding Standards PinprofessionalRichard Deeming14-Feb-14 1:27 
GeneralRe: Coding Standards PinprotectorPete O'Hanlon13-Feb-14 4:45 
GeneralRe: Coding Standards PinmemberMarkTJohnson13-Feb-14 4:50 
GeneralRe: Coding Standards PinmemberHobbyProggy13-Feb-14 4:58 
GeneralRe: Coding Standards [modified] Pinmemberwout de zeeuw13-Feb-14 4:58 
GeneralRe: Coding Standards PinmemberMatt U.13-Feb-14 5:32 
GeneralRe: Coding Standards PinmemberGregory.Gadow13-Feb-14 5:16 
GeneralRe: Coding Standards Pinmemberwout de zeeuw13-Feb-14 5:26 
GeneralRe: Coding Standards PinmemberMember 1008817113-Feb-14 9:54 
GeneralRe: Coding Standards Pinmemberjschell13-Feb-14 10:12 
GeneralRe: Coding Standards [modified] PinmemberMember 1008817113-Feb-14 10:35 
GeneralRe: Coding Standards Pinmemberjschell14-Feb-14 11:16 
GeneralRe: Coding Standards PinprofessionalS Houghtelin13-Feb-14 5:29 
AnswerRe: Coding Standards PinprofessionalRavi Bhavnani13-Feb-14 5:39 
GeneralRe: Coding Standards PinmemberMatt U.13-Feb-14 6:12 
GeneralRe: Coding Standards PinprofessionalDennis E White13-Feb-14 6:23 
GeneralRe: Coding Standards PinmemberMatt U.13-Feb-14 7:05 
GeneralRe: Coding Standards Pinmemberjschell13-Feb-14 10:07 
GeneralRe: Coding Standards PinmemberMatt U.13-Feb-14 11:37 

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

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


Advertise | Privacy | Mobile
Web03 | 2.8.150414.5 | Last Updated 25 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid