O que há de novo no C# 4.0 e no Visual Basic 10



Similar documents
Diversen Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

Microsoft Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

Programming in C# with Microsoft Visual Studio 2010

Classe AGI - PHP 5.x

Hands-On Lab. Microsoft Office Programmability in C# and Visual Basic. Lab version: 1.0.0

Outline Basic concepts of Python language

ArcHC_3D research case studies (FCT:PTDC/AUR/66476/2006) Casos de estudo do projecto ArcHC_3D (FCT:PTDC/AUR/66476/2006)


ClientAce WPF Project Example

SharePoint 2007 & 2010 (and Office 365!) Customization for Site Owners End User / Dev (100/200)

Many applications consist of one or more classes, each containing one or more methods. If you become part of a development team in industry, you may

MICROSOFT CERTIFICATION FAQ s

Java Cheatsheet. Tim Coppieters Laure Philips Elisa Gonzalez Boix

Descripcion Horas Codigo Productividad Microsoft (Deducibles INCES)

Professional Services. Plant Applications SDK Guidelines GE FANUC AUTOMATION. Prepared by. Donna Lui Professional Services

.NET Overview. Andreas Schabus Academic Relations Microsoft Österreich GmbH

Hands-On Lab. Client Workflow. Lab version: Last updated: 2/23/2011

Microsoft Training and Certification Guide. Current as of March 16, 2015

70-243: Administering and Deploying System Center 2012 Configuration Manager : Monitoring and Operating a Private Cloud with System Center 2012

Ambientes de Desenvolvimento Avançados

IVR Studio 3.0 Guide. May Knowlarity Product Team

! "#" $ % & '( , -. / 0 1 ' % ' 3" 4569& 7 456: % 9 ; ; <&= 3 %,< & 4 4 % : ' % > ' % ? 1 3 & B&?

USER GUIDE Appointment Manager

COSC Introduction to Computer Science I Section A, Summer Question Out of Mark A Total 16. B-1 7 B-2 4 B-3 4 B-4 4 B Total 19

VB.NET INTERVIEW QUESTIONS

Custom fields validation

Lab 8: ASP.NET 2.0 Configuration API and Health Monitoring

MICROSOFT CERTIFICATION PROGRAM AGREEMENT

Computer Security - Tutorial Sheet 3: Network & Programming Security

Saindo da zona de conforto resolvi aprender Android! by Daniel Baccin

CSE 1020 Introduction to Computer Science I A sample nal exam

Scientific Programming, Analysis, and Visualization with Python. Mteor 227 Fall 2015

Enterprise Application Development Using UML, Java Technology and XML

PRI-(BASIC2) Preliminary Reference Information Mod date 3. Jun. 2015

MCSD Azure Solutions Architect [Ativar Portugal] Sobre o curso. Metodologia. Microsoft - Percursos. Com certificação. Nível: Avançado Duração: 78h

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

UniFinger Engine SDK Manual (sample) Version 3.0.0

Continuous Integration Part 2

CV Daniel Brünteson. Software Architect & Developer Contact data. Competencies. Employments. Education

Aplicação ASP.NET MVC 4 Usando Banco de Dados

Two-Dimensional Arrays Summer 2010 Margaret Reid-Miller

Using ilove SharePoint Web Services Workflow Action

Pemrograman Dasar. Basic Elements Of Java

AP Computer Science Java Subset

Programming PHREEQC Calculations with C++ and Python A Comparative Study

How to create a SMTP plugin for ArGoSoft Mail Server,.NET edition (AMS.NET edition) using Visual Studio 2005

Moving from C++ to VBA

Visual basic string search function, download source code visual basic 6.0 gratis. > Visit Now <

Programming Language Rankings. Lecture 15: Type Inference, polymorphism & Type Classes. Top Combined. Tiobe Index. CSC 131! Fall, 2014!

User Manual. 3-Heights PDF Producer API. Version 4.6

Python 2 and 3 compatibility testing via optional run-time type checking

Curso SQL Server 2008 for Developers

Introduction. Why (GIS) Programming? Streamline routine/repetitive procedures Implement new algorithms Customize user applications

SINGLE SIGNON FUNCTIONALITY IN HATS USING MICROSOFT SHAREPOINT PORTAL

Visual Basic Programming. An Introduction

Visual C# 2012 Programming

Algorithms and Data Structures Written Exam Proposed SOLUTION

Product Roadmap. Sushant Rao Principal Product Manager Fortify Software, a HP company

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

