Don't know if disgruntled...



  •  ...or just joking. At least, for once, this snippet is well indented.

     

    public bool IsEdited(string fileId)
    {
        string SQL;
        bool assHole=false;
        SQL="SELECT EDITED FROM FILES WHERE FILE_ID=" + fileId;
        IDataReader dr = DBHelpers.executeReader(SQL,_connectionStringOracle,_databaseType);
        try
        {
            dr.Read();
            if(dr["EDITED"].ToString().Equals("1"))
            {
                //return true;
                assHole=true;
            }
            /*else
            {
                return false;
            }*/
           
        }
        catch(Exception ex)
        {
            _errMessage=ex.Message;
            //return false;
        }
        /*
        finally
        {
            dr.Close();
        }
        */
        return assHole;
    }

     

    EDIT: Actually it's not my code. I just wanted to clarify, just in case.



  •  @Dark Helmet said:

        bool assHole=false;

    I knew it, I'm surrounded by assholes...

     

     @Dark Helmet said:

        return assHole;

    KEEP FIRING, ASSHOLES!

     

     

     



  • @gobes said:

        /*
        finally
        {
            dr.Close();
        }
        */

    Yeah, freeing resources is overrated.

    Sounds like someone required to have a single point of return, and the original dev wasn't happy he had to introduce a new variable. Note that "someone" might equal to "the compiler that thought the return value would be undefined in certain cases". I'm really not sure what the removal of the finally clause is all about though...


Log in to reply