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. // Enforce Method Contract

// Enforce Method Contract

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpphpwpfcom
10 Posts 9 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.
  • J Offline
    J Offline
    Josh Smith
    wrote on last edited by
    #1

    I once worked on an application where one of the developers fulfilled the requirement of commenting his code by putting at the top of each method:

    // Enforce Method Contract

    Well, thank you Captain Obvious! ;P

    :josh: My WPF Blog[^] All of life is just a big rambling blog post.

    D CPalliniC P P 4 Replies Last reply
    0
    • J Josh Smith

      I once worked on an application where one of the developers fulfilled the requirement of commenting his code by putting at the top of each method:

      // Enforce Method Contract

      Well, thank you Captain Obvious! ;P

      :josh: My WPF Blog[^] All of life is just a big rambling blog post.

      D Offline
      D Offline
      DownUnderDev
      wrote on last edited by
      #2

      hahaha that sounds great, what comment system do you use, i have used doxygen with some sucess but it becomes a little tiresome after a while

      "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius and a lot of courage to move in the opposite direction." -Albert Einstein

      1 Reply Last reply
      0
      • J Josh Smith

        I once worked on an application where one of the developers fulfilled the requirement of commenting his code by putting at the top of each method:

        // Enforce Method Contract

        Well, thank you Captain Obvious! ;P

        :josh: My WPF Blog[^] All of life is just a big rambling blog post.

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

        Josh Smith wrote:

        // Enforce Method Contract

        Possibly a placeholder for later elaboration (never done, of course! :-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
        [My articles]

        In testa che avete, signor di Ceprano?

        S 1 Reply Last reply
        0
        • J Josh Smith

          I once worked on an application where one of the developers fulfilled the requirement of commenting his code by putting at the top of each method:

          // Enforce Method Contract

          Well, thank you Captain Obvious! ;P

          :josh: My WPF Blog[^] All of life is just a big rambling blog post.

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

          That's good.

          "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

          1 Reply Last reply
          0
          • J Josh Smith

            I once worked on an application where one of the developers fulfilled the requirement of commenting his code by putting at the top of each method:

            // Enforce Method Contract

            Well, thank you Captain Obvious! ;P

            :josh: My WPF Blog[^] All of life is just a big rambling blog post.

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

            That sounds reasonable to me. I'm pleased to see that he thinks the contract is so important. Or is this some form of bizarre Arnold Schwarzenegger motivational speaking type of thing. Try saying it in an Austrian accent, and it really works.

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

            My blog | My articles

            J S 2 Replies Last reply
            0
            • P Pete OHanlon

              That sounds reasonable to me. I'm pleased to see that he thinks the contract is so important. Or is this some form of bizarre Arnold Schwarzenegger motivational speaking type of thing. Try saying it in an Austrian accent, and it really works.

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

              My blog | My articles

              J Offline
              J Offline
              Josh Smith
              wrote on last edited by
              #6

              Pete O'Hanlon wrote:

              Try saying it in an Austrian accent, and it really works

              :laugh:

              :josh: My WPF Blog[^] All of life is just a big rambling blog post.

              1 Reply Last reply
              0
              • P Pete OHanlon

                That sounds reasonable to me. I'm pleased to see that he thinks the contract is so important. Or is this some form of bizarre Arnold Schwarzenegger motivational speaking type of thing. Try saying it in an Austrian accent, and it really works.

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

                My blog | My articles

                S Offline
                S Offline
                Stephen Hewitt
                wrote on last edited by
                #7

                You've got a point there. One can imagine Arnie busting out the one-liner "contract enforced" after dispatching some poor sap.

                Steve

                Q 1 Reply Last reply
                0
                • CPalliniC CPallini

                  Josh Smith wrote:

                  // Enforce Method Contract

                  Possibly a placeholder for later elaboration (never done, of course! :-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
                  [My articles]

                  S Offline
                  S Offline
                  Simon Capewell
                  wrote on last edited by
                  #8

                  I worked with a chap that did a retro fit of function headers on files where they'd largely been left out. The functions themselves were meaningfully named and internally well commented. Unfortunately he decided that he didn't have time to write descriptive text for all of them, so just put TODO: Add function comment. This was a real pain, all of our TODO: Fix nasty bug and TODO: Finish writing this important piece of code before release got buried beneath approximately a thousand worthless TODOs.

                  B 1 Reply Last reply
                  0
                  • S Stephen Hewitt

                    You've got a point there. One can imagine Arnie busting out the one-liner "contract enforced" after dispatching some poor sap.

                    Steve

                    Q Offline
                    Q Offline
                    QuiJohn
                    wrote on last edited by
                    #9

                    Stephen Hewitt wrote:

                    One can imagine Arnie busting out the one-liner "contract enforced" after dispatching some poor sap.

                    That's how he runs California.


                    Faith is a fine invention For gentlemen who see; But microscopes are prudent In an emergency!            -Emily Dickinson

                    1 Reply Last reply
                    0
                    • S Simon Capewell

                      I worked with a chap that did a retro fit of function headers on files where they'd largely been left out. The functions themselves were meaningfully named and internally well commented. Unfortunately he decided that he didn't have time to write descriptive text for all of them, so just put TODO: Add function comment. This was a real pain, all of our TODO: Fix nasty bug and TODO: Finish writing this important piece of code before release got buried beneath approximately a thousand worthless TODOs.

                      B Offline
                      B Offline
                      BillW33
                      wrote on last edited by
                      #10

                      I have seen code where the standard practice was to leave in the // TODO: Add constructor logic here that the compiler puts in automatically. The folk that did it never saw a problem with doing that because they didn't use the Task list. I found it to be a problem as soon as I put in a useful TODO and it was overwhelmed my hundreds of pointless TODOs. Bill W

                      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