Jump to content

DianeLeigh

Member
  • Posts

    26
  • Joined

  • Last visited

Reputation Activity

  1. Funny
    DianeLeigh got a reaction from Hi P in Code readability vs length   
    All code that I have (shy of "why the hell is this not working.... " quick if/stop/breakpoint/debug outputs that look like crap but are obviously there for that), has comments and is named so you at least know what it's for.
     
    This is actual "Debugging code for a test app" that I have:
    // Debug code WMICalls wmi = new WMICalls(); string[] servers = ConfigurationManager.AppSettings["servers"].ToString().Split(','); for (int i = 0; i < servers.Count(); i++) { wmi.GetDriveFreeSpace(WMIModules.Win32_LogicalDisk, servers[i].Trim(' ')); } wmi.SendMail("myemail@mydomain.com"); Inside the script I have functions called "AddToBody" (for the e-mail body--but there's only one body, and it's a variable, so obvious).
     
    Now shy of one program that has a class of over 2000 lines (that makes 2 pdfs that is a mission critical app--so it's a bit harder to "clean up" as it doesn't follow my current module-based function for reusable code--it STILL does in an extent.  But it's a {insert word of choice} trying to figure out what lines do, even with commenting just because it's a cluster of calculaations of cross-database values modifying locations on a pdf, calling multiple classes.... Basically it was a "test program" that "omg it works like we want!" and ended up being live.... so... yea... don't recommend that happening.
     
    But you get the point hopefully.  
×