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. Gender doesn't matter

Gender doesn't matter

Scheduled Pinned Locked Moved The Weird and The Wonderful
9 Posts 8 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.
  • T Offline
    T Offline
    T Pat
    wrote on last edited by
    #1

    Few days back I came across following code

    if(gender.contains('male'))
    {
    DoMaleThing();
    }
    else
    {
    DoFemaleThing();
    }

    Was not sure whether my colleague was knowing that 'female' option also contains 'male' in it. Had a great laugh with my TL when I showed him this. :laugh:

    Do not go where the path may lead. Go instead where there is no path and leave a trail.

    N J B N Z 5 Replies Last reply
    0
    • T T Pat

      Few days back I came across following code

      if(gender.contains('male'))
      {
      DoMaleThing();
      }
      else
      {
      DoFemaleThing();
      }

      Was not sure whether my colleague was knowing that 'female' option also contains 'male' in it. Had a great laugh with my TL when I showed him this. :laugh:

      Do not go where the path may lead. Go instead where there is no path and leave a trail.

      N Offline
      N Offline
      Nicholas Marty
      wrote on last edited by
      #2

      Well... Didn't you know it would have been discriminating otherwise ;P

      T 1 Reply Last reply
      0
      • T T Pat

        Few days back I came across following code

        if(gender.contains('male'))
        {
        DoMaleThing();
        }
        else
        {
        DoFemaleThing();
        }

        Was not sure whether my colleague was knowing that 'female' option also contains 'male' in it. Had a great laugh with my TL when I showed him this. :laugh:

        Do not go where the path may lead. Go instead where there is no path and leave a trail.

        J Offline
        J Offline
        Jorgen Andersson
        wrote on last edited by
        #3

        If you put some effort to it you can mess up an enum too.

        Wrong is evil and must be defeated. - Jeff Ello[^]

        1 Reply Last reply
        0
        • N Nicholas Marty

          Well... Didn't you know it would have been discriminating otherwise ;P

          T Offline
          T Offline
          T Pat
          wrote on last edited by
          #4

          Ohh..now I understood the code who wrote this is a lady :doh:

          Do not go where the path may lead. Go instead where there is no path and leave a trail.

          1 Reply Last reply
          0
          • T T Pat

            Few days back I came across following code

            if(gender.contains('male'))
            {
            DoMaleThing();
            }
            else
            {
            DoFemaleThing();
            }

            Was not sure whether my colleague was knowing that 'female' option also contains 'male' in it. Had a great laugh with my TL when I showed him this. :laugh:

            Do not go where the path may lead. Go instead where there is no path and leave a trail.

            B Offline
            B Offline
            Bernhard Hiller
            wrote on last edited by
            #5

            Lost in translation? It would work in most other languages. Also, he could consider: ladies first!

            1 Reply Last reply
            0
            • T T Pat

              Few days back I came across following code

              if(gender.contains('male'))
              {
              DoMaleThing();
              }
              else
              {
              DoFemaleThing();
              }

              Was not sure whether my colleague was knowing that 'female' option also contains 'male' in it. Had a great laugh with my TL when I showed him this. :laugh:

              Do not go where the path may lead. Go instead where there is no path and leave a trail.

              N Offline
              N Offline
              Nagy Vilmos
              wrote on last edited by
              #6

              Years ago, I worked on a pension system and one of the calculations was to find the retirement age, the standard function was [converted to C# as I can't remember Prolog]:

              int normalRetirementAge()
              {
              if (isMale())
              {
              return 65;
              }
              else
              {
              return 60;
              }
              }

              Now, one client had everyone on their scheme retire at 60 irrespective of sex, the proposed solution by the PFY:

              int normalRetirementAge()
              {
              if (isMale())
              {
              return 60;
              }
              else
              {
              return 60;
              }
              }

              :confused:

              speramus in juniperus

              B 1 Reply Last reply
              0
              • T T Pat

                Few days back I came across following code

                if(gender.contains('male'))
                {
                DoMaleThing();
                }
                else
                {
                DoFemaleThing();
                }

                Was not sure whether my colleague was knowing that 'female' option also contains 'male' in it. Had a great laugh with my TL when I showed him this. :laugh:

                Do not go where the path may lead. Go instead where there is no path and leave a trail.

                Z Offline
                Z Offline
                ZurdoDev
                wrote on last edited by
                #7

                :thumbsup: :) That's funny. Perhaps it's like mailman. Could be either male or female. :)

                There are only 10 types of people in the world, those who understand binary and those who don't.

                M 1 Reply Last reply
                0
                • N Nagy Vilmos

                  Years ago, I worked on a pension system and one of the calculations was to find the retirement age, the standard function was [converted to C# as I can't remember Prolog]:

                  int normalRetirementAge()
                  {
                  if (isMale())
                  {
                  return 65;
                  }
                  else
                  {
                  return 60;
                  }
                  }

                  Now, one client had everyone on their scheme retire at 60 irrespective of sex, the proposed solution by the PFY:

                  int normalRetirementAge()
                  {
                  if (isMale())
                  {
                  return 60;
                  }
                  else
                  {
                  return 60;
                  }
                  }

                  :confused:

                  speramus in juniperus

                  B Offline
                  B Offline
                  BillW33
                  wrote on last edited by
                  #8

                  Sure, gotta leave the if/else logic in there in case it is needed later. ;) :laugh:

                  Just because the code works, it doesn't mean that it is good code.

                  1 Reply Last reply
                  0
                  • Z ZurdoDev

                    :thumbsup: :) That's funny. Perhaps it's like mailman. Could be either male or female. :)

                    There are only 10 types of people in the world, those who understand binary and those who don't.

                    M Offline
                    M Offline
                    Matt T Heffron
                    wrote on last edited by
                    #9

                    RyanDev wrote:

                    Perhaps it's like mailman.

                    which evolved to "letter carrier" (because "mailperson" still sounds like it is referring to "male") like "stewardess" became "flight attendant"

                    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