How To Use A Com In A Microsoft Com 2.5 (Dsi) (Dsi) (For Microsoft) (Com) (Sib) (Operations) (Orchestra) (Ahem) (I

USERS, PROFILES, & MYSITES

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

TREINAMENTO OFICIAL MICROSOFT

LINQ: Language Integrated Query. ST Colloquium, Tom Lokhorst

MXwendler Javascript Interface Description Version 2.3

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

Introducing the.net Framework 4.0

Prova escrita de conhecimentos específicos de Inglês

Classes para Manipulação de BDs 5

Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following:

COMP 356 Programming Language Structures Notes for Chapter 10 of Concepts of Programming Languages Implementing Subprograms.

The C Programming Language course syllabus associate level

HybriDroid: Analysis Framework for Android Hybrid Applications

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Kepware Technologies ClientAce: Creating a Simple Windows Form Application

Dsc+Mock: A Test Case + Mock Class Generator in Support of Coding Against Interfaces

El poder de la Programación de Excel y Visual Basic User Review --->>> Enter Here More Details => VISIT HERE

C Compiler Targeting the Java Virtual Machine

Aspect Oriented Programming. with. Spring

CHAPTER 5 INTELLIGENT TECHNIQUES TO PREVENT SQL INJECTION ATTACKS

Reach 4 million Unity developers

Transcription:

O que há de novo no C# 4.0 e no Visual Basic 10 Agnaldo Diogo dos Santos MCT, MCPD, 4 MCITP, 5 MCTS, MCSE, MCDBA, MCSD, MCP, SCJP 50minutos.com.br/blog agnaldo@50minutos.com.br @50minutos

Essência x Formalismo Simples, Conciso, Claro

Formalismo no C# 3.0 Removendo valores mágicos usando variáveis temporárias GenerateChart(20, true); var processcount = 20; var copytoword = true; GenerateChart(processCount, copytoword);

Formalismo no C# 3.0 Removendo valores mágicos usando variáveis temporárias GenerateChart(20, true); GenerateChart(20 /* processcount */, true /* copytoword */);

Formalismo no C# 3.0 Parâmetros opcionais usando sobrecarga de métodos void GenerateChart(int processcount) { GenerateChart(processCount, false); } void GenerateChart(int processcount, bool copytoword) { // Do Something }

Formalismo no C# 3.0 COM Interop e o sempre presente ref Missing.Value var word = new Word.Application(); word.documents.add(ref Missing.Value, ref Missing.Value, ref Missing.Value, ref Missing.Value);

Essência x Formalismo in C# 4.0

Formalismo no VB 9 backing fields explícitos para as propriedades Private m_name As String Public Property Name() As String Get Name = m_name End Get Set (ByVal value As String) m_name = value End End Property

Formalismo no VB 9 Popularidade das bibliotecas que usam expressões lambda causam problemas para desenvolvedores VB Sub MyMethod() LambdaCall(Function(i) TempMethod(i) End Function) End Sub Introduction of Function TempMethod(Dim param as Integer) As Nothing temporary Console.WriteLine(param) functions Return Nothing End Function Hacks since statement lambdas not supported

Formalismo no VB 9 O desenvolvedor deve indicar a continuidade da linha de comando SomeLongMethodCall(firstParam, _ secondparam, _ thirdparam, _ fourthparam, _ fifthparam)

Essência x Formalismo no VB 10

Por que Dynamic Language Runtime? Dynamically-Typed Python Ruby Statically-Typed C# VB Common Language Runtime

Por que Dynamic Language Runtime? Dynamically-Typed Python Ruby Statically-Typed C# VB Dynamic Language Runtime Common Language Runtime

Formalismo no C# 3.0 Interoperabilidade com Dynamic Language é problemática Calculator calc = GetCalculator(); int sum = calc.add(10, 20);

Formalismo no C# 3.0 Interoperabilidade com Dynamic Language é problemática object calc = GetCalculator(); Type calctype = calc.gettype(); object res = calctype.invokemember("add", BindingFlags.InvokeMethod, null, new object[] { 10, 20 }); int sum = Convert.ToInt32(res);

Formalismo no C# 3.0 Interoperabilidade com Dynamic Language é problemática ScriptObject calc = GetCalculator(); object res = calc.invoke("add", 10, 20); int sum = Convert.ToInt32(res);

Essência no C# 4.0 Interoperabilidade com Dynamic Languages Statically typed to be dynamic NÃO é problemática dynamic calc = GetCalculator(); int sum = calc.add(10, 20); Dynamic conversion Dynamic method invocation

O poder do late-binding

Novas features no C# 4.0 e VB 10 Feature VB10 C#4 Auto-implemented Properties Collection Initializers Statement Lambdas Implicit Line Continuation N/A Named/Optional Parameters Latebinding support (dynamic) Omit ref on COM calls New in Dev10 Already exists in VB9/C#3

Novas features no C# 4.0 e VB 10 Feature VB10 C#4 Auto-implemented Properties Collection Initializers Statement Lambdas Implicit Line Continuation N/A Named/Optional Parameters Latebinding support (dynamic) Omit ref on COM calls Interop with Dynamic Languages Co/contravariance PIA deployment not needed New in Dev10 Already exists in VB9/C#3

Novas features no C# 4.0 e VB 10 Feature VB10 C#4 Auto-implemented Properties Collection Initializers Statement Lambdas Implicit Line Continuation N/A Named/Optional Parameters Latebinding support (dynamic) Omit ref on COM calls Interop with Dynamic Languages Co/contravariance PIA deployment not needed Iterators XML Literals New in Dev10 Already exists in VB9/C#3

Fixando o Type System Covariance e Contravariance Parece complicado Mas não é!

Fixando o Type System Por que tipos genéricos dão pau atualmente? class Animal { } class Sheep : Animal { } void Speak(IEnumerable<Animal> animals) { // Do something with Animals Not Allowed: } var sheep = new List<Sheep>(); Speak(sheep); IEnumerable<Animal>!= IEnumerable<Sheep>

Resumindo Covariance pense out Contravariance pense in

Especificação das linguagens http://bit.ly/ah7rpb C# do 1.0 ao 4.0 e VB.NET 10

50minutos.com.br/blog agnaldo@50minutos.com.br @50minutos