Well this is it. The start of my journey to teach myself C#. All my notes and research has been done through:
Sams Teach Yourself C# in 21 Days
2002 by Bradley L. Jones
Now my plan is to go through each chapter taking notes on points and info I find interesting and relevant for me. I also will go through the exercises and God willing the information sticks.
Learning C# is probably one of my greatest challenges I have had to face in a long time, and as it’s something to do with learning, one can almost guarantee its going to take a wee bit longer than usual. Cos that’s what I do!!
Lets make a start shall we?
Chapter One – Getting Started with C#
C# is a new language created by Microsoft in 2000 by some very smart and clever people. (Not sure if I am angry at them for creating it or grateful – time shall hopefully tell that I am soooooooooooooo grateful.)
C# is a modern language with features such as exception handling, garbage collection, extensible data types and code security features. (I have no clue what these are but I am sure as the book progresses, I shall find out.)
C# is object-orientated which means that the language supports encapsulation, inheritance and polymorphism. (Sounds like some Mighty Morphin Power Ranger stuff right here.)
Encapsulation is the placing of functionality into a single package.
Inheritance is a structured way of extending existing code into new programs.
Polymorphism is the capability of adapting to what needs to be done. (Ahhh! Now I understand – sort off)
C# is a language of few words. C# contains only a handful of keywords which serve as a base to build the functionality on. There are about 75 keywords that are used as well as a number of other words, which whilst are not keywords, should be treated as such. (What the!??)
C# is modular and can be written in sections called classes, which contain routines called member methods. The classes and methods can be used and reused in other applications and programs.
Preparing to Program
When deciding to write a program there has to first be an objective, issue, or problem that may need to be overcome, solved or addressed. The following set of steps should be followed when creating a program:
1. Determine the objective/s of the program.
2. Determine the methods you want to use writing the program.
3. Create/write the program to solve the problem.
4. Run/Test the program.
Program Development Cycles
Understanding Compilation Errors
Compilation errors happen when the computer finds an error in the source code which it cannot compile. Fortunately Visual Studio and Mono Develop inform you where the error occurred and what type it is.
Understanding Logic Errors
Logic errors are errors that you as the programmer have made and are not compilation errors. If the programmers logic is wrong then the code will not work in the way it is supposed to. You can only find these errors by compiling and running the code and seeing if the desired outcome/answer/result is achieved.
Types of C# Programs
Console applications: Console applications run from the command line.
Windows Applications: Window applications that can utilize the graphical user interface (GUI) provided by Microsoft Windows.
Web Services: Web services are routines that can be called across the Web.
Web Form/ASP.NET Applications: ASP.Net applications are executed on a Web server and generate dynamic Web pages.
Conclusion Lesson 1
In my first chapter I am beginning to understand the different commands and how they work. The importance of spelling, layout, and punctuation is important.I understand the steps of creating a program through the editor, how to enter, how to compile and how to execute. I learnt and understand the difference between error messages and how to find the problem in what line and column.
I tried all the exercises at the end of the chapter and except for a few terminology errors, I was able to enter code, find and correct any errors, compiled and ran the programs and achieved the desired outcome/output.
Till next time.
Peace and Blessings