Sams Teach Yourself C# in 24 Hours
- Table of Contents
- Copyright
- About the Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- Audience and Organization
- Conventions Used in This Book
- Onward and Upward!
- Part I. The Visual Studio Environment
- Hour 1. A C# Programming Tour
- Hour 2. Navigating C#
- Hour 3. Understanding Objects and Collections
- Hour 4. Understanding Events
- Part II. Building a User Interface
- Hour 5. Building FormsPart I
- Hour 6. Building FormsPart II
- Hour 7. Working with the Traditional Controls
- Hour 8. Advanced Controls
- Hour 9. Adding Menus and Toolbars to Forms
- Hour 10. Drawing and Printing
- Part III. Making Things HappenProgramming!
- Hour 11. Creating and Calling Methods
- Hour 12. Using Constants, Data Types, Variables, and Arrays
- Hour 13. Performing Arithmetic, String Manipulation, and Date/Time Adjustments
- Hour 14. Making Decisions in C# Code
- Hour 15. Looping for Efficiency
- Hour 16. Debugging Your Code
- Hour 17. Designing Objects Using Classes
- Hour 18. Interacting with Users
- Part IV. Working with Data
- Hour 19. Performing File Operations
- Hour 20. Controlling Other Applications Using Automation
- Hour 21. Working with a Database
- Part V. Deploying Solutions and Beyond
- Hour 22. Deploying a Solution
- Hour 23. Introduction to Web Development
- Hour 24. The 10,000-Foot View
- The .NET Framework
- Common Language Runtime ( CLR )
- Microsoft Intermediate Language
- Namespaces
- Common Type System
- Garbage Collection
- Summary
- Q&A
- Workshop
- Appendix A. Answers to Quizzes/Exercises
Common Language Runtime (CLR)
A language runtime is what allows an application to run on a target computer; it consists of code that is shared among all applications developed using a supported language. A runtime contains the "guts" of language code, such as code that draws forms to the screen, handles user input, and manages data. The runtime of .NET is called the Common Language Runtime (CLR).
Unlike runtimes for other languages, the CLR is designed as a multilanguage runtime. For example, C# and Visual Basic both use the CLR. In fact, currently more than 15 language compilers are being developed to use the CLR.
Because all .NET languages share the CLR, they share the same IDE, the same forms engine, the same exception-handling mechanism, the same garbage collector (discussed shortly), and much more. One benefit of the multilanguage capability of the CLR is that programmers can leverage their knowledge of a given .NET language. For example, some developers on a team may be comfortable with C#, whereas others are more comfortable with Visual Basic. Because both languages share the same runtime, both can be integrated to deliver a solution. In addition, a common exception-handling mechanism is built into the CLR so that exceptions can be thrown from code written in one language and caught in code written in another .NET language.
Another advantage of the CLR is that all .NET tools share the same debugging and code-profiling tools. In the past, languages such as Visual Basic were limited to their own debugging tools, whereas languages such as C++ had many third-party debugging tools available. Now, all languages share the same tools. This means that as advancements are made to the debugging tools of one product, they're made to tools of all products because the tools are shared. This aspect goes beyond debugging tools. For example, add-ins to the IDE (such as code managers) are just as readily available to C# as they are to Visual Basic—or any other .NET language, for that matter.
Microsoft Intermediate Language | Next Section

Account Sign In
View your cart