News:

Choose a design and let our professionals help you build a successful website   - ITAcumens

Main Menu

Introduction to C#

Started by OmMuruga, Jan 25, 2009, 08:52 AM

Previous topic - Next topic

OmMuruga

Introduction
Why Another Language?

AT THIS POINT, you're probably asking yourself, "Why should I learn another language? Why not use C++?" (or VB or Java or whatever your preferred language is). At least, you were probably asking yourself .Languages are a little bit like power tools. Each tool has it's own strengths and weaknesses. Though I could use my router to trim a board to length, it would be much easier if I used a miter saw. Similarly, I could use a language like LISP to write a graphics-intensive game, but it would probably be easier to use C++.
                      C# (pronounced "C sharp") is the native language for the .NET Common Language Runtime. It has been designed to fit seamlessly into the .NET Common Language Runtime. You can (and, at times, you should) write code in either Visual C++ or Visual Basic, but in most cases, C# will likely fit your needs better. Because the Common Language Runtime is central to many things in C#,Runtime Environment," will introduce the important parts of it—at least, those that are important to the C# language.

C# Design Goals
                         When the C++ language first came out, it caused quite a stir. Here was a language for creating objectoriented software that didn't require C programmers to abandon their skills or their investment in software. It wasn't fully object-oriented in the way a language like Eiffel is, but it had enough object oriented features to offer great benefits. C# provides a similar opportunity. In cooperation with the .NET Common Language Runtime, it provides a language to use for component-oriented soft- ware, without forcing programmers to abandon their investment in C, C++, or COM code.
C# is designed for building robust and durable components to handle real -world situations.Component Software The .NET Common Language Runtime is a component-based environment, and it should come as no surprise that C# is designed to make component creation easier. It's a "component-centric" language, in that all objects are written as components, and the component is the center of the action. Component concepts, such as properties, methods, and events, are first-class citizens of the language and of the underlying runtime environment. Declarative information (known as attributes) can be applied to components to convey design- time and runtime information about the component to other parts of the system. Documentation can be written inside the component and exported to XML.
C# objects don't require header files, IDL files, or type libraries to be created or used. Components created by C# are fully self-describing and can be used without a registration process.C# is aided in the creation of components by the .NET Runtime and Frameworks, which provide a unified type system in which everything can be treated as an object, but without the performance penalty associated with pure object systems, such as Smalltalk.

Robust and Durable Software
In the component-based world, being able to create software that is robust and durable is very
important. Web servers may run for months without a scheduled reboot, and an unscheduled reboot is undesirable
.                 Garbage collection takes the burden of memory management away from the programmer,[1] and the problems of writing versionable components are eased by definable versioning semantics and the ability to separate the interface from the implementation. Numerical operations can be checked to ensure that they don't overflow, and arrays support bounds checking.
C# also provides an environment that is simple, safe, and straightforward. Error handling is not an
afterthought, with exception handling being present throughout the environment. The language is type safe, and it protects against the use of variables that have not been initialized, unsafe casts, and other common programming errors.

Real-World Software

              Software development isn't pretty. Software is rarely designed on a clean slate; it must have decent
performance, leverage existing code, and be practical to write in terms of time and budget. A welldesigned
environment is of little use if it doesn't provide enough power for real-world use.
C# provides the benefits of an elegant and unified environment, while still providing access to "less
reputable" features—such as pointers—when those features are needed to get the job done.
C# protects the investment in existing code. Existing COM objects can be used as if they were .NET
objects.[2] The .NET Common Language Runtime will make objects in the runtime appear to be COM
objects to existing COM-based code. Native C code in DLL files can be called from C# code. [3]
C# provides low-level access when appropriate. Lightweight objects can be written to be stack allocated
and still participate in the unified environment. Low- level access is provided via the unsafe mode,
which allows pointers to be used in cases where performance is very important or when pointers are
required to use existing DLLs.
C# is built on a C++ heritage and should be immediately comfortable for C++ programmers. The
language provides a short learning curve, increased productivity, and no unnecessary sacrifices.
Finally, C# capitalizes on the power of the .NET Common Language Runtime, which provides extensive
library support for general programming tasks and application-specific tasks. The .NET Runtime,
Frameworks, and languages are all tied together by the Visual Studio environment, providing one-stopshopping
for the .NET programmer.
[1] It's not that C++ memory management is conceptually hard; it isn't in most cases, though there are some difficult situations when dealing with components. The burden comes from having to devote time and effort to getting it right. With garbage collection, it isn't necessary to spend the coding and testing time to make sure there aren't any memory leaks, which frees the programmer to focus on the program logic.

[2] Usually. There are details that sometimes make this a bit tougher in practice.

[3] For C++ code, Visual C++ has been extended with "Managed Extensions" that make it possible to create .NET components. More information on these extensions can be found on the Microsoft web site.
:acumen :acumen


sajiv

hi kalyan for ur request

This article points to the "Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET" white paper."

Differences between Visual Basic and C/C++, many developers assume incorrectly about the capabilities of Visual Basic .NET. Many Visual Basic developers think that Visual C# is a more powerful language than Visual Basic. In other words, Visual Basic developers assume that you can do many things in Visual C# that you cannot do in Visual Basic .NET, just as there are many things that you can do in C/C++ but cannot do in Microsoft Visual Basic 6.0 or earlier. This assumption is incorrect.

Although there are differences between Visual Basic .NET and Visual C# .NET, both are first-class programming languages that are based on the Microsoft .NET Framework, and they are equally powerful. Visual Basic .NET is a true object-oriented programming language that includes new and improved features such as inheritance, polymorphism, interfaces, and overloading. Both Visual Basic .NET and Visual C# .NET use the common language runtime. There are almost no performance issues between Visual Basic .NET and Visual C# .NET. Visual C# .NET may have a few more "power" features such as handling unmanaged code, and Visual Basic .NET may be skewed a little toward ease of use by providing features such as late binding. However, the differences between Visual Basic .NET and Visual C# .NET are very small compared to what they were in earlier versions.

The "Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET" white paper describes some of the differences between Visual Basic .NET and Visual C# .NET. However, remember that the .NET Framework is intended to be language independent. When you must select between Visual Basic .NET and Visual C# .NET, decide primarily based on what you already know and what you are comfortable with. It is easier for Visual Basic 6.0 developers to use Visual Basic .NET and for C++/Java programmers to use Visual C# .NET. The existing experience of a programmer far outweighs the small differences between the two languages.

No matter which language you select based on your personal preference and past experience, both languages are powerful developer tools and first-class programming languages that share the common language runtime in the .NET Framework.


OmMuruga

.NET 2008 will  be more User Interactive.And they will feel more easy to work with ,than .NET 2005 Envirorement.. :agree

Kalyan

I dont think so..what kind of interaction you faced in 2008 environment..

bcz, am unable to open more than 2 solutions in 2008...but i have 2gb of RAM with latest configuration..

Is there any problem in my pc or in version changes..

Could you tell ?????

dhoni

with this iformation they have given more details about introduction in c
this should be able in the best information