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. Silly?!!

Silly?!!

Scheduled Pinned Locked Moved The Lounge
question
46 Posts 20 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.
  • S Shog9 0

    Jeremy Falcon wrote:

    Most people tend to throw them around as if they are candy.

    What, like they're cheap? :rolleyes:

    ---- Scripts i’ve known... CPhog 1.8.2 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums

    J Offline
    J Offline
    Jeremy Falcon
    wrote on last edited by
    #16

    Maybe I should start a Variable Financing company.

    Jeremy Falcon

    1 Reply Last reply
    0
    • J Jeremy Falcon

      Christian Graus wrote:

      I think it's good form to declare variables where you're going to use them, to limit their scope.

      Me too, and C doesn't stop you from doing that. Every block has their own scope. If you need to limit the scope of a variable then surround it in a new block. But, in my experience I've seen that declaring variables on the fly as you need them (generalizing) tends to lead to wasting them.

      Jeremy Falcon

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #17

      Jeremy Falcon wrote:

      If you need to limit the scope of a variable then surround it in a new block.

      I really wish more people would do that. There are still far too many methods around that start out with a page of local variable definitions. X|

      ---- Scripts i’ve known... CPhog 1.8.2 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums

      J 1 Reply Last reply
      0
      • S Shog9 0

        Jeremy Falcon wrote:

        If you need to limit the scope of a variable then surround it in a new block.

        I really wish more people would do that. There are still far too many methods around that start out with a page of local variable definitions. X|

        ---- Scripts i’ve known... CPhog 1.8.2 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums

        J Offline
        J Offline
        Jeremy Falcon
        wrote on last edited by
        #18

        Shog9 wrote:

        There are still far too many methods around that start out with a page of local variable definitions.

        Well, you could look at it like the table of contents for a fine novel. :-D

        Jeremy Falcon

        1 Reply Last reply
        0
        • N Nader Elshehabi

          Hello A silly question.. Just for the sake of sharing funny memories. What is the most funny, silly, ridiculous programming mistake you ever made??:-D Also if anybody has nice memories from the old times -when the OS was loaded each time from a 5.25" disk-, please post it. I can't seem to remember any of mine at the moment;P, but I'll sure post anything I remember. Regards:rose:

          E Offline
          E Offline
          Ennis Ray Lynch Jr
          wrote on last edited by
          #19

          I installed a floppy drive cable upside down and spent 10 minutes figuring out why it kept corrupting the disk. As for programming I tend to not make silly mistakes. Sure I have my share of simple WTF's but those I usually fix without much fanfare. I suppose my biggest and silliest mistake was my first VB6 app that I was contracted to work. It was so bad that I rewrote most of it for free even though the original satisfied the wording on the contract.

          A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane

          N 1 Reply Last reply
          0
          • N Nader Elshehabi

            Hello A silly question.. Just for the sake of sharing funny memories. What is the most funny, silly, ridiculous programming mistake you ever made??:-D Also if anybody has nice memories from the old times -when the OS was loaded each time from a 5.25" disk-, please post it. I can't seem to remember any of mine at the moment;P, but I'll sure post anything I remember. Regards:rose:

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

            I don't know how silly it is, but several years ago I was reviewing my "bag o' tricks", a C++ class library I'd built up over the years to cover all sorts of things. I kept coming back to a piece of code in one class that really bugged me. It seemed so badly done. There was a cryptic comment about it working, but it still bugged me. Finally, I had enough and spent a day rewriting code until I hit some stumbling blocks and simultaneously started having deja vu about what I was doing. I pressed on until it hit me; I'd tried this before and ended up in the same dead end; I'm not talking a similar dead end, but the exact same intractable problem. This time, after I rolled the code back, I put a comment block that warned me about ever trying to rewrite the code again. * * * The next one wasn't my doing, but too funny to leave out. I was running BoundsChecker on some code and getting horrible resource and memory leaks. I was stunned. Further examination found dozens of "new"s without any "delete"s all done by the same guy, who was otherwise a good developer. Then it hit me: for the previous two years he'd been doing C# programming and when he switched back to C++ he forgot there was no garbage collector. He later confirmed the same thing.

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

            C 1 Reply Last reply
            0
            • N Nader Elshehabi

              Hello A silly question.. Just for the sake of sharing funny memories. What is the most funny, silly, ridiculous programming mistake you ever made??:-D Also if anybody has nice memories from the old times -when the OS was loaded each time from a 5.25" disk-, please post it. I can't seem to remember any of mine at the moment;P, but I'll sure post anything I remember. Regards:rose:

              M Offline
              M Offline
              Michael A Barnhart
              wrote on last edited by
              #21

              Nader Elshehabi wrote:

              Also if anybody has nice memories from the old times

              Well, it was better than the paper tape option. I did not like the 75 minute compile times (with me swapping the floppies in the 4 drives used for scratch space.

              Nader Elshehabi wrote:

              ridiculous programming mistake

              Well, maybe not my mistake but impacted by it. This was on an IBM 360 mainframe. Some one set a global function and called it "X". So every program that used X (and yes my error to let type just default - it was fortran) suddenly just was not behaving right. That debug map just did not make sense :)

              1 Reply Last reply
              0
              • N Nader Elshehabi

                Hello A silly question.. Just for the sake of sharing funny memories. What is the most funny, silly, ridiculous programming mistake you ever made??:-D Also if anybody has nice memories from the old times -when the OS was loaded each time from a 5.25" disk-, please post it. I can't seem to remember any of mine at the moment;P, but I'll sure post anything I remember. Regards:rose:

                G Offline
                G Offline
                Gary Kirkham
                wrote on last edited by
                #22

                I dropped my stack of un-numbered FORTRAN punch cards...took me half a day to put them back in order.

                Gary Kirkham Forever Forgiven and Alive in the Spirit He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot Me blog, You read

                M J G 3 Replies Last reply
                0
                • J Joe Woodbury

                  I don't know how silly it is, but several years ago I was reviewing my "bag o' tricks", a C++ class library I'd built up over the years to cover all sorts of things. I kept coming back to a piece of code in one class that really bugged me. It seemed so badly done. There was a cryptic comment about it working, but it still bugged me. Finally, I had enough and spent a day rewriting code until I hit some stumbling blocks and simultaneously started having deja vu about what I was doing. I pressed on until it hit me; I'd tried this before and ended up in the same dead end; I'm not talking a similar dead end, but the exact same intractable problem. This time, after I rolled the code back, I put a comment block that warned me about ever trying to rewrite the code again. * * * The next one wasn't my doing, but too funny to leave out. I was running BoundsChecker on some code and getting horrible resource and memory leaks. I was stunned. Further examination found dozens of "new"s without any "delete"s all done by the same guy, who was otherwise a good developer. Then it hit me: for the previous two years he'd been doing C# programming and when he switched back to C++ he forgot there was no garbage collector. He later confirmed the same thing.

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

                  C Offline
                  C Offline
                  Chris Losinger
                  wrote on last edited by
                  #23

                  Joe Woodbury wrote:

                  I put a comment block that warned me about ever trying to rewrite the code again

                  yeah, i have a couple of those. "DONT TOUCH THIS! it might look like you can do XYZ but you've already tried that. just leave it alone!"

                  image processing | blogging

                  1 Reply Last reply
                  0
                  • N Nader Elshehabi

                    Hello A silly question.. Just for the sake of sharing funny memories. What is the most funny, silly, ridiculous programming mistake you ever made??:-D Also if anybody has nice memories from the old times -when the OS was loaded each time from a 5.25" disk-, please post it. I can't seem to remember any of mine at the moment;P, but I'll sure post anything I remember. Regards:rose:

                    C Offline
                    C Offline
                    Chris Losinger
                    wrote on last edited by
                    #24

                    not too long ago i was writing some SQL to do an Update. i got the fields and values part of the query finished, then decided to try it out. yay! :cool: i hadn't put on the "Where" part yet, of course. :omg: it wrecked every row in the table (all 13,000 of them). :((

                    image processing | blogging

                    1 Reply Last reply
                    0
                    • G Gary Kirkham

                      I dropped my stack of un-numbered FORTRAN punch cards...took me half a day to put them back in order.

                      Gary Kirkham Forever Forgiven and Alive in the Spirit He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot Me blog, You read

                      M Offline
                      M Offline
                      Michael A Barnhart
                      wrote on last edited by
                      #25

                      Gary Kirkham wrote:

                      I dropped my stack of un-numbered FORTRAN punch cards

                      At which time you either remembered to draw a diagonal with a felt marker. Or did number them. :) We had fun one day. Took some random cards and substituded a guys box when he was not looking (with an appolgy note for knocking them off the table. :rolleyes: )

                      G 1 Reply Last reply
                      0
                      • G Gary Kirkham

                        I dropped my stack of un-numbered FORTRAN punch cards...took me half a day to put them back in order.

                        Gary Kirkham Forever Forgiven and Alive in the Spirit He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot Me blog, You read

                        J Offline
                        J Offline
                        Jorgen Sigvardsson
                        wrote on last edited by
                        #26

                        That's an uuh.. unconventional programming error. (At least in my mindset :-D)

                        -- Bender's humor by Microsoft Joke

                        G 1 Reply Last reply
                        0
                        • R RC_Sebastien_C

                          I asked a programming question in the Lounge once

                          C Offline
                          C Offline
                          cechode
                          wrote on last edited by
                          #27

                          THE BEST ONE YET !!!!!

                          J 1 Reply Last reply
                          0
                          • C cechode

                            THE BEST ONE YET !!!!!

                            J Offline
                            J Offline
                            Jeremy Falcon
                            wrote on last edited by
                            #28

                            I'm debating if that's a good thing or a bad thing. :->

                            Jeremy Falcon

                            1 Reply Last reply
                            0
                            • M Michael A Barnhart

                              Gary Kirkham wrote:

                              I dropped my stack of un-numbered FORTRAN punch cards

                              At which time you either remembered to draw a diagonal with a felt marker. Or did number them. :) We had fun one day. Took some random cards and substituded a guys box when he was not looking (with an appolgy note for knocking them off the table. :rolleyes: )

                              G Offline
                              G Offline
                              Gary Kirkham
                              wrote on last edited by
                              #29

                              I think all the ones after that were numbered. ;)

                              Gary Kirkham Forever Forgiven and Alive in the Spirit He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot Me blog, You read

                              1 Reply Last reply
                              0
                              • J Jorgen Sigvardsson

                                That's an uuh.. unconventional programming error. (At least in my mindset :-D)

                                -- Bender's humor by Microsoft Joke

                                G Offline
                                G Offline
                                Gary Kirkham
                                wrote on last edited by
                                #30

                                Listen Sonny, back in my day programmers were real men, able to lug around 50 pound boxes of punch cards under each arm and not break a sweat. Not like you sissy latte drinking "software developers" today. ;P

                                Gary Kirkham Forever Forgiven and Alive in the Spirit He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot Me blog, You read

                                M N 2 Replies Last reply
                                0
                                • N Nader Elshehabi

                                  Hello A silly question.. Just for the sake of sharing funny memories. What is the most funny, silly, ridiculous programming mistake you ever made??:-D Also if anybody has nice memories from the old times -when the OS was loaded each time from a 5.25" disk-, please post it. I can't seem to remember any of mine at the moment;P, but I'll sure post anything I remember. Regards:rose:

                                  G Offline
                                  G Offline
                                  Graham Shanks
                                  wrote on last edited by
                                  #31

                                  Nader Elshehabi wrote:

                                  Also if anybody has nice memories from the old times -when the OS was loaded each time from a 5.25" disk

                                  OK, if these are old times, what about when you loaded the OS from paper tape (actually using the keys on the front of the computer to load a paper tape containing the loader program, which was then used to load the OS). The times when patching a program meant covering up holes in the paper tape by little bits of paper (come on, fess up - how many people have done this?). The times when you could tell what program the computer was running by the noises they made. The times when a programming competition meant writing a program that did something as well as playing a recognisable tune on the computer After that came 8" floppy disks: 5.25" disks - luxury

                                  Graham My signature is not black, just a very, very dark blue

                                  M S 2 Replies Last reply
                                  0
                                  • G Gary Kirkham

                                    Listen Sonny, back in my day programmers were real men, able to lug around 50 pound boxes of punch cards under each arm and not break a sweat. Not like you sissy latte drinking "software developers" today. ;P

                                    Gary Kirkham Forever Forgiven and Alive in the Spirit He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot Me blog, You read

                                    M Offline
                                    M Offline
                                    Michael A Barnhart
                                    wrote on last edited by
                                    #32

                                    Gary Kirkham wrote:

                                    not break a sweat.

                                    You could not afford to. Ever try to feed a sweaty punch card in the reader. X|

                                    G 2 Replies Last reply
                                    0
                                    • G Graham Shanks

                                      Nader Elshehabi wrote:

                                      Also if anybody has nice memories from the old times -when the OS was loaded each time from a 5.25" disk

                                      OK, if these are old times, what about when you loaded the OS from paper tape (actually using the keys on the front of the computer to load a paper tape containing the loader program, which was then used to load the OS). The times when patching a program meant covering up holes in the paper tape by little bits of paper (come on, fess up - how many people have done this?). The times when you could tell what program the computer was running by the noises they made. The times when a programming competition meant writing a program that did something as well as playing a recognisable tune on the computer After that came 8" floppy disks: 5.25" disks - luxury

                                      Graham My signature is not black, just a very, very dark blue

                                      M Offline
                                      M Offline
                                      Michael A Barnhart
                                      wrote on last edited by
                                      #33

                                      Graham Shanks wrote:

                                      After that

                                      You skipped a few machines that used compact cassettes (and no I am not talking about the Vic-20's!) such as the Wang 700 series.

                                      G 1 Reply Last reply
                                      0
                                      • E Ennis Ray Lynch Jr

                                        I installed a floppy drive cable upside down and spent 10 minutes figuring out why it kept corrupting the disk. As for programming I tend to not make silly mistakes. Sure I have my share of simple WTF's but those I usually fix without much fanfare. I suppose my biggest and silliest mistake was my first VB6 app that I was contracted to work. It was so bad that I rewrote most of it for free even though the original satisfied the wording on the contract.

                                        A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane

                                        N Offline
                                        N Offline
                                        Nader Elshehabi
                                        wrote on last edited by
                                        #34

                                        I still remember my first VB application. After spending two monthes programming it, it crashed on the first demo. Lucky for me it was for my brother.;P

                                        1 Reply Last reply
                                        0
                                        • M Michael A Barnhart

                                          Gary Kirkham wrote:

                                          not break a sweat.

                                          You could not afford to. Ever try to feed a sweaty punch card in the reader. X|

                                          G Offline
                                          G Offline
                                          Gary Kirkham
                                          wrote on last edited by
                                          #35

                                          Michael A. Barnhart wrote:

                                          Ever try to feed a sweaty punch card in the reader.

                                          Nope, they had operators for that. Wouldn't even let us in the room...had to pass the card decks through a window.

                                          Gary Kirkham Forever Forgiven and Alive in the Spirit He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot Me blog, You read

                                          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