Overloading method without modifying classesHidden Features of C#?How can I return NULL from a generic method in C#?Function overloading in Javascript - Best practicesHow do I get a consistent byte representation of strings in C# without manually specifying an encoding?Understanding Python super() with __init__() methodsIEnumerable vs List - What to Use? How do they work?Python class inherits objectVisitor Pattern in C++ with multiple visitable parametersWhy not inherit from List<T>?Which Overloaded Method is Called in Java

Can a Beast Master ranger choose a swarm as an animal companion?

Chess software to analyze games

How could China have extradited people for political reason under the extradition law it wanted to pass in Hong Kong?

Does the Green Flame-Blade cantrip work with the Zephyr Strike spell?

How to detect a failed AES256 decryption programmatically?

Are there reliable, formulaic ways to form chords on the guitar?

Does git delete empty folders?

Vacuum collapse -- why do strong metals implode but glass doesn't?

Nuclear decay triggers

Using は before 欲しい instead が

Would it be illegal for Facebook to actively promote a political agenda?

Why do some academic journals requires a separate "summary" paragraph in addition to an abstract?

What can I do to keep a threaded bolt from falling out of it’s slot

Land Registry Clause

Gofer work in exchange for Letter of Recommendation

Levenshtein Neighbours

How does the Saturn V Dynamic Test Stand work?

Is there a commercial liquid with refractive index greater than n=2?

Do living authors still get paid royalties for their old work?

Are there any OR challenges that are similar to kaggle's competitions?

How do slats reduce stall speed?

Story about a demon trying to make a man insane

What is "super" in superphosphate?

90s(?) book series about two people transported to a parallel medieval world, she joins city watch, he becomes wizard



Overloading method without modifying classes


Hidden Features of C#?How can I return NULL from a generic method in C#?Function overloading in Javascript - Best practicesHow do I get a consistent byte representation of strings in C# without manually specifying an encoding?Understanding Python super() with __init__() methodsIEnumerable vs List - What to Use? How do they work?Python class inherits objectVisitor Pattern in C++ with multiple visitable parametersWhy not inherit from List<T>?Which Overloaded Method is Called in Java






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have access to a class structure, which I cannot modify, as follows:



Graphics
Circle
Line
etc.


Again, I cannot modify it! These all have individual properties such as Radius, FirstPoint, LastPoint, etc., as well as some common properties.



I want to create a method that accepts a Graphics object, and depending on the type of object, will run a ToJson method:



Graphics g = db.GetGraphic(123);
// Console.WriteLine(g.GetType()) prints "Circle"

// Should run some specific implementation for `Circle` type graphics, and
// have an overload for all types including Graphics
ToJson(g);


At first I imagined I could craftily overload the ToJson method:



ToJson(Graphics g) ... 
ToJson(Circle g) ...
ToJson(Line g) ...


however this of course goes for the generic ToJson(Graphics) overload each time.



I'm sure I could do something like the following:



if (g is Circle) ...
if (g is Line) ...
if (g is Graphics) ...


or create a Dictionary to reduce the complexity for each type, but that doesn't feel like the best way of doing things




What I've considered



I've considered if there's some generic wrapper method I could use around each object (e.g., new JsonGraphics(g).ToJson()), but I do not want to have to perform any manual type checking myself.



I have looked at the double dispatch and visitor pattern, but I wasn't sure they met my requirements as they look like I have to modify these classes (or maybe I just didn't fully understand them), and (kinda obvious, however) generics are also basically out of the window as they require me to know in advance what type of Graphics object this is.




Two questions then:



Is there a better way to do this other than to use some Dictionary or something other if (g is Type)-like?



If I could modify the classes, how would the pattern look? This isn't possible in this case, but is double dispatch/visitor the best way to go in the case I could?










