C# Amy Broom Hossam Ragaban Randal Rollings Fall 2003.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Introduction to ASP.NET.
Advertisements

Introduction to .NET Framework
Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
C#.NET C# language. C# A modern, general-purpose object-oriented language Part of the.NET family of languages ECMA standard Based on C and C++
Trey Mack James Moore Osa Osar-Emokpae
History  We first begin with Java which was released in 1995 by Sun Microsystems  Initially Java was 100% interpreted at runtime and was very slow 
C#: Project Cool Arthur Ketchel II Keith Francisco Chris McInnis.
INSTRUCTOR: DR MARCO VALTORTA CSCE 330 C# GROUP MEMBERS: KONSTANTINOS MALEGOS YASSER AL-MUTAIRY CHRIS HESTER UNIVERSITY OF SOUTH CAROLINA.
Intro to C# Language Richard Della Tezra IS 373. What Is C#? C# is type-safe object-oriented language Enables developers to build a variety of secure.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
From C++ to C#. Web programming The course is on web programming using ASP.Net and C# The course is on web programming using ASP.Net and C# ASP.Net is.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Introduction to .Net Framework
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
 2002 Prentice Hall. All rights reserved. 1 Introduction to Visual Basic.NET,.NET Framework and Visual Studio.NET Outline 1.7Introduction to Visual Basic.NET.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a library for.
Microsoft Visual Basic 2005: Reloaded Second Edition
C# Overview and Features. Content I.History of C# II.Architecture III.How to install IV.Features V.Code Sample VI.Microsoft.NET Platform VII.Why use C#
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Why Java? A brief introduction to Java and its features Prepared by Mithat Konar.
MESDA Conference 2002 MESDA Annual Conference 2002 Software Development Track Java vs. C#
.NET Language Supports. .NET Language Support Operating System Common Language Runtime Base Class Library ADO.NET and XML ASP.NET Web Forms Web Services.
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
C# Versus Java Author: Eaddy, Marc Source: Software Tools for the Professional Programmer. Dr. Dobb's Journal. Feb2001, Vol. 26 Issue 2, p74 Hong Lu CS699A.
1 C# A brief overview by Jack Senechal and Bryan Powell.
tom perkins1 XML Web Services -.NET FRAMEWORK – Part 1 CHAPTER 1.1 – 1.3.
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
C# Language Panithan Chandrapatya Agenda C# History C# Goals C# Fixes C# Contribution C# Features C# Success C# Example.
C# EMILEE KING. HISTORY OF C# In the late 1990’s Microsoft recognized the need to be able to develop applications that can run on multiple operating system.
Chapter 2: A Brief History Object- Oriented Programming Presentation slides for Object-Oriented Programming by Yahya Garout KFUPM Information & Computer.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
Object Oriented Software Development 4. C# data types, objects and references.
Java – in context Main Features From Sun Microsystems ‘White Paper’
INTRODUCTION CHAPTER #1 Visual Basic.NET. VB.Net General features It is an object oriented language  In the past VB had objects but focus was not placed.
Introduction to C# Programming with Microsoft.NET AY
July 22, 2001Introduction to.NET1 Introduction to.NET Framework Gholamali Semsarzadeh July 2001.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
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 –
Introduction to Programming 1 1 2Introduction to Java.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Java and C# - Some Commonalities Compile into machine-independent, language- independent code which runs in a managed execution environment Garbage Collection.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Intro to ASP.NET CS-422 Dick Steflik. What is.NET As applications in the Enterprise become more and more netcentric and less and less standalone.NET is.
Introduction to .NET framework
Object Oriented Programming in
Before You Begin Nahla Abuel-ola /WIT.
Introduction Enosis Learning.
Introduction Enosis Learning.
(Computer fundamental Lab)
Java History, Editions, Version Features
Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net
IS 135 Business Programming
Presentation transcript:

C# Amy Broom Hossam Ragaban Randal Rollings Fall 2003

