Download lecture 1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

BASIC wikipedia , lookup

Functional programming wikipedia , lookup

Go (programming language) wikipedia , lookup

Reactive programming wikipedia , lookup

Abstraction (computer science) wikipedia , lookup

Assembly language wikipedia , lookup

Object-relational impedance mismatch wikipedia , lookup

Reserved word wikipedia , lookup

Structured programming wikipedia , lookup

Programming language wikipedia , lookup

Domain-specific language wikipedia , lookup

Object-oriented programming wikipedia , lookup

C Sharp (programming language) wikipedia , lookup

Transcript
1
1
Introduction to
Computers, the
Internet and
Visual C#
 2009 Pearson Education, Inc. All rights reserved.
2
The chief merit of language is clearness.
– Galen
High thoughts must have high language.
– Aristophanes
Our life is frittered away with detail. . . . Simplify,
simplify.
– Henry David Thoreau
 2009 Pearson Education, Inc. All rights reserved.
3
My object all sublime I shall achieve in time.
– W. S. Gilbert
Man is still the most extraordinary
computer of all.
– John F. Kennedy
 2009 Pearson Education, Inc. All rights reserved.
4
OBJECTIVES
In this chapter you will learn:
• Basic hardware and software concepts.
• The different types of programming languages.
• Which programming languages are most widely used.
• The history of the Visual C# programming language.
• Some basics of object technology.
 2009 Pearson Education, Inc. All rights reserved.
5
Chapter 1 – Introduction to C#
Machine Languages, Assembly Languages and High-Level Languages
Programmers write instructions in various
programming languages.
Computer languages can be divided into three
general types:
Machine languages
Assembly languages
High-level languages
 2009 Pearson Education, Inc. All rights reserved.
Machine Languages, Assembly
Languages and High-Level Languages
(Cont.)
6
A computer can directly understand only its own
machine language.
Machine languages generally consist of streams of
numbers (ultimately reduced to binary 1s and 0s).
Machine-language programs are nearly
incomprehensible to humans:
+1300042774
+1400593419
+1200274027
 2009 Pearson Education, Inc. All rights reserved.
7
Machine Languages, Assembly
Languages and High-Level Languages
(Cont.)
• Machine-language programming proved to be slow and error
prone.
• English-like abbreviations form the basis of assembly
languages.
• Assemblers convert assembly-language programs to machine
language.
LOAD
ADD
STORE
BASEPAY
OVERPAY
GROSSPAY
• Computers cannot understand assembly-language code
until it is translated into machine language.
 2009 Pearson Education, Inc. All rights reserved.
8
1.7 Machine Languages, Assembly
Languages and High-Level Languages
(Cont.)
• To speed up the programming process, high-level
languages were developed.
• Compilers convert high-level-language programs
into machine language.
• High-level languages look almost like everyday
English:
X= Y+ Z
 2009 Pearson Education, Inc. All rights reserved.
9
1.7 Machine Languages, Assembly
Languages and High-Level Languages
(Cont.)
Fig. 1.1 | Comparing machine, assembly and high-level languages.
 2009 Pearson Education, Inc. All rights reserved.
10
C, C++, Visual Basic .NET and Java
•C
– Developed by Dennis Ritchie
- Evolved from the B language at Bell Labs
- Added data type features
– Gained recognition as language of UNIX
– Now a widely used language
- Available on most computers
- Language of most major operating systems
- Led to development of C++
 2009 Pearson Education, Inc. All rights reserved.
11
C, C++, Visual Basic .NET and Java (II)
• C++
– Developed by Bjarne Stroustrup at Bell Labs (1980s)
– Extension of C
- Uses elements from Simula 67
Simulation programming language
- Provides features to “spruce up” C
- Provides Object-oriented technology
Hybrid language
 Possible to program structurally
 Possible to program with object-oriented
technology
 Possible to use both
 2009 Pearson Education, Inc. All rights reserved.
12
C, C++, Visual Basic .NET and Java (III)
• Object-Oriented Programming
– Uses objects
- Reusable software components
- Modeled after items in the real world
– More productive than structured programming
– Easier to understand, correct and modify
 2009 Pearson Education, Inc. All rights reserved.