share|improve this question


























  • If you could modify the types, you would add a virtual/abstract ToJson instance method and override as needed. A "rule engine" where you use reflection to find the right implementation of the ToJson code is probably the best way to go.

    – Lasse Vågsæther Karlsen
    Mar 27 at 14:42











  • So yes, a dictionary of type to delegate/object that implements this is probably what I would choose myself.

    – Lasse Vågsæther Karlsen
    Mar 27 at 14:43











  • Decorator pattern?

    – Kenneth K.
    Mar 27 at 14:43






  • 1





    As you note, to use the visitor pattern for double dispatch, you need the "visited" class to implement a method that calls the "visitor" class back on the appropriate method. I give a simple example here: ericlippert.com/2015/05/04/wizards-and-warriors-part-three You normally use the visitor pattern when you have a group of related objects, you have a variety of analysis or transformation passes you need to perform on those objects, and the exact details of each operation depend on the run-time type of both the visited and visitor objects.

    – Eric Lippert
    Mar 27 at 15:26






  • 1





    Thank you for your input Eric - I'll give that a read! 🙂

    – Nick Bull
    Mar 27 at 17:07

















1















I have access to a class structure, which I cannot modify, as follows:



Graphics
Circle
Line
etc.


Again, I cannot modify it! These all have individual properties such as Radius, FirstPoint, LastPoint, etc., as well as some common properties.



I want to create a method that accepts a Graphics object, and depending on the type of object, will run a ToJson method:



Graphics g = db.GetGraphic(123);
// Console.WriteLine(g.GetType()) prints "Circle"

// Should run some specific implementation for `Circle` type graphics, and
// have an overload for all types including Graphics
ToJson(g);


At first I imagined I could craftily overload the ToJson method:



ToJson(Graphics g) ... 
ToJson(Circle g) ...
ToJson(Line g) ...


however this of course goes for the generic ToJson(Graphics) overload each time.



I'm sure I could do something like the following:



if (g is Circle) ...
if (g is Line) ...
if (g is Graphics) ...


or create a Dictionary to reduce the complexity for each type, but that doesn't feel like the best way of doing things




What I've considered



I've considered if there's some generic wrapper method I could use around each object (e.g., new JsonGraphics(g).ToJson()), but I do not want to have to perform any manual type checking myself.



I have looked at the double dispatch and visitor pattern, but I wasn't sure they met my requirements as they look like I have to modify these classes (or maybe I just didn't fully understand them), and (kinda obvious, however) generics are also basically out of the window as they require me to know in advance what type of Graphics object this is.




Two questions then:



Is there a better way to do this other than to use some Dictionary or something other if (g is Type)-like?



If I could modify the classes, how would the pattern look? This isn't possible in this case, but is double dispatch/visitor the best way to go in the case I could?










share|improve this question


























  • If you could modify the types, you would add a virtual/abstract ToJson instance method and override as needed. A "rule engine" where you use reflection to find the right implementation of the ToJson code is probably the best way to go.

    – Lasse Vågsæther Karlsen
    Mar 27 at 14:42











  • So yes, a dictionary of type to delegate/object that implements this is probably what I would choose myself.

    – Lasse Vågsæther Karlsen
    Mar 27 at 14:43











  • Decorator pattern?

    – Kenneth K.
    Mar 27 at 14:43






  • 1





    As you note, to use the visitor pattern for double dispatch, you need the "visited" class to implement a method that calls the "visitor" class back on the appropriate method. I give a simple example here: ericlippert.com/2015/05/04/wizards-and-warriors-part-three You normally use the visitor pattern when you have a group of related objects, you have a variety of analysis or transformation passes you need to perform on those objects, and the exact details of each operation depend on the run-time type of both the visited and visitor objects.

    – Eric Lippert
    Mar 27 at 15:26






  • 1





    Thank you for your input Eric - I'll give that a read! 🙂

    – Nick Bull
    Mar 27 at 17:07













1












1








1


1






I have access to a class structure, which I cannot modify, as follows:



Graphics
Circle
Line
etc.


Again, I cannot modify it! These all have individual properties such as Radius, FirstPoint, LastPoint, etc., as well as some common properties.



I want to create a method that accepts a Graphics object, and depending on the type of object, will run a ToJson method:



Graphics g = db.GetGraphic(123);
// Console.WriteLine(g.GetType()) prints "Circle"