History The history of C# begins early in 1970’s when C was invented in which UNIX was written. But C had some drawbacks. The power that C affords the programmer makes it easy for him to blunder. For example, it allows the programmer to directly allocate memory and permits him to deallocate this memory. The history of C# begins early in 1970’s when C was invented in which UNIX was written. But C had some drawbacks. The power that C affords the programmer makes it easy for him to blunder. For example, it allows the programmer to directly allocate memory and permits him to deallocate this memory. Then came C++ in the 1980’s, who like its predecessor took the world by a storm. Despite it being object-oriented C++ had some problems. Veteran programmers often had problems migrating from C (structured) to C++ ( object- oriented ) because effective C++ programming requires a completely new mindset. Then came C++ in the 1980’s, who like its predecessor took the world by a storm. Despite it being object-oriented C++ had some problems. Veteran programmers often had problems migrating from C (structured) to C++ ( object- oriented ) because effective C++ programming requires a completely new mindset.

More History Sun created Java. They were motivated with the World Wide Web. They sought a single environment that would target multiple platforms. Programs in Java are not compiled to machine code, but instead to an intermediate language or bytecode that can be executed on any computer equipped with a suitable interpreter program (The Java Runtime). Sun created Java. They were motivated with the World Wide Web. They sought a single environment that would target multiple platforms. Programs in Java are not compiled to machine code, but instead to an intermediate language or bytecode that can be executed on any computer equipped with a suitable interpreter program (The Java Runtime). Today, Microsoft unveils an alternative strategy for bringing the development and web worlds together and online with.NET. Because all.NET languages compile to a common bytecode, a developer can program in whichever language he wants and share his works with other developers using other.NET languages. Today, Microsoft unveils an alternative strategy for bringing the development and web worlds together and online with.NET. Because all.NET languages compile to a common bytecode, a developer can program in whichever language he wants and share his works with other developers using other.NET languages.

Even More History In June 2000, Microsoft announced both the.NET platform and a new programming language called C#. C# is a strongly-typed object-oriented language designed to give the optimum blend of simplicity, expressiveness, and performance. The.NET platform is centered around a Common Language Runtime (similar to a JVM) and a set of libraries which can be exploited by a wide variety of languages which are able to work together by all compiling to an intermediate language (IL). C# and.NET are a little symbiotic: some features of C# are there to work well with.NET, and some features of.NET are there to work well with C# (though.NET aims to work well with many languages). The C# language was built with the hindsight of many languages, but most notably Java and C++. It was co-authored by Anders Hejlsberg (who is famous for the design of the Delphi language), and Scott Wiltamuth.

Common Language Runtime The CLR serves as an execution engine for applications. The CLR serves as an execution engine for applications. Every byte of code that you write for the framework runs in the CLR. Every byte of code that you write for the framework runs in the CLR. CLR consists of instructions written in CIL(common intermediate language-pseudo-machine language). CIL instructions are just-in-time and compiled into native machine code at run time. CLR consists of instructions written in CIL(common intermediate language-pseudo-machine language). CIL instructions are just-in-time and compiled into native machine code at run time. A given method is compiled only once-the first time it is called-and thereafter cached in memory so it can be executed again without delay. A given method is compiled only once-the first time it is called-and thereafter cached in memory so it can be executed again without delay.

This robust development package, which uses the component oriented C# development language, offers beginning and intermediate developers with C++ or Java experience a modern language and environment for creating next-generation software. Visual C#.NET 2003 delivers superior functionality for streamlining business processes, including: Rapid design, development, and deployment support for creating and consuming Web services. Rapid design, development, and deployment support for creating and consuming Web services. Form designers and visual controls for creating rich Windows- based applications. Form designers and visual controls for creating rich Windows- based applications. Authoring tools and services for building powerful Microsoft.NET server-based solutions. Authoring tools and services for building powerful Microsoft.NET server-based solutions. Migration tools for converting Java-based projects to the Microsoft.NET development environment Migration tools for converting Java-based projects to the Microsoft.NET development environment Advantages

With Visual C#.NET 2003, developers can build solutions for a wide range of clients; including Windows, the Web, and mobile or embedded devices. Using this elegant programming language and its tools, developers can leverage their existing C++ and Java-language skills and knowledge to be successful in the.NET environment. Advantages

Improvements C# offers significant improvements including: unified type system, powerful new language constructs which are easily understood by developers, and “unsafe” code of maximum developer control. The language provides inherent support for properties, indexers, versioning, operator overloading, delegates, and custom attributes. C# offers significant improvements including: unified type system, powerful new language constructs which are easily understood by developers, and “unsafe” code of maximum developer control. The language provides inherent support for properties, indexers, versioning, operator overloading, delegates, and custom attributes.

