Showing posts with label WTF. Show all posts
Showing posts with label WTF. Show all posts

Thursday, 26 January 2012

ProgrammerFail–N Layered Architecture

What is wrong with the following code?

using (SqlDataReader dr = ...)

At the first look, it seems perfect but:

  • N layered architecture
  • Layers are: DAO –> Factory –> BL –>WebApp

 

And this code with the previous row:

protected void ddlUnits_SelectedIndexChanged(object sender, EventArgs e)
        {
            using (SqlDataReader dr = ...)

ProgrammerFail

!!!FAIL!!!

Tuesday, 27 September 2011

Not every man should be a computer programmer

 

The question is only that: Why???

 

Code Snippet
  1. catch (Exception ex)
  2. {
  3.     if ((ex.GetType().ToString() == "System.Data.SqlClient.SqlException") && ex.Message.LastIndexOf("Timeout expired") >= 0)
  4.     {
  5.        /// Secret code
  6.     }
  7.     else
  8.         throw ex;
  9. }

Why the hell he doesn’t go and play football instead of programming?