// Should run some specific implementation for `Circle` type graphics, and
// have an overload for all types including Graphics
ToJson(g);


At first I imagined I could craftily overload the ToJson method:



ToJson(Graphics g) ... 
ToJson(Circle g) ...
ToJson(Line g) ...


however this of course goes for the generic ToJson(Graphics) overload each time.



I'm sure I could do something like the following:



if (g is Circle) ...
if (g is Line) ...
if (g is Graphics) ...


or create a Dictionary to reduce the complexity for each type, but that doesn't feel like the best way of doing things




What I've considered



I've considered if there's some generic wrapper method I could use around each object (e.g., new JsonGraphics(g).ToJson()), but I do not want to have to perform any manual type checking myself.



I have looked at the double dispatch and visitor pattern, but I wasn't sure they met my requirements as they look like I have to modify these classes (or maybe I just didn't fully understand them), and (kinda obvious, however) generics are also basically out of the window as they require me to know in advance what type of Graphics object this is.




Two questions then:



Is there a better way to do this other than to use some Dictionary or something other if (g is Type)-like?



If I could modify the classes, how would the pattern look? This isn't possible in this case, but is double dispatch/visitor the best way to go in the case I could?










share|improve this question
















I have access to a class structure, which I cannot modify, as follows:



Graphics
Circle
Line
etc.


Again, I cannot modify it! These all have individual properties such as Radius, FirstPoint, LastPoint, etc., as well as some common properties.



I want to create a method that accepts a Graphics object, and depending on the type of object, will run a ToJson method:



Graphics g = db.GetGraphic(123);
// Console.WriteLine(g.GetType()) prints "Circle"

// Should run some specific implementation for `Circle` type graphics, and
// have an overload for all types including Graphics
ToJson(g);


At first I imagined I could craftily overload the ToJson method:



ToJson(Graphics g) ... 
ToJson(Circle g) ...
ToJson(Line g) ...


however this of course goes for the generic ToJson(Graphics) overload each time.



I'm sure I could do something like the following:



if (g is Circle) ...
if (g is Line) ...
if (g is Graphics) ...


or create a Dictionary to reduce the complexity for each type, but that doesn't feel like the best way of doing things




What I've considered



I've considered if there's some generic wrapper method I could use around each object (e.g., new JsonGraphics(g).ToJson()), but I do not want to have to perform any manual type checking myself.



I have looked at the double dispatch and visitor pattern, but I wasn't sure they met my requirements as they look like I have to modify these classes (or maybe I just didn't fully understand them), and (kinda obvious, however) generics are also basically out of the window as they require me to know in advance what type of Graphics object this is.




Two questions then:



Is there a better way to do this other than to use some Dictionary or something other if (g is Type)-like?



If I could modify the classes, how would the pattern look? This isn't possible in this case, but is double dispatch/visitor the best way to go in the case I could?







c# inheritance overloading visitor double-dispatch






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 14:42







Nick Bull

















asked Mar 27 at 14:40









Nick BullNick Bull

6,6663 gold badges16 silver badges27 bronze badges




