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. It's duplicated, too lazy to fix.

It's duplicated, too lazy to fix.

Scheduled Pinned Locked Moved The Weird and The Wonderful
data-structureshelp
7 Posts 3 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.
  • C Offline
    C Offline
    CocusArg
    wrote on last edited by
    #1

    'i've added that, although duplication of process (because im loading stuff)
    ' lets see
    Select Case ListIT
    Case 1: nList = oArti.List1
    Case 2: nList = oArti.List2
    Case 3: nList = oArti.List3
    Case 4: nList = oArti.List4
    Case 5: nList = oArti.List5
    Case 6: nList = oArti.List6
    Case 7: nList = oArti.List7
    Case 8: nList = oArti.List8
    Case 9: nList = oArti.List9
    Case Else
    'in theory, it should never came here
    nList = 1
    End Select

    I think, array is a vulgar word for someone. Funny thing, I didn't understood what in the name of lord does that (variables were not descriptive about content they have) Also, funny comments! :laugh: (code was originally written in spanish)

    A 1 Reply Last reply
    0
    • C CocusArg

      'i've added that, although duplication of process (because im loading stuff)
      ' lets see
      Select Case ListIT
      Case 1: nList = oArti.List1
      Case 2: nList = oArti.List2
      Case 3: nList = oArti.List3
      Case 4: nList = oArti.List4
      Case 5: nList = oArti.List5
      Case 6: nList = oArti.List6
      Case 7: nList = oArti.List7
      Case 8: nList = oArti.List8
      Case 9: nList = oArti.List9
      Case Else
      'in theory, it should never came here
      nList = 1
      End Select

      I think, array is a vulgar word for someone. Funny thing, I didn't understood what in the name of lord does that (variables were not descriptive about content they have) Also, funny comments! :laugh: (code was originally written in spanish)

      A Offline
      A Offline
      Andrei Straut
      wrote on last edited by
      #2

      CocusArg wrote:

      'in theory, it should never came here

      I've learned that placing such a comment will make your code go to any lengths (apparently even changing variable values out-of-the-blue) to take that path... Also, speaking of funny comments, my colleague found this little gem in a PHP script:

      //Do this the old-fashioned way, i don't trust PHP's 'i++'
      $i = $i + 1;

      Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.

      L 1 Reply Last reply
      0
      • A Andrei Straut

        CocusArg wrote:

        'in theory, it should never came here

        I've learned that placing such a comment will make your code go to any lengths (apparently even changing variable values out-of-the-blue) to take that path... Also, speaking of funny comments, my colleague found this little gem in a PHP script:

        //Do this the old-fashioned way, i don't trust PHP's 'i++'
        $i = $i + 1;

        Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.

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

        What do you have against PHP? It's soooo easy to learn and it has been used for soooo many big projects.

        At least artificial intelligence already is superior to natural stupidity

        A 1 Reply Last reply
        0
        • L Lost User

          What do you have against PHP? It's soooo easy to learn and it has been used for soooo many big projects.

          At least artificial intelligence already is superior to natural stupidity

          A Offline
          A Offline
          Andrei Straut
          wrote on last edited by
          #4

          Yes, and at the same time, it makes it awwwwwwfully easy to code badly. You can code badly in absolutely any language, but bad code written in PHP just.has.that.special.flavor. [rant start] Now, assume we have some code (PHP) along the lines of:

          $invoice_no = 1;

          //some code

          //Then someone comes who does not read docs, or has no idea that invoice_no should be an int, and does something with the following effect:
          $invoice_no = $invoice_no . 'INV_123#';

          //Some other code
          return $invoice_no;

          Now, try to do this in Java for instance:

          int invoice_no = 1;
          invoice_no = invoice_no + "INV_123#";
          return invoice_no;

          The compiler would be all over the place, screaming like a newborn baby. And that's just off the top of my head. And speaking of compiler and autocomplete, how about contructs like:

          $invoice_no = 'Whatever';

          //Code

          return $invoiceno; //first occurrence of $invoiceno, the IDE doesn't complain about it, is undefined, but you sucker will only know at runtime, from a !!!Notice!!!

          Or that you can't really enforce a type parameter on a method (of course, there's get_class, but you'll only know about it at runtime). Or autocomplete. I'a big fan of autocomplete. Now, I've done PHP with both Eclipse and Netbeans. Try to get autocomplete for something like:

          $db = DatabaseService::getInstance();
          $line = $db->getPoLineById($line_id);
          $product = $db->searchProduct('id', $line->getProductId()); //This is where the magic ends. No autocomplete for 'line->'

          Or debugging. var_dump, really? Now, I know there's XDebug, but try using that in a 4GB PHP project (I'm talking about a Magento website). Good luck with that. [rant end] Now, I do believe your remark was sarcastic. For being sarcastically funny, have a 5! :laugh:

          Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.

          L 1 Reply Last reply
          0
          • A Andrei Straut

            Yes, and at the same time, it makes it awwwwwwfully easy to code badly. You can code badly in absolutely any language, but bad code written in PHP just.has.that.special.flavor. [rant start] Now, assume we have some code (PHP) along the lines of:

            $invoice_no = 1;

            //some code

            //Then someone comes who does not read docs, or has no idea that invoice_no should be an int, and does something with the following effect:
            $invoice_no = $invoice_no . 'INV_123#';

            //Some other code
            return $invoice_no;

            Now, try to do this in Java for instance:

            int invoice_no = 1;
            invoice_no = invoice_no + "INV_123#";
            return invoice_no;

            The compiler would be all over the place, screaming like a newborn baby. And that's just off the top of my head. And speaking of compiler and autocomplete, how about contructs like:

            $invoice_no = 'Whatever';

            //Code

            return $invoiceno; //first occurrence of $invoiceno, the IDE doesn't complain about it, is undefined, but you sucker will only know at runtime, from a !!!Notice!!!

            Or that you can't really enforce a type parameter on a method (of course, there's get_class, but you'll only know about it at runtime). Or autocomplete. I'a big fan of autocomplete. Now, I've done PHP with both Eclipse and Netbeans. Try to get autocomplete for something like:

            $db = DatabaseService::getInstance();
            $line = $db->getPoLineById($line_id);
            $product = $db->searchProduct('id', $line->getProductId()); //This is where the magic ends. No autocomplete for 'line->'

            Or debugging. var_dump, really? Now, I know there's XDebug, but try using that in a 4GB PHP project (I'm talking about a Magento website). Good luck with that. [rant end] Now, I do believe your remark was sarcastic. For being sarcastically funny, have a 5! :laugh:

            Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.

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

            Andrei Straut wrote:

            Now, I do believe your remark was sarcastic

            Thanks. Indeed I don't jump off bridges just because it's especially easy on this particular bridge or many people have done so before. Not even the lemmings really do that. :) I have started to ignore languages which are interpreted or are advertised as being especially noob-friendly on 8 bit machines. Especially the 'noob-unfriendly' things (like type safety) usually are supposed to help you and I have no interest in learning how to bypass them or constantly discussing why it's a bad idea to bypass them.

            At least artificial intelligence already is superior to natural stupidity

            A 1 Reply Last reply
            0
            • L Lost User

              Andrei Straut wrote:

              Now, I do believe your remark was sarcastic

              Thanks. Indeed I don't jump off bridges just because it's especially easy on this particular bridge or many people have done so before. Not even the lemmings really do that. :) I have started to ignore languages which are interpreted or are advertised as being especially noob-friendly on 8 bit machines. Especially the 'noob-unfriendly' things (like type safety) usually are supposed to help you and I have no interest in learning how to bypass them or constantly discussing why it's a bad idea to bypass them.

              At least artificial intelligence already is superior to natural stupidity

              A Offline
              A Offline
              Andrei Straut
              wrote on last edited by
              #6

              CDP1802 wrote:

              Especially the 'noob-unfriendly' things (like type safety) usually are supposed to help you and I have no interest in learning how to bypass them

              So true. Now, please do go and convince everyone of this. :laugh:

              Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.

              L 1 Reply Last reply
              0
              • A Andrei Straut

                CDP1802 wrote:

                Especially the 'noob-unfriendly' things (like type safety) usually are supposed to help you and I have no interest in learning how to bypass them

                So true. Now, please do go and convince everyone of this. :laugh:

                Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.

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

                Hopeless. Those who go for 'easy' usually don't see the need for any pesky constraints and want to keep on going without them.

                At least artificial intelligence already is superior to natural stupidity

                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