Unlocking Microsoft C# v2.0 Programming Secrets
Microsoft Corporation’s newest compiler, C# (pronounced “C sharp”), is now with us, and may become one of the most celebrated compilers of the 21st century — if we can learn how to use its immense capabilities. Some have questioned the immediate value of this new compiler, since it was only a decade ago that C++ emerged from the computational think tanks of the world. “What’s wrong with continuing to use C++ ?” they ask.
The answer is this: C++ will continue to serve some of us comfortably in the near term, but there are features built into C# that make life easier when we program for the Internet and other remote processes. We must become more attuned to the needs of the Internet.
In some cases, however, C# adds a degree of complexity to the compiler that was not there before. For example, Charles Petzold mentions in his book Programming Microsoft Windows with C# that there are half a dozen forms of the StreamWriter constructor that use file names, three forms that use a Stream object, and several other forms for special uses. Some of the common C# commands have as many as 16 variations. Petzold also discusses encoding schemes like Unicode, UTF7, UTF8, and finally, ASCII (thank goodness). A bead of perspiration broke out on my forehead when I read that. How could I possibly remember all the variations of the “simple” C commands that I have learned to love over the years?
Then I remembered how it was 15 years ago when the C language first evolved into the C++ language and program architecture became object-oriented. C++ was not a superfluous change to a basic C script — the change forced us to become more focused programmers since all the C++ procedures were narrowly defined and all the variables were hard-typed so we could not misuse them like we did in the old C days. The new methods of creating source code were quite a change for the, shall we say, “experienced programmer.” There were so many new ways to make mistakes in the code we were attempting to write. In retrospect, however, object-oriented programming was a godsend.
Along with the increased complexity of the compilers, more attention was given by the compiler manufacturers to helps that could lead the average programmer out of the quandary of overspecific compiler statements. You will be pleased to find that the new generation of helps in the Microsoft C# language outstrips any automated technical support you have encountered so far.
These helps are not just laying dormant in a multi-meg text document that accompanies the new C# compiler — they are active bells, whistles, and gongs that warn the programmer when he has done something wrong in preparing source code or while combining multiple groups of source code into one integrated executable (an msi). It’s like having your favorite computer science professor looking over your shoulder every time you write source code — in real time no less! The new compilers have protected themselves from an onslaught of poor overall planning on the part of the programmer, poor sequencing of computer tasks, and poor statement choices (like the dredging up of old statements learned 20 years ago that are no longer in the repertoire). If a person wants to learn to program in C#, then she had better learn the nuances of the C# language!
This is not to say that the nuances are that great. If you have the mindset of a computer programmer, then the C# nuances will be embedded in your brain in a few weeks, and the lingering memories of the old ways of creating computer task sequences with C or C++ will fade into the sunset.
Like every new language, however, the C# architects included multiple ways of accomplishing the same task within the C# language. This leads to confusion among the newly washed members of the programming community. For example, why is there more than one way in C# to open a file and read it? And the answer is: Because the old methods that have appeared in FORTRAN, COBOL, Pascal, ADA, Smalltalk, Java, and so forth since the 1960s all have their devotees in the programming community, and no compiler manufacturer wants to alienate them. Also, within a given compiler-creating architectural group there are wide differences of opinion on how basic computing tasks should be bundled and provided to the programmer — hence, the redundancy continues.
Download Link
All rights reserved. All other trademarks appearing on on this site are the property of their respective owners. We don't store any files on this server, we just index the link from the other website.