Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Mardy Git

@Mardy Git
About
Posts
7
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • If in doubt: cast, cast and cast again
    M Mardy Git

    I didn't it's not my project. My colleague was traumatised by this and many other code-crimes in the project, I'm hoping he'll recover soon :laugh:

    The Weird and The Wonderful

  • If in doubt: cast, cast and cast again
    M Mardy Git

    My colleague found this and other horrors in a newish project. Bearing in mind that "Id" is a nullable int and result.ID is a regular int, who in their right mind would do this (object and function names have been changed to protect the incompetent):

    protected Thing populateThing(DataRow dr)
    {
    Thing result = new Thing();
    result.Id = int.Parse(dr["Id"].ToString());

    BTW, note no handling of the case when "Id" is DBNULL. You can stop laughing now.

    The Weird and The Wonderful

  • goto statement
    M Mardy Git

    Remember

    goto

    is a four letter word and bad things will happen if you use it...

    The Lounge csharp

  • Religious question - MVC benefits vs ASP.NET?
    M Mardy Git

    A couple of gigs ago, we replaced an admittedly bad ASP.Net site with an MVC4/Razor site. It was a handful of SPAs using partial views and Ajax post-backs. Blindingly fast and a much better user experience - go for it!

    The Lounge asp-net architecture question csharp database

  • Religious question - MVC benefits vs ASP.NET?
    M Mardy Git

    A couple of gigs ago, we replaced an admittedly bad ASP.Net site with an MVC4/Razor site. It was a handful of SPAs using partial views and Ajax post-backs. Blindingly fast and a much better user experience - go for it!

    The Lounge asp-net architecture question csharp database

  • Anyone see the problem here?
    M Mardy Git

    My colleague found this in some production code for a very well known company. I'm wondering what horrors we'll exhume next.

    The Weird and The Wonderful help question

  • Anyone see the problem here?
    M Mardy Git

    public class ErrorLogging
    {
    /// <summary>
    /// Insert into error log
    /// </summary>
    /// <param name="errorMessage"></param>
    /// <param name="errorTrace"></param>
    /// <param name="errorLocation"></param>
    public void insertErrorLog(string errorMessage, string errorTrace, string location)
    {
    int? errorID = 0;
    XXXXX_DataAccess.common.XXXXX_CMSTableAdapters.XXXXXCMS_TA ta = new common.XXXXX_CMSTableAdapters.XXXXXCMS_TA();

            try
            {
    
                ta.usp\_ErrorLogInsert(ref errorID, errorMessage, errorTrace, location);
    
            }
            catch (Exception ex)
            {
                ta.usp\_ErrorLogInsert(ref errorID, ex.Message, ex.StackTrace, "insertErrorLog - XXXXX\_DataAccess");
            }
        }
    }
    
    The Weird and The Wonderful help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups