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. There is nothing new under the sun...

There is nothing new under the sun...

Scheduled Pinned Locked Moved The Weird and The Wonderful
7 Posts 6 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.
  • D Offline
    D Offline
    Duncan Edwards Jones
    wrote on last edited by
    #1

    Public Sub New()
    MyBase.New
    End Sub

    Sort of implied anyway - but the fun fact is that the class that has this constructor doesn't actually explicitly inherit anything...so Mybase is object. (Fortunately the compiler just ignores this so no actual harm done)

    I C Kornfeld Eliyahu PeterK R Sander RosselS 5 Replies Last reply
    0
    • D Duncan Edwards Jones

      Public Sub New()
      MyBase.New
      End Sub

      Sort of implied anyway - but the fun fact is that the class that has this constructor doesn't actually explicitly inherit anything...so Mybase is object. (Fortunately the compiler just ignores this so no actual harm done)

      I Offline
      I Offline
      I explore code
      wrote on last edited by
      #2

      :doh:

      1 Reply Last reply
      0
      • D Duncan Edwards Jones

        Public Sub New()
        MyBase.New
        End Sub

        Sort of implied anyway - but the fun fact is that the class that has this constructor doesn't actually explicitly inherit anything...so Mybase is object. (Fortunately the compiler just ignores this so no actual harm done)

        C Offline
        C Offline
        Chris Maunder
        wrote on last edited by
        #3

        Zen coding.

        cheers Chris Maunder

        1 Reply Last reply
        0
        • D Duncan Edwards Jones

          Public Sub New()
          MyBase.New
          End Sub

          Sort of implied anyway - but the fun fact is that the class that has this constructor doesn't actually explicitly inherit anything...so Mybase is object. (Fortunately the compiler just ignores this so no actual harm done)

          Kornfeld Eliyahu PeterK Offline
          Kornfeld Eliyahu PeterK Offline
          Kornfeld Eliyahu Peter
          wrote on last edited by
          #4

          Duncan Edwards Jones wrote:

          Fortunately the compiler just ignores this so no actual harm done

          Which proves that we already have machine that outsmarts the men... :-D

          I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)

          "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

          1 Reply Last reply
          0
          • D Duncan Edwards Jones

            Public Sub New()
            MyBase.New
            End Sub

            Sort of implied anyway - but the fun fact is that the class that has this constructor doesn't actually explicitly inherit anything...so Mybase is object. (Fortunately the compiler just ignores this so no actual harm done)

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

            When I see code like this, I sometimes suspect it may have been copied/pasted from a De-Compiler (such as IL Spy). I mean why on earth would someone go to the trouble of typing that?

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

            D 1 Reply Last reply
            0
            • R Rob Grainger

              When I see code like this, I sometimes suspect it may have been copied/pasted from a De-Compiler (such as IL Spy). I mean why on earth would someone go to the trouble of typing that?

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

              D Offline
              D Offline
              Duncan Edwards Jones
              wrote on last edited by
              #6

              Yeah - or it could be a stub left behind when whatever extra work used to go on in the constructor was removed...or worst of all it may be a cargo cult coding issue.

              1 Reply Last reply
              0
              • D Duncan Edwards Jones

                Public Sub New()
                MyBase.New
                End Sub

                Sort of implied anyway - but the fun fact is that the class that has this constructor doesn't actually explicitly inherit anything...so Mybase is object. (Fortunately the compiler just ignores this so no actual harm done)

                Sander RosselS Offline
                Sander RosselS Offline
                Sander Rossel
                wrote on last edited by
                #7

                I write constructors such as that. Only when I have multiple constructors though. At least when you're going to change that code to call another constructor you know the call to the base class's constructor is gone (and probably going to be the default). I'd rather write too much code (such as access modifiers even though they're the default) and make sure everyone knows I really wanted to call that constructor or have that access modifier than write too few and accidentally use a default I didn't intend. Especially since I switch a lot between VB and C# and both have different defaults. Like a co-worker who doesn't write access modifiers. When I confronted him about it he said "everyone knows the default is public!". Turned out the default was internal :)

                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