Associate
- Joined
- 13 May 2004
- Posts
- 1,491
- Location
- Wales, Wrexham
Okay, i havea copy of SAMS Teach Yourself C# in 21 Days in front of me, and i have just finished reading Day 1, and even though the theory behind the code was quite tough, i think i sort of understand it.
So i'm going to post in here my progress, okay it may take me longer than 21 days, but 21 days is my initial target.
Okay, so in Day one i've learned the basics of what programming entails, the idea behind C#'s introduction to the world and so on, reasons why it is a good programming language to learn and basic principles behind all programming languages.
There was a part on Encapsulation, Polymorphism and Inheritance, and i want to write out what i take them as, and wouldn't mind knowing whether i am along the right lines or whether i have grasped the wrong end of the stick.
Encapsulation refers to Objects effectively, an object that defines a circle outputs a circle, though the way the circle is worked out is 'encapsulated' in such a way that it keeps the user oblivious. If the object outputs a circle, all the inner workings out are irrelevant
Polymorphism covers quite a few things, if you were to feed an object certain arguments and depending on what arguments are fed into the object, different outputs are created - based on the information fed in, the output could be a square, circle, triangle.
Inheritance i find quite hard to explain, and i know the above two are rather hazy, so if anyone can summarize them in a way that makes more sense, i would be grateful!
As for the actual code itself, you are asked to copy the code that is in the book without any explanation as to what the code does, or why it is there.
Hello World was easy enough, the first WinForm application was a bit different however, for example
private TextBox txtBox1;
I assume this is defining a textbox with the name txtBox1?
Then further along
this.txtBox1.Location = new System.Drawing.Point(16, 32);
The (16, 32) appear to be co-ordinates, it is defining txtBox1's location however what does the whole 'this' thing actually mean, is there a way you can explain it? Obviously it has to be there to work, but what exactly does it do?
Sorry if i sound like a complete newbie, but well.. i am. (to C# at least!)
So i'm going to post in here my progress, okay it may take me longer than 21 days, but 21 days is my initial target.
Okay, so in Day one i've learned the basics of what programming entails, the idea behind C#'s introduction to the world and so on, reasons why it is a good programming language to learn and basic principles behind all programming languages.
There was a part on Encapsulation, Polymorphism and Inheritance, and i want to write out what i take them as, and wouldn't mind knowing whether i am along the right lines or whether i have grasped the wrong end of the stick.
Encapsulation refers to Objects effectively, an object that defines a circle outputs a circle, though the way the circle is worked out is 'encapsulated' in such a way that it keeps the user oblivious. If the object outputs a circle, all the inner workings out are irrelevant
Polymorphism covers quite a few things, if you were to feed an object certain arguments and depending on what arguments are fed into the object, different outputs are created - based on the information fed in, the output could be a square, circle, triangle.
Inheritance i find quite hard to explain, and i know the above two are rather hazy, so if anyone can summarize them in a way that makes more sense, i would be grateful!
As for the actual code itself, you are asked to copy the code that is in the book without any explanation as to what the code does, or why it is there.
Hello World was easy enough, the first WinForm application was a bit different however, for example
private TextBox txtBox1;
I assume this is defining a textbox with the name txtBox1?
Then further along
this.txtBox1.Location = new System.Drawing.Point(16, 32);
The (16, 32) appear to be co-ordinates, it is defining txtBox1's location however what does the whole 'this' thing actually mean, is there a way you can explain it? Obviously it has to be there to work, but what exactly does it do?
Sorry if i sound like a complete newbie, but well.. i am. (to C# at least!)