Join Anton Delsink for an in-depth discussion in this video When a square is not a rectangle, part of Object Oriented Programming with C#.
- [Instructor] So here is a fun idea.…When is a square not a rectangle?…Well in geometry, when you look at the mathematics…and the definitions of things,…then it would be a common statement…that a square is a rectangle.…And it feels like that's also…the way we would express things in object orientation,…when you think of inheritance and how things would relate.…A rectangle could perhaps be…a more general case of a square.…You may be surprised to find out that taking this approach…would actually cause you some trouble…when it comes to writing code.…
In your exercise files, go to the Begin folder…for Theory versus Practice,…and open the solution named Theory versus Practice…in Visual Studio.…In your Solution Explorer,…you will see a project called Tests,…and within that project, select Tests_Geometry.…Open the file, and you'll find a fairly simple unit test.…It instantiates a square, and it instantiates a rectangle,…and in the case of a square, it defines a width,…and a square has four edges, all of the same length.…
- Abstract classes
- Processing text with StreamReader
- IEnumerable and yield return
- Windows Forms controls
- Windows Forms with and without the designer
- Adding, organizing, and testing forms
- Creating classes
Skill Level Intermediate
What you should know1m 10s
1. Theory vs. Practice
2. Examples from .NET
3. Examples from Windows UI
4. Examples from Board Games
5. Examples from the Web
Next steps1m 13s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.