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
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Imma Switch, Imma Switch, Imma Imma Imma Switch

Imma Switch, Imma Switch, Imma Imma Imma Switch

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasecomregex
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AspDotNetDev
    wrote on last edited by
    #1

    Just came across this SQL stored procedure (decluttered and anonymized):

    CREATE PROCEDURE SomeProcedure
    @switch AS int
    AS
    BEGIN
    IF @switch = 1
    BEGIN
    -- Giant complicated SELECT on a single line.
    END
    ELSE
    BEGIN
    -- Another giant complicated SELECT on a single line.
    END
    END

    This pattern is repeated with many stored procedures. The variable "switch" was really called that and there were absolutely no comments of what that variable is supposed to toggle. At least the name hints that it toggles... surely I'd have been unable to figure that out from the IF statement. If this were a language with booleans, I'm certain they'd have named the variable "aBool". :doh:

    Thou mewling ill-breeding pignut!

    B 1 Reply Last reply
    0
    • A AspDotNetDev

      Just came across this SQL stored procedure (decluttered and anonymized):

      CREATE PROCEDURE SomeProcedure
      @switch AS int
      AS
      BEGIN
      IF @switch = 1
      BEGIN
      -- Giant complicated SELECT on a single line.
      END
      ELSE
      BEGIN
      -- Another giant complicated SELECT on a single line.
      END
      END

      This pattern is repeated with many stored procedures. The variable "switch" was really called that and there were absolutely no comments of what that variable is supposed to toggle. At least the name hints that it toggles... surely I'd have been unable to figure that out from the IF statement. If this were a language with booleans, I'm certain they'd have named the variable "aBool". :doh:

      Thou mewling ill-breeding pignut!

      B Offline
      B Offline
      Brisingr Aerowing
      wrote on last edited by
      #2

      :doh: Some people just should not be allowed near a computer.

      public class SysAdmin : Employee
      {

       public override void DoWork(IWorkItem workItem)
       {
            if (workItem.User.Type == UserType.NoLearn){
               throw new NoIWillNotFixYourComputerException(new Luser(workItem.User));
            }else{
                 base.DoWork(workItem);
            }
       }
      

      }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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