Reporting from the field, Zak tells us the sad story of a sysadmin who has been forced out of his comfort zone. When your sysadmin writes a bunch of scripts in Perl and then your company decides to switch to .NET, the job of converting the scripts will almost certainly fall to none other than the sysadmin. This will be the case even if said sysadmin doesn't know .NET.

When this happens, you will learn two things. The first is that the new .NET code will be structured as though it were Perl code, even where inappropriate. The second is that some functions that the sysadmin is used to will be unavailable, in a different namespace, or otherwise renamed.

 

  namespace Maintenance
  {
      /// 
      /// Summary description for Common.
      /// 
      public class Common
      {
          public Common()
          {
              //
              // TODO: Add constructor logic here
              //
          }

          /// ...

          public static void pause(double seconds)
          {
              DateTime PauseStartTime =
                Convert.ToDateTime(DateTime.Now.TimeOfDay.ToString());
              DateTime PauseEndTime =
                Convert.ToDateTime(PauseStartTime).AddSeconds(seconds);
              DateTime PauseNowTime =
                Convert.ToDateTime(DateTime.Now.TimeOfDay.ToString());

              while (PauseNowTime < PauseEndTime)
              {
                  PauseNowTime =
                    Convert.ToDateTime(DateTime.Now.TimeOfDay.ToString());
              }
          }
      }
  }
 

 

Zak says, "To be fair, the guy who coded this is technically not a developer. The interesting thing is that he figured out how to stop a windows service via code, but apparently didn't realize that Thread.Sleep() exists; either that or he doesn't think that its adequate."