0 Replies - 2420 Views - Last Post: 28 July 2015 - 03:16 PM Rate Topic: -----

#1 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5884
  • View blog
  • Posts: 20,085
  • Joined: 05-May 12

And the nightmare continues...

Posted 28 July 2015 - 03:16 PM

More nightmares from the code base that I inherited:
public class Foo : IFoo
{
    public List<string> TmpFields = new List<string>();
    public List<string> GroupFields;

    public Foo()
    {
        Loaded = true;
        Query = "";
    }

    :
}



After the WTF?!?! caused by the public members, and one being initialized while the other is not, I was pulling my hair out trying to figure out where the hell Loaded and Query got implemented because Foo inherits from IFoo.

Well, I finally managed to look at the code in a real text editor rather than notepad and jumped to the definitions. Apparently somebody decided to go against convention and declare this:
public abstract class IFoo
{
    public bool Loaded;
    public string Query;

    :
}



WTF?!?! If it's not an interface, don't use the naming convention for interfaces! Forgive me if I'm having fantasies of 2x4's and dark alleys. I don't understand how I consistently get stack ranked below this guy every review season. :(/>

Is This A Good Question/Topic? 4
  • +

Page 1 of 1