6,6663 gold badges16 silver badges27 bronze badges















  • If you could modify the types, you would add a virtual/abstract ToJson instance method and override as needed. A "rule engine" where you use reflection to find the right implementation of the ToJson code is probably the best way to go.

    – Lasse Vågsæther Karlsen
    Mar 27 at 14:42











  • So yes, a dictionary of type to delegate/object that implements this is probably what I would choose myself.

    – Lasse Vågsæther Karlsen
    Mar 27 at 14:43











  • Decorator pattern?

    – Kenneth K.
    Mar 27 at 14:43






  • 1





    As you note, to use the visitor pattern for double dispatch, you need the "visited" class to implement a method that calls the "visitor" class back on the appropriate method. I give a simple example here: ericlippert.com/2015/05/04/wizards-and-warriors-part-three You normally use the visitor pattern when you have a group of related objects, you have a variety of analysis or transformation passes you need to perform on those objects, and the exact details of each operation depend on the run-time type of both the visited and visitor objects.

    – Eric Lippert
    Mar 27 at 15:26






  • 1





    Thank you for your input Eric - I'll give that a read! 🙂

    – Nick Bull
    Mar 27 at 17:07

















  • If you could modify the types, you would add a virtual/abstract ToJson instance method and override as needed. A "rule engine" where you use reflection to find the right implementation of the ToJson code is probably the best way to go.

    – Lasse Vågsæther Karlsen
    Mar 27 at 14:42











  • So yes, a dictionary of type to delegate/object that implements this is probably what I would choose myself.

    – Lasse Vågsæther Karlsen
    Mar 27 at 14:43











  • Decorator pattern?

    – Kenneth K.
    Mar 27 at 14:43






  • 1





    As you note, to use the visitor pattern for double dispatch, you need the "visited" class to implement a method that calls the "visitor" class back on the appropriate method. I give a simple example here: ericlippert.com/2015/05/04/wizards-and-warriors-part-three You normally use the visitor pattern when you have a group of related objects, you have a variety of analysis or transformation passes you need to perform on those objects, and the exact details of each operation depend on the run-time type of both the visited and visitor objects.

    – Eric Lippert
    Mar 27 at 15:26






  • 1





    Thank you for your input Eric - I'll give that a read! 🙂

    – Nick Bull
    Mar 27 at 17:07
















If you could modify the types, you would add a virtual/abstract ToJson instance method and override as needed. A "rule engine" where you use reflection to find the right implementation of the ToJson code is probably the best way to go.

– Lasse Vågsæther Karlsen
Mar 27 at 14:42





If you could modify the types, you would add a virtual/abstract ToJson instance method and override as needed. A "rule engine" where you use reflection to find the right implementation of the ToJson code is probably the best way to go.

– Lasse Vågsæther Karlsen
Mar 27 at 14:42













So yes, a dictionary of type to delegate/object that implements this is probably what I would choose myself.

– Lasse Vågsæther Karlsen
Mar 27 at 14:43





So yes, a dictionary of type to delegate/object that implements this is probably what I would choose myself.

– Lasse Vågsæther Karlsen
Mar 27 at 14:43













Decorator pattern?

– Kenneth K.
Mar 27 at 14:43





Decorator pattern?

– Kenneth K.
Mar 27 at 14:43




1




1





As you note, to use the visitor pattern for double dispatch, you need the "visited" class to implement a method that calls the "visitor" class back on the appropriate method. I give a simple example here: ericlippert.com/2015/05/04/wizards-and-warriors-part-three You normally use the visitor pattern when you have a group of related objects, you have a variety of analysis or transformation passes you need to perform on those objects, and the exact details of each operation depend on the run-time type of both the visited and visitor objects.

– Eric Lippert
Mar 27 at 15:26





As you note, to use the visitor pattern for double dispatch, you need the "visited" class to implement a method that calls the "visitor" class back on the appropriate method. I give a simple example here: ericlippert.com/2015/05/04/wizards-and-warriors-part-three You normally use the visitor pattern when you have a group of related objects, you have a variety of analysis or transformation passes you need to perform on those objects, and the exact details of each operation depend on the run-time type of both the visited and visitor objects.

– Eric Lippert
Mar 27 at 15:26




1




1





Thank you for your input Eric - I'll give that a read! 🙂

– Nick Bull
Mar 27 at 17:07





Thank you for your input Eric - I'll give that a read! 🙂

– Nick Bull
Mar 27 at 17:07












1 Answer
1






active

oldest

votes


















2














Without being able to modify the base class, or have access to the concrete type before it's turned into a generic Graphics type, unfortunately I don't think there's anything you can do except inspect the runtime type of the Graphics object.



