Greg Young [MVP]

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Interesting Code

Umm yeah.

 

    class A
    {
        public class B : A
        {
        }
    }



    //slightly weird
    class C : A.B
    {
        public void Foo(C.B b)
        {
        }
    }



    //Love the edge conditions

    class D : A
    {
        public void Foo(D.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B b)
        {
        }
    }


Posted 11-05-2008 3:31 PM by Greg

[Advertisement]

Comments

Paul Lockwood wrote re: Interesting Code
on 11-05-2008 4:21 PM
Love it!
Omer van Kloeten wrote re: Interesting Code
on 11-05-2008 4:41 PM
LOL! Great find! :D
Kostya wrote re: Interesting Code
on 11-05-2008 5:07 PM
class A { public class B : A { } } class C : A { public void Foo(A.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B b) { } }
Joe Balfantz wrote re: Interesting Code
on 11-19-2008 6:41 PM

Opens possibilities of code poetry for the REALLY bored .NET coders:

internetducttape.com/.../show-your-geek-love-with-code-poetry-in-perl

Ali Khalid wrote re: Interesting Code
on 12-05-2008 4:12 AM
i dont get it :(
Darius Damalakas wrote re: Interesting Code
on 02-10-2009 7:06 AM

Nice! :D :D

Add a Comment

(required)  
(optional)
(required)  
Remember Me?