mardi 24 janvier 2017

Are all Java design patterns relevant to C# and vice versa? [on hold]

Design patters should be standard or template of how to solve a programming problem. They should be language-agnostic. However, I believe this is true only partially.

For example, C# and Java are usually considered very similar languages. However, while Java is purely object-oriented, C# mixes OO and functional programming. Thus, there should be some design patterns that do not make sense in Java or C#, but do in the other language.

One of such design patterns is definitely Observer. This is one of the most used design patterns in Java, but totally obsolete in C#, where events are used instead. I believe, Strategy is another design pattern that does not make sense in C#, since it can be replaced by delegate or Command.

So, are all design patterns relevant to both languages? Or does there exist a comprehensive list of Java- and C#-specific design patterns? Moreover, are statements from functional programming preferred to design patterns, or are they equal? Or should design patterns be used instead of functional programming?

Aucun commentaire:

Enregistrer un commentaire