Object Oriented Programming Pain Points<br />
Database<br />General Architecture(Simplified)<br />Data Access (O/R)<br />User Interface<br />Domain Model<br />User Inte...
Needed Changes in Maintenance<br />
The shape of objects have to be specified before the functionality	<br />
Object<br />
vs. function-parameter<br />
“Generic/common” objects<br />
The pain points of C#<br />
Immutable property<br />public class MyObject<br />{<br />    private readonly string myproperty;<br />    public string M...
Type Definitions<br />var list = new List<List<int>>{<br />                new List<int>{1,2,3},<br />                new ...
F# Syntax<br />type MyObject(prop:string) =<br />     member x.MyProperty = prop<br />let list = [[1;2;3];[4;5;6]] <br />l...
Generics Parameter Constructor<br />
void is not a type<br />
There is no “either-or”-type<br />
Upcoming SlideShare
Loading in …5

The Pain Points of C#


Published on

Published in: Entertainment & Humor
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Every tier has an Interface and a concrete class Concrete class is not found easily, it may be resolved with IoC Interfaces between layers have to be constant Usually layers are “useless” pass-through-layers Maybe some null-checks (and object-mapping to another-layer-objects) OMG Ponies: http://msmvps.com/blogs/jon_skeet/archive/2009/11/02/omg-ponies-aka-humanity-epic-fail.aspx
  • Maintenance code changes are more expensive than development There are two main reasons to change code in maintenance: Business-need change, role change of a Domain-objectBug: Code seems to be different than how program works In any case, we have serious problems
  • Objects have been said to be natural model for humans. Have to be designed bottom-up (details first), although specifications are made the opposite way.
  • Here is a container… Then we will need manager, provider, factory, …And interfaces of course…What this actually does?
  • ”Common” will never work, because we don’t know the future needs The only working solution for common functionality is Reflection No compile time error checking There is a reason why there is a type system in .NET!
  • - How hard can it be??? Noise! Basic property { get;set; } is easy. But it is hard to make objects, which someone else coulnd’t set to invalid state.
  • The function in the bottom is actually real… :-)
  • The new language and thesmaller syntax and better libraries are actually not the main point.F# also has higher level of abstraction. Like C-language has higher level of abstraction than assembly-language.
  • Of course, with Java, you couldn’t do anything like this:The “generics” of Java are just “syntactic sugar”, the compiler will optimize those away
  • - This would be ok, if the language would separate side effects in some way. However a Func can also cause a side effect. For this reason: F#-functions are not compatible with C#, Real pattern matching won’t work F# list handling has more expression power than LINQ. In addition, separating lists to different IEnumerables is hard (mostly possible only with a GroupBy-trick).
  • Drifting to Reflection: performance hit, loss of compiler time error checks
  • The Pain Points of C#

    1. 1. Object Oriented Programming Pain Points<br />
    2. 2. Database<br />General Architecture(Simplified)<br />Data Access (O/R)<br />User Interface<br />Domain Model<br />User Interface <br />Data Model<br />Business Logics<br />User Interface Logics<br />Service layer<br />Debug<br />
    3. 3. Needed Changes in Maintenance<br />
    4. 4. The shape of objects have to be specified before the functionality <br />
    5. 5. Object<br />
    6. 6. vs. function-parameter<br />
    7. 7. “Generic/common” objects<br />
    8. 8. The pain points of C#<br />
    9. 9. Immutable property<br />public class MyObject<br />{<br />    private readonly string myproperty;<br />    public string MyProperty { <br />        get{<br />            return myproperty;<br />        }<br />    }<br />    public MyObject(string prop)<br />    {<br />        myproperty = prop;<br />    }<br />}<br />
    10. 10. Type Definitions<br />var list = new List<List<int>>{<br />                new List<int>{1,2,3},<br />                new List<int>{4,5,6},<br />};<br />Ok!<br />Noise!<br />Func<Func<int, List<int>, string>,<br /> Func<int, List<int>>, int, string> S = (x, y, z)=> x(z, y(z));  <br />
    11. 11. F# Syntax<br />type MyObject(prop:string) =<br />     member x.MyProperty = prop<br />let list = [[1;2;3];[4;5;6]] <br />let S x y z = x z (y z) <br />Ok!<br />
    12. 12. Generics Parameter Constructor<br />
    13. 13. void is not a type<br />
    14. 14. There is no “either-or”-type<br />