Monthly Archives: March 2014

Link

Property Selectors and Expressions

This is a recommended read to solve a very common advanced topic: using selectors to retrieve a Getter and a Setter of a property 🙂

Advertisements

My naming conventions are exactly the @ReSharper defaults except for one thing…

… those  ugly underscores in private members! 

No more “_name” or “_isAvailable”. It feels horrible. Why do we have automatic tools, IntelliSense and ReSharper itself? We can immediately interpret the scope of any variable with having to look at the name. In fact, if you follow the Clean Code rules, you will hardly have 3 parameters. And ultimately, you have the “this” keyword, that is there for something.

I stopped using the as soon I realized my methods where short that I didn’t need to distinguish my members with any prefix.

Do you think the same? I would like to hear your opinion. Do you use underscores to prefix private members? 🙂

Aberratio-Code: De lo peorcito que he visto en mi vida

Atentos al fragmento, porque no tiene desperdicio.

  /*Dado que los flags son un int, almacenamos en un array en binario los flags*/
        private void _convertIntToArray(int number)
        {
            string binary = Convert.ToString(number, 2);
            int cont = binary.Length - 1;
            for (int i = 3; i >= 0; i--)
            {
                try
                {
                    sflags[i] = binary[cont];
                }
                catch (Exception)
                {
                    sflags[i] = '0';
                }
                cont--;
            }
        }

Aberración