1 get started with c#
TRANSCRIPT
Introduction C#
Pitfalls of C/C++
Difficult for beginners to learn
Cannot test code until it is compiled
Difficult to debug without expensive debugging tools
Takes longer time to develop
Database connectivity is complicated
Problems in modification of data
Difficulty in implementation
Do not contain any framework
Need for a New Language
Simple, powerful tool for building interoperable, scalable, robust applications. Complete object-oriented architecture powerful component-oriented development Allow access to many features previously available only in C++ Familiarity to programmers coming from C or C++ Write application target both desktop and mobile.
Purpose of C#
.NET Framework is a massive expandable library.
C# is a high level language which let programmers focus on the main problem rather than dealing with things like portability, serialization …
C# provides a simple, efficient, productive, object-oriented language.
Why .NET?
Application architecture has changed.
INTERNET world Compete JAVA
Why .NET?
Bill toilet
.Net Framework
Language-neutral component library Code Modules Organized Specialized Execution environment CTS CLR Provide consistent object-oriented programming environment Minimize software deployment and versioning conflicts by providing a code-execution environment Promote safe execution of code by providing a code-execution environment Provides a consistent developer experience across varying types of application such as Window-based app and Web-based app.
.Net Framework Components
Common Language Runtime (CLR) Memory management Code execution Error handling Code safety verification Garbage collection .NET Framework Class Library (FCL) comprehensive object-oriented collection of reusable type.
Architecture of .NET Framework
Other components of .NET Framework
Other components of .NET Framework
Common Language Specification (CLS) set of rules that any .NET language should follow to create application that are interoperable with other languages Common Type System (CTS) describes how data types are declared
Microsoft Intermediate Language (MSIL)
The code written in a .NET compatible language is compiled, the output code is in the form of MSIL.
MSIL is composed of a specific set of instructions that indicate how the code should be executed
Common Language Runtime (CLR)
When a code is executed for the first time, the MSIL code is converted to a code native to the operating system. This is done at runtime by the Just-In-Time (JIT) compiler in CLR.
CLR is virtual machine component that is used to convert the MSIL code to the machine language code.
Basic features of C#
Object-oriented
Type-safety Checking
| Uninitialized variables cannot be used.
Garbage Collection
Standardization by ECMA (European Computer Manufacturers)
Generic Types and Methods
Applications of C#
Gaming applications
Large-scale enterprise applications
Mobile applications for pocket PCs, PDAs and cell phones
Simple standalone desktop applications such as Library Management
Complex distributed applications
Advantages of C#
Cross Language Support
Common Internet Protocols
XML, SOAP
Simple Deployment
A assembly is self-describing collection of code and resource
XML Documentation
Comments can be place in XML format and then used to document the code.
Memory Management
In C, C++, the allocation and de-allocation of memory is done manually. It is time-consuming and difficult.
The C# language provides the feature of allocating and releasing memory using automatic memory management.
No need to write code to allocate or to release memory.
Increase the code quality and enhances the performance and the productivity.
Garbage Collection
Automatic memory management is done with the help of a garbage collector
Garbage collection is the automatic reclaiming of memory from objects that are no longer in scope.
Two steps:
- Determine which obj
will not be access in the future.
- Reclaim the storage used by those.
Visual Studio 2010
Visual Studio 2010 Ultimate
Visual Studio 2010 Premium
Visual Studio 2010 Professional
Visual Studio 2010 Express Products
Visual Studio Team Foundation Server 2010
Visual Studio 2010 Comparison