13
C, C++, Visual Basic .NET and Java (IV)
• Visual Basic . NET
– Based from BASIC (mid 1960s)
- Beginners All-Purpose Symbolic Instruction Code
- Implemented by Bill Gates at Microsoft
– Evolved to Visual Basic
- Resulting from Windows GUI (late 1980s early 1990s)
Graphical User Interface
- Included capabilities such as object oriented
programming, error handling and GUI creation
– Evolved to .NET
- Allows access to .NET libraries
- Improved object oriented programming
 2009 Pearson Education, Inc. All rights reserved.
14
C, C++, Visual Basic .NET and Java (V)
• Java
– Sun Microsystems corporate research project (1991)
- Code-named Green
– Based on C and C++
– Intended for intelligent consumer-electronic devices
- Lack of popularity almost causes cancellation
– Sudden popularity of WWW provides new potential
- Java capable of dynamic content
Animated and interactive content
- Grabbed attention of business community
– Now very widely used
- Enhance functionality of WWW servers
- Provide applications for consumer devices
 2009 Pearson Education, Inc. All rights reserved.
15
C#
• C#
– Developed at Microsoft by a team led by Anders Hejlsberg
and Scott Wiltamuth
– Event driven, object oriented, visual programming language
– Based from C, C++ and Java
– Incorporated into .NET platform
- Web based applications can be distributed
Devices and desktop computers
- Programs that can be accessed by anyone through any device
- Allows communicating with different computer languages
– Integrated Design Environment (IDE)
- Makes programming and debugging fast and easy
- Rapid Application Development (RAD)
 2009 Pearson Education, Inc. All rights reserved.
16
C# (II)
• SOAP
– Simple Object Access Protocol
– Allows the communicating of languages
- Any .NET language
– Helps to share program “chunks” over the internet
 2009 Pearson Education, Inc. All rights reserved.
17
Key Software Trend: Object Technology
• What is Object Technology?
– Packaging scheme for creating software units
- Units are objects
Any noun can be represented as an object
 Date object, time object, car object
Have properties
 Size, color, weight
Perform actions
 Moving, sleeping, drawing
Defined in classes
 Specify general format
 Provide specific attributes and behaviors
 2009 Pearson Education, Inc. All rights reserved.
18
Key Software Trend: Object Technology
(II)
• Object-Oriented programming
– Based on nouns
- Reflects way world is perceived
– Advantages over structured programming
- More natural process
Results in better productivity
- Classes provide reusability
Microsoft Foundation Classes (MFC)
- Easier to maintain
Programs more understandable
Focus on behaviors and interactions
Less attention to details
 2009 Pearson Education, Inc. All rights reserved.
19
Introduction to Microsoft .NET
• .NET initiative
– Introduced by Microsoft (June 2000)
- Vision for embracing the Internet in software
development
– Independence from specific language or platform
- Applications developed in any .NET compatible language
Visual Basic .NET, Visual C++ .NET, C# and more
- Programmers can contribute to applications using the
language in which they are most competent
– Architecture capable of existing on multiple platforms
– New program development process
- Provides increased productivity
 2009 Pearson Education, Inc. All rights reserved.
20
Introduction to Microsoft .NET (II)
• Key components of .NET
– Web services
- Applications used over the Internet
– Software reusability
- Web services provide solutions for wide variety of
companies
Cheaper than developing one-time solutions that can’t
be reused
Single applications perform all operations for a
company via various Web services
 Manage taxes, bills, investments and more
- Pre-packaged components
Make application development quicker and easier
Developers no longer need to be concerned with details
of components
 2009 Pearson Education, Inc. All rights reserved.
21
Introduction to Microsoft .NET (III)
• Keys to interaction
– XML and SOAP
- “Glue” that combines various Web services to form
applications
XML gives meaning to data
SOAP allows communication to occur easily
 2009 Pearson Education, Inc. All rights reserved.
22
Introduction to Microsoft .NET (IV)
• Other concepts
– Universal data access
- Eliminates need to synchronize files
Updating multiple copies of same file to the most
recent
- Data resides at one central location
Accessible by anyone with connection and proper
authorization
- Data formatted appropriately for display on various
devices
Same document seen on PC, PDA, cell phone and other
devices
– Additional information available at Microsoft Web site
www.microsoft.com/net
 2009 Pearson Education, Inc. All rights reserved.