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. array size

array size

Scheduled Pinned Locked Moved The Weird and The Wonderful
data-structures
16 Posts 12 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.
  • D darth_bug

    Nope, that's from a '20 year experienced' java developer. Found it in a still running webservice which receives orders from our website. This guy is no longer employed, but we have a lot of fun with his work.

    M Offline
    M Offline
    Mladen Jankovic
    wrote on last edited by
    #5

    darth_bug wrote:

    java developer

    That explains everything. ;P

    Mostly, when you see programmers, they aren't doing anything. One of the attractive things about programmers is that you cannot tell whether or not they are working simply by looking at them. Very often they're sitting there seemingly drinking coffee and gossiping, or just staring into space. What the programmer is trying to do is get a handle on all the individual and unrelated ideas that are scampering around in his head. (Charles M Strauss)

    1 Reply Last reply
    0
    • D darth_bug

      Nope, that's from a '20 year experienced' java developer. Found it in a still running webservice which receives orders from our website. This guy is no longer employed, but we have a lot of fun with his work.

      D Offline
      D Offline
      darkelv
      wrote on last edited by
      #6

      That explains the speed and at the same time why JRE is taking so much of RAM..... ;p

      1 Reply Last reply
      0
      • V Vasudevan Deepak Kumar

        CPallini wrote:

        Did your boss coded it?

        That is why he is a boss! :-D

        Vasudevan Deepak Kumar Personal Homepage
        Tech Gossips
        A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #7

        Definitely. :-D

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

        In testa che avete, signor di Ceprano?

        1 Reply Last reply
        0
        • D darth_bug

          int j=0; for (int i=0; i < a.length; ++i) { j++; } System.out.println("array size=" + j);

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

          Now you have me confused. Does this not show the correct array size when it is run? Seriously, who knows what he thought he was doing. Sometimes everyone does not see the forest anymore because of all the trees. Things like that have happened to me, usually after editing the code several times in a hurry, leaving senseless relics like this appears to be.

          A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.

          R Y 2 Replies Last reply
          0
          • L Lost User

            Now you have me confused. Does this not show the correct array size when it is run? Seriously, who knows what he thought he was doing. Sometimes everyone does not see the forest anymore because of all the trees. Things like that have happened to me, usually after editing the code several times in a hurry, leaving senseless relics like this appears to be.

            A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.

            R Offline
            R Offline
            Rage
            wrote on last edited by
            #9

            CDP1802 wrote:

            Does this not show the correct array size when it is run

            Actually, it does. But I think the probability that j is equal to a.length at the end of the loop is very high.

            ~RaGE();

            I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
            Do not feed the troll ! - Common proverb

            L 1 Reply Last reply
            0
            • D darth_bug

              Nope, that's from a '20 year experienced' java developer. Found it in a still running webservice which receives orders from our website. This guy is no longer employed, but we have a lot of fun with his work.

              K Offline
              K Offline
              KarstenK
              wrote on last edited by
              #10

              20 years "experience" means also 20 years of not getting a promotion (getting boss or manager) :wtf: By the way I have also a lot of "experience" in that way...

              Greetings from Germany

              1 Reply Last reply
              0
              • R Rage

                CDP1802 wrote:

                Does this not show the correct array size when it is run

                Actually, it does. But I think the probability that j is equal to a.length at the end of the loop is very high.

                ~RaGE();

                I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
                Do not feed the troll ! - Common proverb

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

                I sure know that. Irony does not communicate well in a post :-))) To me it just looks like the loop previously contained some code which got edited away, leaving this construction. Even then, using the counter variable may be a valid, but not very wise choice.

                A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.

                1 Reply Last reply
                0
                • L Lost User

                  Now you have me confused. Does this not show the correct array size when it is run? Seriously, who knows what he thought he was doing. Sometimes everyone does not see the forest anymore because of all the trees. Things like that have happened to me, usually after editing the code several times in a hurry, leaving senseless relics like this appears to be.

                  A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.

                  Y Offline
                  Y Offline
                  Yusuf
                  wrote on last edited by
                  #12

                  CDP1802 wrote:

                  Does this not show the correct array size when it is run?

                  never ever trust CLR. Who knows if it right about the array size...

                  Yusuf

                  V A L V 4 Replies Last reply
                  0
                  • Y Yusuf

                    CDP1802 wrote:

                    Does this not show the correct array size when it is run?

                    never ever trust CLR. Who knows if it right about the array size...

                    Yusuf

                    V Offline
                    V Offline
                    vobject
                    wrote on last edited by
                    #13

                    Hahaha, classic :D

                    1 Reply Last reply
                    0
                    • Y Yusuf

                      CDP1802 wrote:

                      Does this not show the correct array size when it is run?

                      never ever trust CLR. Who knows if it right about the array size...

                      Yusuf

                      A Offline
                      A Offline
                      Andrew Rissing
                      wrote on last edited by
                      #14

                      Yeah, we can only hope you don't trust the processor to handle your computations either - I made that mistake a long time ago. I handle all of mine now at the binary level.

                      1 Reply Last reply
                      0
                      • Y Yusuf

                        CDP1802 wrote:

                        Does this not show the correct array size when it is run?

                        never ever trust CLR. Who knows if it right about the array size...

                        Yusuf

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

                        Now that you mention it... taken to the extreme this means building your own processor from discrete parts, building the rest of the computer the same way around it and then starting on an own operating system. This will be one slow and bulky contraption, so much is sure. Never trust a computer that you have not personally misconstructed and misprogrammed, like in the good old days.

                        A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.

                        1 Reply Last reply
                        0
                        • Y Yusuf

                          CDP1802 wrote:

                          Does this not show the correct array size when it is run?

                          never ever trust CLR. Who knows if it right about the array size...

                          Yusuf

                          V Offline
                          V Offline
                          VentsyV
                          wrote on last edited by
                          #16

                          Reminds me of "The story of Mel" : I had been hired to write a Fortran compiler for this new marvel and Mel was my guide to its wonders. Mel didn't approve of compilers. "If a program can't rewrite its own code," he asked, "what good is it?"

                          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