C# 3.0 introduced new functional programming features like LINQ, lambda expressions, and extension methods. LINQ allows querying data with query comprehension syntax translated into extension method calls. Lambda expressions add anonymous delegate syntax for functional programming. Extension methods allow adding methods to types without inheritance. C# 4.0 added dynamic typing support while maintaining static type safety. Future versions may include true metaprogramming, parallel execution, and additional functional programming features.
4. Beginning of C# C# was a first managed language to compete with Java Microsoft was lost in court because of J++ implementation C# 1.0 was designed and developed in 1999 C# 1.0 has basic OOP of inheritance, polymorphism Property mechanism is the same concept as VB 4.0+
5. C# is? Statically typed language Early bound Based on CLR and CTS of .NET Also part of “curly braces” languages such as C, C++, Objective C, Java Imperative language as part of OOP
6. Managed language is simply virtualization Just like Java runs in its VM Virtualization promotes cleaner environment, optimization, garbage collection, thread optimization within one “virtual” platform A light lose coupling between OS and application written in managed environment or virtualization Reduced OS version dependency and functionality
7. So why? It is simply, raising an abstraction, not adding abstraction Focusing more on what you want to be done, not how
10. Conceptual difference of abstraction Raising abstraction Intended to be more declarative Does not hide the detail of underlying platform Still can access the OS API using P/Invoke in .NET and JNI in Java Adding abstraction Not intended to be more declarative Often creating more new conceptual topics Often hide the detail of the underlying platform
11. What comes with C# 2.0 Adding generics on type and method declaration Generic type inference on methods and method parameters Reflection granularity Nullable types Iterator of “yield” Anonymous delegate
13. Continuous design from previous releases New features are based on previous releases Maintaining runtime compatibility and based on CLR of .NET 2.0
14. C# 3.0 theme LINQ Functional programming in style
15. LINQ is build on Query comprehension Extension method Lambda expression Expression tree Property initializer Anonymous type initializer Local variable type inference
16. Quick feature look var x = from c in db.customer where c.City ==“London” select c.Name, c.City Local type infer Query comprehension Lambda expression var x = db.Customer .Where(c => c.City == “London”) .Select(c=> new {c.Name,c.City} Extension method Anonymous object/type initializer
17. Query comprehension Adapting SQL query of SELECT Not a real keyword in C#, it is a pseudo keyword SELECT, WHERE, ORDER BY, GROUP BY is then translated into calls to extension methods
18. Lambda Expression overview It is simply an anonymous delegate but with the functional math syntax Taken from ideas in Lambda calculus
19. Extension methods Adding static method to a class or interfaces without deriving it Use it wisely Can be a bad smell in coding practice
20. Next is: C# 4.0 Main theme: support for dynamic type
21. Overview of C# 4.0 Dynamic type Co and Contra variance Optional and named parameters No PIA
22. Beyond C# 4.0 Compiler as a service True meta programming Method execution into multi core (parallel) Function purity