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. Real coding horror... by me! :)

Real coding horror... by me! :)

Scheduled Pinned Locked Moved The Weird and The Wonderful
tutorialc++com
9 Posts 7 Posters 37 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.
  • L Offline
    L Offline
    leonej_dt
    wrote on last edited by
    #1

    First of all, hello. I'm a newbie. Since this section is called Coding Horrors, I thought it would be funny to share this C++ header file I wrote a few days ago: http://www.geocities.com/fruitcake59/Prototype.txt[^] The following tokens are actually macros: name, type, state, stype, parent, ptype, base, nodeclare, notserial. The two first ones (name and type) MUST be defined before including Prototype.h. The other ones are optional. If you see something like this... #ifdef SOME_TOKEN SOME_TOKEN #undef SOME_TOKEN #endif ... then SOME_TOKEN is also an optional macro that can be defined before including Prototype.h. Here's an example of how to use this header file: // This belongs to Instruction.h #pragma once #pragma region Class Names #define name CInstruction #define type INSTRUCTION #define state CInstrState #define stype INSTRSTATE #define parent mpParent #define ptype CModule #define nodeclare #pragma endregion #pragma region Friendships #define CONST_FRIENDSHIPS \     friend class CModule; \     friend struct MODULE; #pragma endregion #pragma region Data Structures #define VAR_ATTRIBUTES \     CStringList slParams; #pragma endregion #pragma region Constructor #define CONSTRUCTOR \     CInstruction(CModule *mpParent); \     CInstruction(CModule *mpParent, CString &sName); #pragma endregion

    P J 2 Replies Last reply
    0
    • L leonej_dt

      First of all, hello. I'm a newbie. Since this section is called Coding Horrors, I thought it would be funny to share this C++ header file I wrote a few days ago: http://www.geocities.com/fruitcake59/Prototype.txt[^] The following tokens are actually macros: name, type, state, stype, parent, ptype, base, nodeclare, notserial. The two first ones (name and type) MUST be defined before including Prototype.h. The other ones are optional. If you see something like this... #ifdef SOME_TOKEN SOME_TOKEN #undef SOME_TOKEN #endif ... then SOME_TOKEN is also an optional macro that can be defined before including Prototype.h. Here's an example of how to use this header file: // This belongs to Instruction.h #pragma once #pragma region Class Names #define name CInstruction #define type INSTRUCTION #define state CInstrState #define stype INSTRSTATE #define parent mpParent #define ptype CModule #define nodeclare #pragma endregion #pragma region Friendships #define CONST_FRIENDSHIPS \     friend class CModule; \     friend struct MODULE; #pragma endregion #pragma region Data Structures #define VAR_ATTRIBUTES \     CStringList slParams; #pragma endregion #pragma region Constructor #define CONSTRUCTOR \     CInstruction(CModule *mpParent); \     CInstruction(CModule *mpParent, CString &sName); #pragma endregion

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      :|

      "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

      1 Reply Last reply
      0
      • L leonej_dt

        First of all, hello. I'm a newbie. Since this section is called Coding Horrors, I thought it would be funny to share this C++ header file I wrote a few days ago: http://www.geocities.com/fruitcake59/Prototype.txt[^] The following tokens are actually macros: name, type, state, stype, parent, ptype, base, nodeclare, notserial. The two first ones (name and type) MUST be defined before including Prototype.h. The other ones are optional. If you see something like this... #ifdef SOME_TOKEN SOME_TOKEN #undef SOME_TOKEN #endif ... then SOME_TOKEN is also an optional macro that can be defined before including Prototype.h. Here's an example of how to use this header file: // This belongs to Instruction.h #pragma once #pragma region Class Names #define name CInstruction #define type INSTRUCTION #define state CInstrState #define stype INSTRSTATE #define parent mpParent #define ptype CModule #define nodeclare #pragma endregion #pragma region Friendships #define CONST_FRIENDSHIPS \     friend class CModule; \     friend struct MODULE; #pragma endregion #pragma region Data Structures #define VAR_ATTRIBUTES \     CStringList slParams; #pragma endregion #pragma region Constructor #define CONSTRUCTOR \     CInstruction(CModule *mpParent); \     CInstruction(CModule *mpParent, CString &sName); #pragma endregion

        J Offline
        J Offline
        Justin Perez
        wrote on last edited by
        #3

        Good one, fruitcake.

        I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

        L S N 3 Replies Last reply
        0
        • J Justin Perez

          Good one, fruitcake.

          I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          Justin Perez wrote:

          Good one, fruitcake.

          At least I get the joke :)

          xacc.ide - now with IronScheme support
          IronScheme - 1.0 alpha 2 out now

          J 1 Reply Last reply
          0
          • J Justin Perez

            Good one, fruitcake.

            I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

            S Offline
            S Offline
            sammyamma
            wrote on last edited by
            #5

            is that a joke indians are good programmers :(

            P J 2 Replies Last reply
            0
            • S sammyamma

              is that a joke indians are good programmers :(

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              sammyamma wrote:

              is that a joke indians are good programmers

              All Indians? We've come across our fair share of duffers here on Code Project.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              1 Reply Last reply
              0
              • J Justin Perez

                Good one, fruitcake.

                I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

                N Offline
                N Offline
                NormDroid
                wrote on last edited by
                #7

                :laugh:

                Brainware Error - reboot required.

                1 Reply Last reply
                0
                • L leppie

                  Justin Perez wrote:

                  Good one, fruitcake.

                  At least I get the joke :)

                  xacc.ide - now with IronScheme support
                  IronScheme - 1.0 alpha 2 out now

                  J Offline
                  J Offline
                  Justin Perez
                  wrote on last edited by
                  #8

                  leppie wrote:

                  At least I get the joke

                  Oh good. I was actually thinking everyone might miss the reference from the OP

                  I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

                  1 Reply Last reply
                  0
                  • S sammyamma

                    is that a joke indians are good programmers :(

                    J Offline
                    J Offline
                    Justin Perez
                    wrote on last edited by
                    #9

                    The quote in my sig? Yes, the guy who made the comment made it as a joke. The joke isn't about all Indians. Take a look around the forums for a day or 2 and you will see that there are some bad apples.

                    I'm going to become rich when I create a device that allows me to punch people in the face over the internet. "If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer

                    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