Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Why do I Love C#?


Published on

In this session I have discussed what are the major features that makes me love C# as a language. I presented this in front of 250 audiences in Jadavpur University campus.

Published in: Technology
  • Be the first to comment

Why do I Love C#?

  1. 1. By Abhishek Sur Website: www.abhisheksur.comEmail :
  2. 2. .NET Infrastructure User Interface Services Data Access ASP.NET Windows Windows Windows (WebForms, Entity Presentation Communication Workflow ADO.NETMVC, Dynamic Framework Foundation Foundation Foundation Data) WinForms Data Services LINQ to SQL Cloud (ODATA) Core Generics LINQ Dynamic Async Base Class Library Common Language Runtime
  3. 3. Agenda • Delegates • Events Language • Generics • Iterators Features • Extension Methods of C# • LINQ • Dynamic Types • Async
  4. 4. Delegates Delegates are special types Delegate points to Methods Delegates are not Function PointersEvents Events are Wrappers to Delegates Cleaner pattern to handle Delegates Only use when you do require
  5. 5. Delegates & Events
  6. 6. Generics Type as Template Constraint on Generic Types It can be applied on Types, Method, Delegates etc.Extension Methods Extend your predefined Types without inheritance Available when appropriate namespace is available
  7. 7. Generics &Extension Methods
  8. 8. Iterators Forms a State Machine which can pause – Continue a method. We create Itreators using yield keyword in C# which generates an IEnumerable. Any Collection can be represented by Ienumerable Iterators represents a sequence (finite / Infinite)
  9. 9. Iterators
  10. 10. Anonymous Language Object Object can exist in language without name Cleaner codebase. Anonymous methods are used as Closures. We use delegate to refer anonymous methods and var for types.LINQ Search inside Managed objects Simple projection, selection, grouping, joins and many more…
  11. 11. Anonymous Types & LINQ
  12. 12. Dynamic in .NET 4.0 CLR is mostly static type ◦ Compile time type checking DLR added dynamism to .NET ◦ Run time type checking Object – Static type, base class var – is ALSO static type, compiler inferred dynamic – Evaluation deferred Expandable objects
  13. 13. Dynamic
  14. 14. Going Beyond… (Async)
  15. 15. New Asynchronous Pattern Contextual async & await pattern simplifies complex Threading model or existing pattern of coding Async is not about Concurrency but rather it is truly asynchrony. It can easily plugged in without changing the logic. Compiler generates state machine to resume methods
  16. 16. Async & Await
  17. 17. Abhishek Sur, MVP (Client App Dev) Email: Twitter : @abhi2434 Thank you.