You can use a switch statement (since C# 7.0), which is slightly cleaner than your if chain:



switch (g)

case Circle circle: ... break;
case Line line: ... break;
default: /* Oh no! */ break;



Personally I don't see much advantage in using a Dictionary over a switch statement like this - both can be put away into a little self-contained method (and so reduce the amount of violation of the open/close principle), but the switch will be significantly cheaper.



You can also use dynamic, which causes the runtime to do late binding:



dynamic d = g;
ToJson(d); // Picks the right ToJson overload corresponding to the runtime type of 'd'


... although, dynamic has a fairly large runtime cost, and is generally considered smell.






share|improve this answer



























  • The switch is using some pattern matching? I wasn't aware switch statements in C# could do that! :)

    – Nick Bull
    Mar 27 at 14:48






  • 1





    @Nick Yes, since C# 7.0

    – canton7
    Mar 27 at 14:49











  • Oh man, it's been a while. I last used C# when it was at 5.0, I feel old

    – Nick Bull
    Mar 27 at 14:52






  • 1





    To be fair, nothing ground-breaking has happened since 5.0 (apart from Roslyn) - it's been lots of little improvements. C# 8 is going to be ground-breaking again, though

    – canton7
    Mar 27 at 14:54











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55379942%2foverloading-method-without-modifying-classes%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Without being able to modify the base class, or have access to the concrete type before it's turned into a generic Graphics type, unfortunately I don't think there's anything you can do except inspect the runtime type of the Graphics object.



You can use a switch statement (since C# 7.0), which is slightly cleaner than your if chain:



switch (g)

case Circle circle: ... break;
case Line line: ... break;
default: /* Oh no! */ break;



Personally I don't see much advantage in using a Dictionary over a switch statement like this - both can be put away into a little self-contained method (and so reduce the amount of violation of the open/close principle), but the switch will be significantly cheaper.



You can also use dynamic, which causes the runtime to do late binding:



dynamic d = g;
ToJson(d); // Picks the right ToJson overload corresponding to the runtime type of 'd'


... although, dynamic has a fairly large runtime cost, and is generally considered smell.






share|improve this answer



























  • The switch is using some pattern matching? I wasn't aware switch statements in C# could do that! :)

    – Nick Bull
    Mar 27 at 14:48






  • 1





    @Nick Yes, since C# 7.0

    – canton7
    Mar 27 at 14:49











  • Oh man, it's been a while. I last used C# when it was at 5.0, I feel old

    – Nick Bull
    Mar 27 at 14:52






  • 1





    To be fair, nothing ground-breaking has happened since 5.0 (apart from Roslyn) - it's been lots of little improvements. C# 8 is going to be ground-breaking again, though

    – canton7
    Mar 27 at 14:54
















2














Without being able to modify the base class, or have access to the concrete type before it's turned into a generic Graphics type, unfortunately I don't think there's anything you can do except inspect the runtime type of the Graphics object.



You can use a switch statement (since C# 7.0), which is slightly cleaner than your if chain:



switch (g)

case Circle circle: ... break;
case Line line: ... break;
default: /* Oh no! */ break;



Personally I don't see much advantage in using a Dictionary over a switch statement like this - both can be put away into a little self-contained method (and so reduce the amount of violation of the open/close principle), but the switch will be significantly cheaper.



You can also use dynamic, which causes the runtime to do late binding:



dynamic d = g;
ToJson(d); // Picks the right ToJson overload corresponding to the runtime type of 'd'


... although, dynamic has a fairly large runtime cost, and is generally considered smell.






share|improve this answer



























  • The switch is using some pattern matching? I wasn't aware switch statements in C# could do that! :)

    – Nick Bull
    Mar 27 at 14:48






  • 1





    @Nick Yes, since C# 7.0

    – canton7
    Mar 27 at 14:49











  • Oh man, it's been a while. I last used C# when it was at 5.0, I feel old

    – Nick Bull
    Mar 27 at 14:52






  • 1





    To be fair, nothing ground-breaking has happened since 5.0 (apart from Roslyn) - it's been lots of little improvements. C# 8 is going to be ground-breaking again, though

    – canton7
    Mar 27 at 14:54














2












2








2







Without being able to modify the base class, or have access to the concrete type before it's turned into a generic Graphics type, unfortunately I don't think there's anything you can do except inspect the runtime type of the Graphics object.



You can use a switch statement (since C# 7.0), which is slightly cleaner than your if chain:



switch (g)

case Circle circle: ... break;
case Line line: ... break;
default: /* Oh no! */ break;



Personally I don't see much advantage in using a Dictionary over a switch statement like this - both can be put away into a little self-contained method (and so reduce the amount of violation of the open/close principle), but the switch will be significantly cheaper.



You can also use dynamic, which causes the runtime to do late binding:



dynamic d = g;
ToJson(d); // Picks the right ToJson overload corresponding to the runtime type of 'd'


... although, dynamic has a fairly large runtime cost, and is generally considered smell.






share|improve this answer















Without being able to modify the base class, or have access to the concrete type before it's turned into a generic Graphics type, unfortunately I don't think there's anything you can do except inspect the runtime type of the Graphics object.



You can use a switch statement (since C# 7.0), which is slightly cleaner than your if chain:



switch (g)

case Circle circle: ... break;
case Line line: ... break;
default: /* Oh no! */ break;



Personally I don't see much advantage in using a Dictionary over a switch statement like this - both can be put away into a little self-contained method (and so reduce the amount of violation of the open/close principle), but the switch will be significantly cheaper.



You can also use dynamic, which causes the runtime to do late binding:



dynamic d = g;
ToJson(d); // Picks the right ToJson overload corresponding to the runtime type of 'd'


... although, dynamic has a fairly large runtime cost, and is generally considered smell.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 27 at 15:05

























answered Mar 27 at 14:47









canton7canton7

7,7351 gold badge19 silver badges31 bronze badges




7,7351 gold badge19 silver badges31 bronze badges















  • The switch is using some pattern matching? I wasn't aware switch statements in C# could do that! :)

    – Nick Bull
    Mar 27 at 14:48






  • 1





    @Nick Yes, since C# 7.0

    – canton7
    Mar 27 at 14:49











  • Oh man, it's been a while. I last used C# when it was at 5.0, I feel old

    – Nick Bull
    Mar 27 at 14:52






  • 1





    To be fair, nothing ground-breaking has happened since 5.0 (apart from Roslyn) - it's been lots of little improvements. C# 8 is going to be ground-breaking again, though

    – canton7
    Mar 27 at 14:54


















  • The switch is using some pattern matching? I wasn't aware switch statements in C# could do that! :)

    – Nick Bull
    Mar 27 at 14:48






  • 1





    @Nick Yes, since C# 7.0

    – canton7
    Mar 27 at 14:49











  • Oh man, it's been a while. I last used C# when it was at 5.0, I feel old

    – Nick Bull
    Mar 27 at 14:52






  • 1





    To be fair, nothing ground-breaking has happened since 5.0 (apart from Roslyn) - it's been lots of little improvements. C# 8 is going to be ground-breaking again, though

    – canton7
    Mar 27 at 14:54

















The switch is using some pattern matching? I wasn't aware switch statements in C# could do that! :)

– Nick Bull
Mar 27 at 14:48





The switch is using some pattern matching? I wasn't aware switch statements in C# could do that! :)

– Nick Bull
Mar 27 at 14:48




1




1





@Nick Yes, since C# 7.0

– canton7
Mar 27 at 14:49





@Nick Yes, since C# 7.0

– canton7
Mar 27 at 14:49













Oh man, it's been a while. I last used C# when it was at 5.0, I feel old

– Nick Bull
Mar 27 at 14:52





Oh man, it's been a while. I last used C# when it was at 5.0, I feel old

– Nick Bull
Mar 27 at 14:52




1




1





To be fair, nothing ground-breaking has happened since 5.0 (apart from Roslyn) - it's been lots of little improvements. C# 8 is going to be ground-breaking again, though

– canton7
Mar 27 at 14:54






To be fair, nothing ground-breaking has happened since 5.0 (apart from Roslyn) - it's been lots of little improvements. C# 8 is going to be ground-breaking again, though

– canton7
Mar 27 at 14:54









Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55379942%2foverloading-method-without-modifying-classes%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해