/* LIFE RUNS ON CODE*/ Konstantinos Pantos Microsoft MVP ASP.NET

Slides:



Advertisements
Similar presentations
2010 Microsoft Student Partners. T OPICS - User Interface and Editor Improvements - New windows: Call Hierarchy, Navigate To - IntelliSense - Generate.
Advertisements

Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Advanced Object-Oriented Programming Features
Inheritance and Polymorphism CS351 – Programming Paradigms.
Shallow Versus Deep Copy and Pointers Shallow copy: when two or more pointers of the same types point to the same memory – They point to the same data.
OOP Languages: Java vs C++
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Eric Vogel Software Developer A.J. Boggs & Company.
What’s New In Visual Studio 2010 Denys Kholod Technology Expert Hmarasoft.com.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
Programming Pillars Introduction to Object- Oriented Programming.
New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand.
Inheritance in the Java programming language J. W. Rider.
C# F 1 CSC 298 Object Oriented Programming (Part 1)
Chapter 12: Pointers, Classes, Virtual Functions, and Abstract Classes.
Chapter 3 Inheritance and Polymorphism Goals: 1.Superclasses and subclasses 2.Inheritance Hierarchy 3.Polymorphism 4.Type Compatibility 5.Abstract Classes.
Summing Up Object Oriented Design. Four Major Components: Abstraction modeling real-life entities by essential information only Encapsulation clustering.
Separating the Interface from the Engine: Creating Custom Add-in Tasks for SAS Enterprise Guide ® Peter Eberhardt Fernwood Consulting Group Inc.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 9 Inheritance and.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
Inheritance Inheritance is the process of extending the functionality of a class by defining a new class that inherit,all the features of extending class.
Terms and Rules II Professor Evan Korth New York University (All rights reserved)
Polymorphism and Virtual Functions One name many shapes behaviour Unit - 07.
C# Fundamentals An Introduction. Before we begin How to get started writing C# – Quick tour of the dev. Environment – The current C# version is 5.0 –
Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK.
Inheritance Modern object-oriented (OO) programming languages provide 3 capabilities: encapsulation inheritance polymorphism which can improve the design,
Polymorphism in Methods
DotNetSpider Editor Hefin Dsouza
Chapter 2: The Visual Studio .NET Development Environment
Creating Your Own Classes
Chapter 13: Pointers, Classes, Virtual Functions, and Abstract Classes
Advanced Object-Oriented Programming Features
Inheritance and Polymorphism
Jim Fawcett CSE681 – Software Modeling and Analysis Fall 2005
Class A { public : Int x; A()
CS212: Object Oriented Analysis and Design
Inheritance AKEEL AHMED.
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
Inheritance in Java.
Object-Orientated Programming
Array Array is a variable which holds multiple values (elements) of similar data types. All the values are having their own index with an array. Index.
Object Oriented Programming
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
Chapter 12: Pointers, Classes, Virtual Functions, and Abstract Classes
Chapter 9 Inheritance and Polymorphism
.NET and .NET Core 9. Towards Higher Order Pan Wuming 2017.
Java Programming Language
Lecture 22 Inheritance Richard Gesick.
Interfaces.
Object Oriented Practices
More Object-Oriented Programming
Polymorphism Polymorphism
ReSharper Dainius Kreivys.
Java – Inheritance.
Polymorphism Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2nd edition, by Kernighan.
Tonga Institute of Higher Education
CISC/CMPE320 - Prof. McLeod
How to organize and document your classes
CIS 199 Final Review.
5. 3 Coding with Denotations
Introduction to TypeScript
Chapter 11 Class Inheritance
Static Binding Static binding chooses the function in the class of the base class pointer, ignoring any versions in the class of the object actually.
Computer Science II for Majors
Presentation transcript:

/* LIFE RUNS ON CODE*/ Konstantinos Pantos Microsoft MVP ASP.NET Software Solutions Architect http://blog.pantos.name kostas@pantos.name

agenda C# 4 Language and Compiler features Visual C# Integrated Development Environment (VS 2010) features Parallel Programming in VS 2010

What’s New in C# 4.0

Dynamic Support Dynamic Lookup New dynamic type Resolution of method calls or field accesses is deferred until runtime Allows for calling or accessing identical methods or properties across unrelated objects Visual C# 2010 provides support for late binding to dynamic types by introducing a new type, dynamic. This addition enables many new scenarios, including simplified access to COM APIs such as the Office Automation APIs, to dynamic APIs such as IronPython libraries, and to the HTML Document Object Model (DOM). For more information, see Using Type dynamic (C# Programming Guide) and dynamic (C# Reference).

Dynamic Support Dynamic Lookup DLR – Dynamic Language Runtime is underlying mechanism This could be done before, using reflection or interfaces etc, but it would require much more work

Dynamic Demo

Dynamic support (Insight) C# is statically typed language How did it became dynamic? DLR (Dynamic Language Runtime) in play

Dynamic Programming DLR is additional libraries to fit the dynamic languages into the CLR Store program/code as data Caching mechanism for dynamic call Provide language specific support

Dynamic Programming Pros Cons No risk of brittle class hierarchy Need not implement all methods of interface More flexible , highly productive Cons Developer needs thorough understanding of codebase Misuse might lead to poor maintainability

Named and Optional Parameters Historically multiple overloads were required to achieve this type of thing in c# Named parameters were never possible Now this can be done using the optional argument syntax in a single constructor

Named – Optional Demo

Variance Variance is one of those things most of us don’t often have to think about comes naturally There are some cases which you may assume should work that don’t however.

Variance The following example does not work even though string obviously inherits from object If it did, the following would have to work, which goes against type safety IList<string> strings = new List<string>(); IList<object> objects = strings; Objects[0] = 5; String s = strings[0];

Covariance and Contravariance There may however be times where you would want to have this type of thing happening and for it to happen safely C# 4.0 allows for covariance and contravariance through the new out and in keywords Works only for interfaces and delegates Works only for reference types Actual bits don’t change

Covariance Contravariance Demo

Office programmability Removes dependency on Office PIAs Language enhancements C# Optional Parameters, Named Arguments, Dynamic types

Demo: Excel Add In

Visual C# Integrated Development Environment

Call Hierarchy Call Hierarchy enables navigation through code by displaying the following: All calls to and from a selected method, property, or constructor All implementations of an interface member All overrides of a virtual or abstract member Enables better understanding of how code flows and evaluation of the effects of changes to code.

Navigate To Search for a symbol or file in source code Search for keywords that are contained in a symbol by using Camel casing and underscore characters to divide the symbol into keywords

Highlighting References When you click a symbol in source code, all instances of that symbol are highlighted in the document. You can move to the next or previous highlighted symbol, by CTRL+SHIFT+DOWN ARROW or CTRL+SHIFT+UP ARROW

Generate From Usage Enables usage of classes and members before defining them. Generate a stub for a class, constructor, method, property, field, or enum before defining it. Minimizes interruption of workflow

IntelliSense Suggestion Mode Two alternatives for IntelliSense statement completion Completion mode Suggestion mode Used when classes and members are used before they are defined

Live Semantic Errors Wavy underlines which signal errors and warnings as you type has been extended to include constructs that are outside of method bodies. Return types, Parameter types, Default values in method declarations

Visual C# IDE Demo

Parallel programming

Parallel Computing Features. Parallel API Parallel Profiling Parallel debugger Concurrency visualizer in VS2010

Parallel Programming Demo

Resources What’s new in Visual C# 2010 http://msdn.microsoft.com/en-us/library/bb383815.aspx Visual Studio 2010 http://msdn.microsoft.com/el-gr/vstudio/ff625297(en-us).aspx Parallel Computing http://msdn.microsoft.com/en-us/concurrency/default.aspx Daniel Moth http://www.danielmoth.com/Blog

Thank you