C# and the .NET Framework

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Introduction to ASP.NET.
Chapter 1: Introduction
PLLab, NTHU Cs2403 Programming Languages Implementation Issues Cs2403 Programming Language Spring 2005 Kun-Yuan Hsieh.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
Revealing the CLR 4.0 Internals Svetlin Nakov Telerik Corporation
Introduction to the C# Programming Language for the VB Programmer.
Introduction to Computing and Programming
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
An Overview of Computers and Programming
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
CH1 – A 1 st Program Using C#. Program Set of instructions which tell a computer what to do. Machine Language Basic language computers use to control.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Introduction 01_intro.ppt
A First Program Using C#
Introduction to .Net Framework
CSC300 Visual Programming Dr. Craig Reinhart. Objectives Teach the basics of C++ –You won’t be an expert but hopefully a very good novice –GUI development.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Module 1: Introduction to C# Module 2: Variables and Data Types
C# A 1 CSC 298 Introduction to C#. C# A 2 What to expect in this class  Background: knowledge of an object oriented language of the C++, Java, … family.
Introduction to .NET Framework
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
 Java Programming Environment  Creating Simple Java Application  Lexical Issues  Java Class Library.
C# B 1 CSC 298 Writing a C# application. C# B 2 A first C# application // Display Hello, world on the screen public class HelloWorld { public static void.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Computing with C# and the.NET Framework Chapter 1 An Introduction to Computing with C# ©2003, 2011 Art Gittleman.
ISYS 573 Special Topic – VB.Net David Chao. The History of VB Early 1960s:BASIC-Beginner’s All-Purpose Symbolic Instruction Code –Teaching –Simple syntax,
UNIT - 1Topic - 3. Computer software is a program that tells a computer what to do. Computer software, or just software, is any set of machine-readable.
Programming in C#. I. Introduction C# (or C-Sharp) is a programming language. C# is used to write software that runs on the.NET Framework. Although C#
Week 1: THE C# LANGUAGE Chapter 1: Variables and Expressions ➤ Included in Visual Studio.NET ➤ What the.NET Framework is and what it contains ➤ How.NET.
Languages and IDE (Integrated Development Environment)
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
1 C# A brief overview by Jack Senechal and Bryan Powell.
A First Simple Program /* This is a simple Java program. Call this file "Example.java".*/ class Example { // Your program begins with a call to main().
ISYS 350 Business Application Development David Chao.
The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction.
1 12/4/1435 h Lecture 2 Programs and Programming Languages.
Introduction to C++.  Computers: CPU, Memory & Input / Output (IO)  Program: Sequence of instructions for the computer.  Operating system: Program.
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.
MAHENDRAN. Session Objectives Session Objectives  Discuss the Origin of C  Features of C  Characteristics of C  Current Uses of C  “C” Programming.
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
Chapter 1: Introduction to Computers and Programming.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 1 An Introduction to Visual Basic.NET and Program Design.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
IS 350 Course Introduction. Slide 2 Objectives Identify the steps performed in the software development life cycle Describe selected tools used to design.
Lecture 1b- Introduction
Introduction to .NET Framework
Foundations of .Net Programming with C#
Introduction to Visual Basic 2008 Programming
Introduction to .NET Framework Ch2 – Deitel’s Book
Java programming lecture one
An Introduction to Visual Basic .NET and Program Design
Module 1: Getting Started
Introduction to C# AKEEL AHMED.
Tutorial C#.
Assembler, Compiler, Interpreter
C# Programming: From Problem Analysis to Program Design
Mobile Development Workshop
Advanced Programming: C# Lecture 01: Introduction
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
Chapter 3 – Introduction to C# Programming
Assembler, Compiler, Interpreter
Visual Programming Lecture 1.
IS 135 Business Programming
CS313T Advanced Programming language
Presentation transcript:

C# and the .NET Framework An Introduction to C#

Introduction to Computing Processors have different instruction sets with low-level simple instructions High-level languages – more expressive, closer to software design Compilers translate from one language to another Interpreters execute code

Translating a high-level program Processor ABC program (executable) Compiler Translating a high-level program

The .NET Framework Two main parts Common Language Runtime (CLR) manages execution of code and provides services .NET Framework Class Library provides a large and very useful set of types

The Common Language Runtime Common Type System defines the types of data that manages code can use. Common Language Specification (CLS) defines features that every language for developing managed code must provide Each language code compiles to MSIL, Microsoft Intermediate Language. Compiles to native code at runtime.

The .NET Framework Class Library Groups types into namespaces. Contains about 100 namespaces. For example, System -- Contains fundamental types. System.Drawing -- Provides graphics. System.Windows.Forms -- For user interfaces in Windows-based applications

C# Features Object-oriented – used for business objects or system applications – internet applications Goals include productivity and safety power, expressiveness, and flexibility Combines rapid application development of Visual Basic with power of C++

How C# works Compiler translates C# source to MSIL code for a virtual machine, similar to a hardware processor During runtime the CLR use a Just-In-Time (JIT) compiler to translate the MSIL code to the instruction set of the processor

Compiling and executing a Java program JIT1 C#Source Code MSIL code Processor 1 code Compiler JIT2 Processor 2 code Compiling and executing a Java program

public class Square { static void Main() { int number = 345; // '=' denotes assignment int squared = number * number; // '*' denotes multiplication System.Console.WriteLine ("The square of {0} is {1}", number, squared); }

The output of Example 1 The square of 345 is 119025 System namespace, Console class, WriteLine method "The square of {0} is {1}" is a pattern The value of number substitutes for {0} The value of squared substitutes for {1}

Lexical Structure Rules for dividing program text into a sequence of elements Whitespace -- spaces, tabs, carriage returns Comment – for human readers only Punctuators ( ) { } [ ] ; , . : Operators + - * / and so on Literals – specific values such as 345 Identifiers – the names used for program entities Keywords – reserved names for special uses

C# compiler lexical analyzer int number = 345; C# compiler lexical analyzer keyword identifier operator literal punctuator (int) (number) (=) (345) (;) (whitespace and comment discarded) Lexical analysis of a single line of Example 1

Syntax Grammatical rules for combining lexical elements into programs Declaration – defines a part of a program Statements – controls execution sequence Expressions – compute values

The overall syntactic structure of Example 1.1 class declaration method declaration statement statement statement The overall syntactic structure of Example 1.1

The Steps of Software Development Identifying the requirements of the system. Designing a system that meets the requirements. Implementing the system. Testing that the system operates correctly and meets the requirements. Making improvements as needed.