Scott Hanselman

The Syllabus for CST407 - Learning C# with .NET

August 13, '03 Comments [0] Posted in Learning .NET | ASP.NET | NUnit | XML | Bugs | Tools
Sponsored By

OREGON INSTITUTE OF TECHNOLOGY

Software Engineering Technology

CST 407 Seminar - C# and the .NET Framework

Course Syllabus - Fall 2003

Instructor Information:       

Name:  Scott Hanselman        Email:  scott -a-t- hanselman.com

Phone:  880-2486       Office Location:  The Ether

 

Class Schedule:          

Lecture/Lab:   14053             Friday  6:00p-8:50p                Portland - CC1045     

Class Web Site:  http://www.computerzen.com/cst407

Textbook:

Required Text:            C# Primer, Stanley Lippman

Optional References:         Essential .NET, Don Box and Chris Sells

                                    Programming Pearls, Second Edition, Jon Bentley

                                    The Pragmatic Programmer, Andrew Hunt and David Thomas


Software Tools:

 

Minimal development:

·         The Windows .NET Framework SDK - Most work will happen at the command-line

·         SharpDevelop - Open Source IDE written in C# w/source

 

Minimal web development (there may be small web projects, nothing major)

·         Cassini - Simple ASP.NET Web Server (IIS not needed) w/source

·         The ASP.NET Web Matrix

 

Preferred development

·         Visual Studio.NET Academic Edition – Great to have, but we won’t lean on it

 

For homework

·         Lutz Roeder's Reflector - Decompiler

·         NUnit - Testing framework

 

Philosophy and Prerequisites

This class is a 400 level class and while it may look easy (most syllabi do) I will have high expectations.  C# is a 3rd generation 'C' family language.   This class assumes you've programmed in some language that includes a if-then construct of some kind.  An understanding of Object Oriented design will be important.

For those of you who feel advanced now and think this class may be too easy, I will ratchet up the difficulty after class as far as you'd like.  I will stay as long after class talking tech as you like. 

Coding is an art and all art has its associated literature.   I expect you to read as much code as you write.  Every week, bring in a snippet (10-20 lines) of someone else's code that you've found on the web.  Two places to start are www.gotdotnet.com and www.codeproject.com.  Email the cool snippets to me and we'll discuss some of them in the last 30-45 minutes of class. 

.NET is very powerful, but it can turn bad programmers into very bad programmers very quickly.

 

Library Services:

OIT Library:  OIT library web site

 

Homework:

Homework should be zipped (just code, no bin or obj folders) and sent to my email address before 9AM each Friday.  The subject must contain [CST407] including the brackets.  I'm not kidding here, and this is not a suggestion.  Include '[CST407]' in the subject or the homework goes in the bit bucket and you get a zero grade for that assignment.  Learn to love netiquette.  J

We'll be writing Unit Tests for all our homework programs using NUnit 2.x.  Include them with your homework.

Tentative Outline:

Week

Date
Topic(s)

Text

HW/Lab Assignment
DUE Date

1

10/3

Course overview, class logistics.

The Gist of .NET

Files and Compiling

Decompiling

Namespaces

Classes

Assemblies

Value Types and Reference Types

Intro to NUnit

 

Ch1

Visit Class web site.

1. Print syllabus.

2. Purchase book.

3. Write HelloDOTNETWorld.exe without the IDE, compile it, and successfully email the code to me following the guidelines above.

4. Write an NUnit Test for HelloWorld

(4 points - the only freebie)

Next Fri

9:00am

2

10/10

More on deployment

C# keywords

Garbage Collection

Arrays

Strings and Formatting

System.Collections (brief)

Exceptions

 

Ch1

Read Chapter 1.

1. Create and populate a multidimensional array of value types

2. Spin through the array and pretty print their contents to the console.

3. Write tests

(4 points)

Next Fri

9:00am

3

10/17

 

Class Design

Constructors

Private/Public

This, static, const, readonly

Delegates

Passing by ref and value

Overloading, function and operator

Casting

Debug/Trace

ConfigFiles

Ch2

Read Chapter 2

1. Create a class Car with and Engine, Windows, Wheels

2. Create behavioral methods on all classes

3. How will you structure your class?  Does the Car contain Wheels?

4. Test it

(4 points)

 

2 points Extra Credit:

1. Write a C# console app that prints out true or false if a year is a leap year.  Ex: leapyear.exe 1996 outputs 'true'

How many lines of code did it take? Why?

2. Test it

Next Fri

9:00am

4

10/24

OOPapolooza

Class Hierarchies

Abstract

Single Inheritance

New and base

Overriding

Exceptions

Type/typeof

Binding/Activator

 

Read Chapter 3 and 4

1. Extend your Car and create Planes and Trains. 

2. How does OOP help? How does it Hinder?

3. Test it

(4 points)

 

1. Dynamically instantiate a class from a Fully Qualified Assembly Name in your app.config file

3. Test it

(4 points)

 

Next Fri

9:00am

5

10/31

Exploring the System namespace

System.IO

System.Net

System.Data

Threading

 

Ch5

Study for Midterm

 

NO HOMEWORK THIS WEEK

Next Fri

9:00am

6

11/7

