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. The Lounge
  3. Bad Programmina analogy

Bad Programmina analogy

Scheduled Pinned Locked Moved The Lounge
question
25 Posts 18 Posters 1 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.
  • C Chris Maunder

    Exactly. It's only been calculated to a trillion digits, and if you hardcode that and then someone calculates it to a quadrillion then you're going to feel a little silly having to update the value of pi each place you hardcoded it.

    cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #21

    Chris Maunder wrote:

    Exactly. It's only been calculated to a trillion digits, and if you hardcode that and then someone calculates it to a quadrillion then you're going to feel a little silly having to update the value of pi each place you hardcoded it.

    Isn't that what Search and Replace is for?

    Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004

    X 1 Reply Last reply
    0
    • L Lost User

      Chris Maunder wrote:

      Exactly. It's only been calculated to a trillion digits, and if you hardcode that and then someone calculates it to a quadrillion then you're going to feel a little silly having to update the value of pi each place you hardcoded it.

      Isn't that what Search and Replace is for?

      Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004

      X Offline
      X Offline
      Xiangyang Liu
      wrote on last edited by
      #22

      Michael Martin wrote:

      Isn't that what Search and Replace is for?

      Ok, let me see, search for a trillion digit value in your source files and replace it with a quadrillion digit value? When that is done your great great grandson will be born. :)

      My .NET Business Application Framework My Home Page My Younger Son & His "PET"

      B R 2 Replies Last reply
      0
      • X Xiangyang Liu

        Michael Martin wrote:

        Isn't that what Search and Replace is for?

        Ok, let me see, search for a trillion digit value in your source files and replace it with a quadrillion digit value? When that is done your great great grandson will be born. :)

        My .NET Business Application Framework My Home Page My Younger Son & His "PET"

        B Offline
        B Offline
        Brady Kelly
        wrote on last edited by
        #23

        The regex would be simple. :)

        1 Reply Last reply
        0
        • D Dario Solera

          Well you never know what could happen in the universe. That's fine assumption. I usually create constants for all the decimal digits 0-9 so that I can change the value if I need it.

          If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker My Photos/CP Flickr Group - ScrewTurn Wiki

          J Offline
          J Offline
          Joe Woodbury
          wrote on last edited by
          #24

          I worked with some guys who previously had some offshore developers actually do that after they were told to change the hardcoded numbers to constants. (So statements like x += 2; got changed to x += TWO;. It's fortunate they didn't use pi, else it would have become THREE_POINT_ONE_FOUR_ONE_FIVE_NINE.... )

          Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

          1 Reply Last reply
          0
          • X Xiangyang Liu

            Michael Martin wrote:

            Isn't that what Search and Replace is for?

            Ok, let me see, search for a trillion digit value in your source files and replace it with a quadrillion digit value? When that is done your great great grandson will be born. :)

            My .NET Business Application Framework My Home Page My Younger Son & His "PET"

            R Offline
            R Offline
            Rajesh R Subramanian
            wrote on last edited by
            #25

            Xiangyang Liu 刘向阳 wrote:

            When that is done your great great grandson will be born.

            Uh ooh... This is how babby is formed?!

            It is a crappy thing, but it's life -^ Carlo Pallini

            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