Академический Документы
Профессиональный Документы
Культура Документы
Benjamin Day
Benjamin Day
Consultant, Coach, Trainer Scrum.org Classes
Professional Scrum Developer (PSD) Professional Scrum Foundations (PSF)
TechEd, VSLive, DevTeach, OReilly OSCON Visual Studio Magazine, Redmond Developer News Microsoft MVP for Visual Studio ALM Team Foundation Server, TDD, Testing Best Practices, Silverlight, Windows Azure http://blog.benday.com benday@benday.com
Scrum Masters
Everyone
TOP 10 THINGS
The List.
1. 2. 3. 4. Be humble Object-orientation Write less code Value Types vs. Reference Types 5. Exceptions 6. Generics 7. Collections 8. IDisposable, using, & garbage collection 9. LINQ 10. Lambda Expressions
Some extras.
11. Virtual, override, & new() 12. Tune out the static 13. Partial classes & methods 14. Covarience contravariance 15. Named parameters 16. Optional parameters 17. Dynamic keyword
Copyright 2011, Benjamin Day Consulting, Inc. www.benday.com 6
BE HUMBLE.
Be humble.
Software is complex. We developers
want to please think were awesome almost always underestimate
Tips.
Keep it simple. Expect to make mistakes. Not everyone will understand your abstractions. Favor maintainability over slickness. Write unit tests. Lots of unit tests.
Copyright 2011, Benjamin Day Consulting, Inc. www.benday.com 9
10
Remember Object-Orientation
11
Object-Oriented Principles
4 tenets Encapsulation Polymorphism Inheritance Abstraction
12
13
14
15
16
17
Auto-Implemented Properties
18
19
20
Whuh?
Value Types Non-object types Stored in memory stack int, long, char, byte, etc. float, double decimal bool User-defined
Structs Enumerations
Copyright 2011, Benjamin Day Consulting, Inc. www.benday.com 22
Reference Types Object types Stored in memory heap Variables are pointers to memory location
Unboxing
Converting a boxed value type object back into an value type variable
23
EXCEPTION HANDLING
24
25
GENERICS
26
27
ViewModelField<T> DomainObjectManager<T>
28
COLLECTIONS
What is a Collection?
Data type for organizing lists of objects Similar to an array
30
31
32
33
IDisposable
36
37
38
39
40
41
LINQ
42
LINQ
Language-Integrated Query Enables SQL-like querying of objects via IEnumerable<T>
43
LINQ Stuff
Operators select from where orderby Useful functions FirstOrDefault() First() Min() Max() Count() Skip() Take() Reverse() Sum()
44
45
LAMBDA EXPRESSIONS
46
47
48
Additional Reading
Essential C# 4.0 by Mark Michaelis Great overview of the language
49
Additional Reading
CLR via C# by Jeffrey Richter Whats going on under the hood of C# and the .NET Framework
50
The List.
1. 2. 3. 4. Be humble Object-orientation Write less code Value Types vs. Reference Types 5. Exceptions 6. Generics 7. Collections 8. IDisposable, using, & garbage collection 9. LINQ 10. Lambda Expressions
51
Thank you.