All XML all the Time

System.Xml

 

Everything you need to know about Xml in 3 hours. J

 

Take Midterm (90 minutes)

1. Multiple Choice and Short Answers

(20 points)

 

Homework:

1. Take a Books Xml file I'll give you and read it into memory

2. Setup arbitrary searching like findbooks.exe 'author = 's*''

3. Do it with XmlTextReader

4. Do it with XmlDocument

5. Do it with XPathNavigator

(4 points)

Write up ~500 words on what the ramifications of moving the software industry to a “Managed“ environment over previous kinds of Software Development.

(4 points)

Next Fri

9:00am

7

11/14

C# applied to WinForms

 

 

Homework: TBD

(4 points)

Next Fri

9:00am

8

11/21

C# applied to WebForms

 

Homework: TBD

(4 points)

NEXT WEEK: THANKSGIVING

Next Fri

9:00am

9

12/5

The CLR

Attributes

Reflection

Inside Serialization

Interop/PInvoke

 

Homework: Show me the status of your Final! Something better be working by now. ;)

(4 points)

 

 

Next Fri

9:00am

10

12/12

TURN IN FINAL

 

9AM: TURN IN FINAL.  We'll have a formal 'egoless' code review and I'll grade them (anonymously) on the projector and we'll discuss them.

 

 

Class Scoring:

First, the obvious. 100 Points possible.

A  >=90

B  >=80

C  >=70

D  >=60

F  < 60

Midterm - 20 points - on 11/7 (in class)

Final - 40 points - on 12/12 (take home, given 12/5)

Homework - 10 programs @ 4 points each, gives 40 points, one or more a week for ten weeks.

Homework programs will be graded on:

1. Correct use of Basics (foreach, classes, namespaces, BCL libraries)

2. Appropriate Use of OOP (no gratuitous object hierarchies, please)

3. Robustness (did you test it?)

4. Attention to Detail (did you think?)

Extra Credit: Elegance/Flair (my discretion)

 

 

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Digging into the Exception Management Block

August 13, '03 Comments [0] Posted in Web Services
Sponsored By

I've been digging into the Exception Management Block and attending a lot of Exception-related meetings lately.  Here's a list of the most useful (to me) resources around this block.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Writing Interoperable Web Services using the WS-I Basic Profile 1.0

August 13, '03 Comments [0] Posted in Web Services
Sponsored By

This is a great document from the Microsoft Patterns and Practices folks, who are consistently producing some great stuff.  I had the pleasure of working with PAG in the past and I’m really digging the whole Patterns series.  

Find out how to ensure that your Web service will work across multiple platforms and programming languages and with other Web services by adhering to the guidelines set forth by the Web Services Interoperability (WS-I) organization in their Basic Profile version 1.0.
[Microsoft Download Center]

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

TechEd 2003 DVD: Tragedy Strikes! I must buy a lottery ticket...

August 12, '03 Comments [6] Posted in Web Services | TechEd | Speaking
Sponsored By

Well...there was a 1 in 400 chance, and I was the one.  On the TechEd DVD boxed set that contains all the multimedia presentations for the sessions, if you sort by name, and look for DEV389.htm, you'll see DEV387, DEV388, DEV400, waaah?!?  Turns out the launching .HTM file is missing from the DVD set for my session.  If you look on Disc 2 and dig for the DEV389_files folder, you can launch the default.htm from there and watch the talk with no problems.  But, for those using the menuing system (everyone) you'll get a broken link.  Bummer.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Intellectual property, decompilation, .NET and getting the 'gist'

August 11, '03 Comments [0] Posted in Web Services | ASP.NET
Sponsored By

Sergio Pereira asked a great question in the comments that I wanted to bring out to a full blown post.  He said:

I'm with you on not touching if it works. As a regular user of Reflector I constantly find myself struggling with the moral issues of what I'm doing. Do you consider what you just did a violation of Intellectual Property ?

This is a great question and a slippery slope.  Here's some brainstorming and thoughts to get a discussion started.

To start, I didn't simply "decompile and copy-paste," not only is that shady (not to mention technically infeasible) but it wasn't my intent.  My intent was to get the 'gist' of what is going on inside of ASP.NET's @Page Directive validateInput. 

Some folks could argue that using ILDASM to get the 'gist' of something is stealing intellectual property.  I believe that is usually true.  On the other hand I believe that Microsoft included ILDASM (and provides rich metadata in .NET and didn't obfuscate System.*) and wants us to understand the gist of the Windows .NET Framework.  They also have provided Rotor source code which many people, including myself, use as a reference implementation to get the 'gist/zen/gestalt' of .NET. 

So, what is appropriate use of ILDASM?  If someone ILDASMed the System.Collections and writes a better Dictionary, is that a gray area?  Who first thought up Dictionaries? Do I owe someone royalties?  We all look at other code, other libraries, and internal headers to get the 'gist.' 

However, I'm not going to use this code until I'm satisified that it is righteous.  Perhaps I'll write an MSDN Article on the subject of Cross Site Scripting and this backport.  Perhaps it will be useful and released as a sample, perhaps it will be quashed, perhaps it will be my own personal unused curiousity. Any thoughts ScottGu?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.