C# and Java Similarities Compiles into machine-independent language- independent code which runs in a managed execution environment. Compiles into machine-independent language- independent code which runs in a managed execution environment.managed execution environmentmanaged execution environment Garbage Collection coupled with the elimination of pointers (in C# restricted use is permitted within code marked unsafe) Garbage Collection coupled with the elimination of pointers (in C# restricted use is permitted within code marked unsafe) No header files, all code scoped to packages or assemblies, no problems declaring one class before another with circular dependencies No header files, all code scoped to packages or assemblies, no problems declaring one class before another with circular dependencies Classes all descend from object and must be allocated on the heap with new keyword Classes all descend from object and must be allocated on the heap with new keyword Thread support by putting a lock on objects when entering code marked as locked/synchronized Thread support by putting a lock on objects when entering code marked as locked/synchronized Interfaces, with multiple-inheritance of interfaces, single inheritance of implementations Interfaces, with multiple-inheritance of interfaces, single inheritance of implementations Inner classes Inner classes

C# and Java Similarities cont. No concept of inheriting a class with a specified access level No concept of inheriting a class with a specified access level No global functions or constants, everything belongs to a class No global functions or constants, everything belongs to a class Arrays and strings with lengths built-in and bounds checking Arrays and strings with lengths built-in and bounds checking The "." operator is always used, no more - >, :: operators The "." operator is always used, no more - >, :: operators null and boolean/bool are keywords null and boolean/bool are keywords All values are initialized before use All values are initialized before use Try Blocks can have a finally clause Try Blocks can have a finally clause

Main Features 1. Pointers are missing in C#. 2. Unsafe operations such as direct memory manipulation are not allowed. 3. In C# there is no usage of "::" or "->" operators. 4. Since it`s on.NET, it inherits the features of automatic memory management and garbage collection. 5. Integer values of 0 and 1 are no longer accepted as boolean values.Boolean values are pure true or false values in C# so no more errors of "="operator and "=="operator. "==" is used for comparison operation and "=" is used for assignment operation.

Testing and Debugging Testing and debugging tools are of the languages features providing a powerful remote and multi-language debugger that allows developers to test applications and build reliable multi-tier solutions that span process boundaries and are written in multiple programming languages. Testing and debugging tools are of the languages features providing a powerful remote and multi-language debugger that allows developers to test applications and build reliable multi-tier solutions that span process boundaries and are written in multiple programming languages.

Delegates A delegate can be thought of as a type-safe object- oriented function pointer, which is able to hold multiple methods rather than just one. Delegates handle problems which would be solved with function pointers in C++, and interfaces in Java. It improves on the function pointer approach by being type safe and being able to hold multiple methods. It improves on the interface approach by allowing the invocation of a method without the need for inner-class adapters or extra code to handle multiple-method invocations.

Events C# provides direct support for events. Although event handling has been a fundamental part of programming since programming began, there has been surprisingly little effort made by most languages to formalize this concept. If you look at how today's mainstream frameworks handle events, we've got examples like Delphi's function pointers (called closures), Java's inner class adaptors, and of course, the Windows API's message system. C# uses delegates along with the event keyword to provide a very clean solution to event handling.

Properties Properties will be a familiar concept to Delphi and Visual Basic users. The motivation is for the language to formalize the concept of getter/setter methods, which is an extensively used pattern, particularly in RAD (Rapid Application Development) tools. Properties will be a familiar concept to Delphi and Visual Basic users. The motivation is for the language to formalize the concept of getter/setter methods, which is an extensively used pattern, particularly in RAD (Rapid Application Development) tools. This is typical code you might write in Java or C++: This is typical code you might write in Java or C++: foo.setSize (getSize () + 1); label.getFont().setBold (true); The same code you would write like this in C#: The same code you would write like this in C#:foo.size++; label.font.bold = true;

Polymorphism Virtual methods allow object oriented languages to express polymorphism. This means a derived class can write a method with the same signature as a method in its base class, and the base class will call the derived class's method. By default in Java, all methods are virtual. In C#, like C++, the virtual keyword must be used so that the method will be called by the base class.

Foreach Statement C# provides a shorthand for for-loops: In Java or C++: In Java or C++: for (int i = 0; i < array.length; i++)... for (int i = 0; i < array.length; i++)... In C#: In C#: foreach (int i in array)...

Bibliography default.aspx default.aspx default.aspx default.aspx /default.aspx /default.aspx