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. Over-documentation

Over-documentation

Scheduled Pinned Locked Moved The Weird and The Wonderful
performance
25 Posts 16 Posters 2 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.
  • M Max Methot

    Reminds me of this! [^]

    P Offline
    P Offline
    PIEBALDconsult
    wrote on last edited by
    #21

    The first time I saw something like that said "Paris in the / the spring". I saw this[^] sign a couple of weeks ago at http://en.wikipedia.org/wiki/Painted_Rocks_(Arizona)[^]

    1 Reply Last reply
    0
    • R Ron Beyer

      This is from another forum I visit once in a while, somebody posting a code snippet:

      void loop(){
      byte rxbyte; //this tells the 'compiler' to allocate some memory for a variable called rxbyte
      byte temp; //this tells the 'compiler' to allocate some memory for a variable called temp
      rxbyte = serial_getch(); //this calls the 'function' serial_getch(), stores result in rxbyte

      if (rxbyte == 254) //Matrix uses 254 for commands, if rxbyte = 254 the the code below runs
      {
      switch (serial_getch()) //calls serial_getch() to get the next byte from the PC
      // 'switches' based on that byte
      {

      And it continues on like that. At least we know what the 'compiler' is doing when you declare a variable :)

      R Offline
      R Offline
      Rob Grainger
      wrote on last edited by
      #22

      Amusingly, that doesn't really tell us much - the compiler doesn't "allocate" memory, the stack is allocated when the program starts - this simply updates stack pointers.

      "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

      1 Reply Last reply
      0
      • R Ron Beyer

        This is from another forum I visit once in a while, somebody posting a code snippet:

        void loop(){
        byte rxbyte; //this tells the 'compiler' to allocate some memory for a variable called rxbyte
        byte temp; //this tells the 'compiler' to allocate some memory for a variable called temp
        rxbyte = serial_getch(); //this calls the 'function' serial_getch(), stores result in rxbyte

        if (rxbyte == 254) //Matrix uses 254 for commands, if rxbyte = 254 the the code below runs
        {
        switch (serial_getch()) //calls serial_getch() to get the next byte from the PC
        // 'switches' based on that byte
        {

        And it continues on like that. At least we know what the 'compiler' is doing when you declare a variable :)

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #23

        Over-zealous on the documentation part but missed out some basic coding standards like below: 1) Magic Strings/Numbers in code. 2) It would be better to have the value of serial_getch() assigned in a variable and then used in switch instead of calling it directly as a function in the switch construct.

        Vasudevan Deepak Kumar Personal Homepage You can not step into the same river twice.

        1 Reply Last reply
        0
        • R Ron Beyer

          This is from another forum I visit once in a while, somebody posting a code snippet:

          void loop(){
          byte rxbyte; //this tells the 'compiler' to allocate some memory for a variable called rxbyte
          byte temp; //this tells the 'compiler' to allocate some memory for a variable called temp
          rxbyte = serial_getch(); //this calls the 'function' serial_getch(), stores result in rxbyte

          if (rxbyte == 254) //Matrix uses 254 for commands, if rxbyte = 254 the the code below runs
          {
          switch (serial_getch()) //calls serial_getch() to get the next byte from the PC
          // 'switches' based on that byte
          {

          And it continues on like that. At least we know what the 'compiler' is doing when you declare a variable :)

          I Offline
          I Offline
          imagiro
          wrote on last edited by
          #24

          Probably he had a boss who complained about insufficient comments - like my boss often does when reviewing my code complains about missing annotations (just review annotations, the code was already commented properly). So I did more or less the same like our guy here - and my boss was happy. He didn't get that it was supposed to be ironic...

          1 Reply Last reply
          0
          • R Ron Beyer

            This is from another forum I visit once in a while, somebody posting a code snippet:

            void loop(){
            byte rxbyte; //this tells the 'compiler' to allocate some memory for a variable called rxbyte
            byte temp; //this tells the 'compiler' to allocate some memory for a variable called temp
            rxbyte = serial_getch(); //this calls the 'function' serial_getch(), stores result in rxbyte

            if (rxbyte == 254) //Matrix uses 254 for commands, if rxbyte = 254 the the code below runs
            {
            switch (serial_getch()) //calls serial_getch() to get the next byte from the PC
            // 'switches' based on that byte
            {

            And it continues on like that. At least we know what the 'compiler' is doing when you declare a variable :)

            L Offline
            L Offline
            Lutoslaw
            wrote on last edited by
            #25

            No horror here if it was posted to someone who's not into programming. E.g. "==" operator is not obvious and may provoke questions what does it mean. Also, telling about "allocating" memory is more understandable that introducing to how stack and pointers work.

            Greetings - Jacek

            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