Tuesday, September 2, 2014

What Is Clean Code?

http://java.dzone.com/articles/what-clean-code-%E2%80%93-quotes
I like this one by Dave Thomas, founder of OTI and godfather of the Eclipse strategy:
It has unit and acceptance tests.
It has meaningful names.
It provides one way rather than many ways for doing one thing.
It has minimal dependencies, which are explicitly defined, and provides a clear and minimal API.
Code should be literate since, depending on the language, not all necessary information can be expressed clearly in code
alone

If programming languages were weapons

http://bjorn.tipling.com/if-programming-languages-were-weapons

C# is a powerful laser rifle strapped to a donkey, when taken off the donkey the laser doesn’t seem to work as well.

Monday, August 25, 2014

How to get sql query from LINQ?

Before getting linq data, using ToString method. Will see the generated SQL.
It is not easy to read and understand.

   var soldOutProducts = 
            from p in products 
            where p.UnitsInStock == 0;

   string sql =  soldOutProducts.ToString();