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. Paid per line of code???

Paid per line of code???

Scheduled Pinned Locked Moved The Weird and The Wonderful
question
18 Posts 10 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.
  • W WiganLatics

    bool orphan = false;
    if (intJobCategory < 0 || intJobType < 0)
    {
    orphan = true;
    }

    if (orphan)
    {
    string message = "orphan detected intJobCategoryJobTypeID=" + intId.ToString();
    this.state.Status = message;
    }
    else
    {
    ...
    }

    And just to clarify, that bool is never used again...

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

    Some people prefer to spell it out rather than jam it all into a single line. :^)

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

    1 Reply Last reply
    0
    • W WiganLatics

      bool orphan = false;
      if (intJobCategory < 0 || intJobType < 0)
      {
      orphan = true;
      }

      if (orphan)
      {
      string message = "orphan detected intJobCategoryJobTypeID=" + intId.ToString();
      this.state.Status = message;
      }
      else
      {
      ...
      }

      And just to clarify, that bool is never used again...

      J Offline
      J Offline
      jeron1
      wrote on last edited by
      #3

      I agree it's ugly, could it be that orphan was used in other places at some point?

      "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle

      F W 2 Replies Last reply
      0
      • W WiganLatics

        bool orphan = false;
        if (intJobCategory < 0 || intJobType < 0)
        {
        orphan = true;
        }

        if (orphan)
        {
        string message = "orphan detected intJobCategoryJobTypeID=" + intId.ToString();
        this.state.Status = message;
        }
        else
        {
        ...
        }

        And just to clarify, that bool is never used again...

        J Offline
        J Offline
        jgakenhe
        wrote on last edited by
        #4

        You must have just gotten a job in my organization.

        1 Reply Last reply
        0
        • W WiganLatics

          bool orphan = false;
          if (intJobCategory < 0 || intJobType < 0)
          {
          orphan = true;
          }

          if (orphan)
          {
          string message = "orphan detected intJobCategoryJobTypeID=" + intId.ToString();
          this.state.Status = message;
          }
          else
          {
          ...
          }

          And just to clarify, that bool is never used again...

          N Offline
          N Offline
          Nathan Minier
          wrote on last edited by
          #5

          Ah, when the initial commit from psudocode doesn't ever cleaned up. Good days.

          "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli

          1 Reply Last reply
          0
          • W WiganLatics

            bool orphan = false;
            if (intJobCategory < 0 || intJobType < 0)
            {
            orphan = true;
            }

            if (orphan)
            {
            string message = "orphan detected intJobCategoryJobTypeID=" + intId.ToString();
            this.state.Status = message;
            }
            else
            {
            ...
            }

            And just to clarify, that bool is never used again...

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

            How ugly that code is with its inconsistent naming! Tell those poor code monkeys to clean it up: it must be boolOrphan instead of orphan, and strMessage instead of message! How come it they forgot half of their VB6 wisdom?

            N 1 Reply Last reply
            0
            • W WiganLatics

              bool orphan = false;
              if (intJobCategory < 0 || intJobType < 0)
              {
              orphan = true;
              }

              if (orphan)
              {
              string message = "orphan detected intJobCategoryJobTypeID=" + intId.ToString();
              this.state.Status = message;
              }
              else
              {
              ...
              }

              And just to clarify, that bool is never used again...

              V Offline
              V Offline
              V 0
              wrote on last edited by
              #7

              if (orphan)
              {
              string message = "orphan detected intJobCategoryJobTypeID=" + intId.ToString();
              this.state.Status = message;
              }

              if (orphan)
              {
              string message = "";
              message = "orphan detected intJobCategoryJobTypeID=";
              message += intId.ToString();
              this.state.Status = message;
              }

              Of course concatenating strings is not very productive, so you could create a Stringbuilder, concatenate the pieces, create a string with the toString method and set that string to the Status variable. Forgive the person who wrote that, he's just a padawan learner ;P

              V.

              (MQOTD rules and previous solutions)

              F 1 Reply Last reply
              0
              • V V 0

                if (orphan)
                {
                string message = "orphan detected intJobCategoryJobTypeID=" + intId.ToString();
                this.state.Status = message;
                }

                if (orphan)
                {
                string message = "";
                message = "orphan detected intJobCategoryJobTypeID=";
                message += intId.ToString();
                this.state.Status = message;
                }

                Of course concatenating strings is not very productive, so you could create a Stringbuilder, concatenate the pieces, create a string with the toString method and set that string to the Status variable. Forgive the person who wrote that, he's just a padawan learner ;P

                V.

                (MQOTD rules and previous solutions)

                F Offline
                F Offline
                F ES Sitecore
                wrote on last edited by
                #8

                A stringbuilder to concatenate two strings is overkill, you could just use string.Concat, it has the same benefits of the StringBuilder without the overhead of creating an object and without any risk that memory needs reallocated multiple times. You should only use stringbuilder if the size of the resultant text can't easily be known, or if you know you are going to do a lot of concatenation.

                V 1 Reply Last reply
                0
                • J jeron1

                  I agree it's ugly, could it be that orphan was used in other places at some point?

                  "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle

                  F Offline
                  F Offline
                  F ES Sitecore
                  wrote on last edited by
                  #9

                  That's what I thought, maybe the variable was originally used elsewhere but that code deleted and this not tidied up. Also compiler optimisation would probably fix this code anyway.

                  1 Reply Last reply
                  0
                  • F F ES Sitecore

                    A stringbuilder to concatenate two strings is overkill, you could just use string.Concat, it has the same benefits of the StringBuilder without the overhead of creating an object and without any risk that memory needs reallocated multiple times. You should only use stringbuilder if the size of the resultant text can't easily be known, or if you know you are going to do a lot of concatenation.

                    V Offline
                    V Offline
                    V 0
                    wrote on last edited by
                    #10

                    it was a quick joke, not a serious reply.

                    V.

                    (MQOTD rules and previous solutions)

                    F 1 Reply Last reply
                    0
                    • V V 0

                      it was a quick joke, not a serious reply.

                      V.

                      (MQOTD rules and previous solutions)

                      F Offline
                      F Offline
                      F ES Sitecore
                      wrote on last edited by
                      #11

                      Code iz serius bizness!!1

                      V 1 Reply Last reply
                      0
                      • F F ES Sitecore

                        Code iz serius bizness!!1

                        V Offline
                        V Offline
                        V 0
                        wrote on last edited by
                        #12

                        :-D

                        V.

                        (MQOTD rules and previous solutions)

                        1 Reply Last reply
                        0
                        • J jeron1

                          I agree it's ugly, could it be that orphan was used in other places at some point?

                          "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle

                          W Offline
                          W Offline
                          WiganLatics
                          wrote on last edited by
                          #13

                          That's what I hoped but I checked through the revision history and no sign of it being used.

                          D 1 Reply Last reply
                          0
                          • B Bernhard Hiller

                            How ugly that code is with its inconsistent naming! Tell those poor code monkeys to clean it up: it must be boolOrphan instead of orphan, and strMessage instead of message! How come it they forgot half of their VB6 wisdom?

                            N Offline
                            N Offline
                            Nathan Minier
                            wrote on last edited by
                            #14

                            Hungarian Notation: For when intellisense just seems too hard.

                            "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli

                            L 1 Reply Last reply
                            0
                            • N Nathan Minier

                              Hungarian Notation: For when intellisense just seems too hard.

                              "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli

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

                              'False' Hungarian uses the prefixes to describe types. Instead, the prefixes were intended to describe the usage of the variable. Remember such things as 'lpstr', a long pinter to a string terminated by zero? Can Intellisense do that as well?

                              The language is JavaScript. that of Mordor, which I will not utter here
                              This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                              "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                              N 1 Reply Last reply
                              0
                              • L Lost User

                                'False' Hungarian uses the prefixes to describe types. Instead, the prefixes were intended to describe the usage of the variable. Remember such things as 'lpstr', a long pinter to a string terminated by zero? Can Intellisense do that as well?

                                The language is JavaScript. that of Mordor, which I will not utter here
                                This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                                "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                                N Offline
                                N Offline
                                Nathan Minier
                                wrote on last edited by
                                #16

                                An absolutely fair point that unfortunately does not describe the usage I see in web applications. I apologize for maligning Hungarian Notation. I may have simply lost my mind after seeing lblLabel one too many times.

                                "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli

                                L 1 Reply Last reply
                                0
                                • N Nathan Minier

                                  An absolutely fair point that unfortunately does not describe the usage I see in web applications. I apologize for maligning Hungarian Notation. I may have simply lost my mind after seeing lblLabel one too many times.

                                  "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli

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

                                  That's why I still like oldschool machine code. You can't do very much wrong with hexadecimal. :-)

                                  The language is JavaScript. that of Mordor, which I will not utter here
                                  This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                                  "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                                  1 Reply Last reply
                                  0
                                  • W WiganLatics

                                    That's what I hoped but I checked through the revision history and no sign of it being used.

                                    D Offline
                                    D Offline
                                    den2k88
                                    wrote on last edited by
                                    #18

                                    Debug purposes or planned mechanics never introduced. It happens.

                                    GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++*      Weapons extension: ma- k++ F+2 X If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani

                                    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