http://www.codinghelmet.com/  

Wear a helmet. Even when coding.

 
How To
1What Makes while Loop a Poor Choice in Programming
2How to Wrap System.Random Into an Infinite IEnumerable<int> Sequence
3Substituting the Builder with the Sequence of Factory Methods
4Custom Implementation of the Option/Maybe Type in C#
5Pros and Cons of Multiple Constructors
6Defensive Design: An Experiment
7Understanding Closures in C#
8Understanding Delegates and Higher-Order Functions in C#
9How to Derive a Class and Not Invite Bugs Doing So
10Simple Design by Example: Making Published Content Editable
11How to Write Unit Tests for Generic Classes
12The Case against Throwing ArgumentException and the Like
13How to Write Unit Tests for Temporal Coupling between Method Calls
14How to Organize Repository Interfaces to Support CQRS Architecture
15How to Write a Test to Prove that Collection was Loaded Eagerly?
16How to Avoid the Need to Implement ICloneable Interface and What to Do Instead
17Poor Man’s Polymorphism or What’s so Wrong about If-Then-Else?
18Advances in Applying the Builder Design Pattern
19Best Practices Implementing IEnumerable Interface in C#
20What Makes Design Patterns Fail So Many Times?
21How to Implement Lazy Default-If-Empty Functionality on Collections
22Interface Segregation Principle and Calling Protocols
23Understanding the Option (Maybe) Functional Type
24Why do We Need Guard Clauses?
25How to Use Module Coupling and Instability Metrics to Guide Refactoring
26How to Measure Module Coupling and Instability Using NDepend
27How to Measure Abstractness of Modules Using NDepend and CQLinq
28How to Reduce Cyclomatic Complexity Part 1: Null Object Pattern
29How to Reduce Cyclomatic Complexity Part 2: Special Case Pattern
30How to Reduce Cyclomatic Complexity Part 3: Avoiding Optional Parameters
31How to Reduce Cyclomatic Complexity Part 4: Avoiding Null Parameters
32How to Reduce Cyclomatic Complexity Part 5: Option<T> Functional Type
33How to Reduce Cyclomatic Complexity Part 6: Functional Domain Logic
34How to Reduce Cyclomatic Complexity Part 7: Extension Methods
35How to Reduce Cyclomatic Complexity Part 8: Map-Reduce Queries
36How to Reduce Cyclomatic Complexity Part 9: Switchable Factory Methods
37How to Reduce Cyclomatic Complexity Part 10: Domain Logic in Factories
38How to Reduce Cyclomatic Complexity Part 11: Working With Collections
39How to Reduce Cyclomatic Complexity Part 12: Composite Design Pattern
40How to Reduce Cyclomatic Complexity Part 13: Service Locator Pros and Cons
41How to Reduce Cyclomatic Complexity Part 14: Service Locator Applied
42How to Reduce Cyclomatic Complexity Part 15: Guard Clause
43Design Technique to Reduce Number of Generic Parameters
44How to Write Functional Code in C#: An Example
45How to Avoid Returning Null from a Method
46Cascading Abstract Factories to Eliminate Dependencies
47Object Composition Using Chain of Responsibility Design Pattern
48How to Easily Test Validation Logic in Constructors in C#
49How to Apply Visitor Pattern Without Breaking Encapsulation of Concrete Elements
50How to Ensure Internal Consistency of Mutable and Immutable Objects
51How to Implement Unit Tests for Equals and GetHashCode Methods
52Best Practices Using Enums in .NET
53How to Validate Enumeration Values in Property Setters
54How to Implement IComparable<T> Interface in Base and Derived Classes
55The ICloneable Controversy: Should a Class Implement ICloneable or Not?
56How to Validate String Properties in Business Objects
57How to Override Equals and GetHashCode Methods in Base and Derived Classes
58How to Bulk Insert Complex Objects into SQL Server Database
59How to Implement Collection Property to Contain Unique Objects
60How to Version SQL Server Database Schema
61How to Handle Exceptions from Background Worker Thread in .NET
62How to Display Row Numbers in WPF ListView Control with Static Content
63How to Show Progress and to Cancel Asynchronous Operation Using WPF ObjectDataProvider and XAML
64How to Implement ICloneable Interface in Derivable Classes in .NET
.NET Hints
1LINQ Query for Blacklist-Based Spam Filter
2LINQ Expression to Find All Modes of an Array
3LINQ Expression to Find Mode of an Array
4Regex and LINQ Query to Split Text into Distinct Words
5LINQ Expression to Test If a Number is Prime
6LINQ Expression to Find All Prime Numbers
7How to Get Property Values using LINQ to Objects
8How to Set Property Value using Reflection on a Value Type
9How to Set Property Values using LINQ to Objects and Reflection
Lists
1The Reading List
Programming Exercises
1Finding Arithmetic Expression to Construct a Value from Given Numbers
2Sudoku Solver
3Card Shuffling Problem
4Finding Two Smallest Numbers in an Array
5Finding a Value in an Unsorted Array
6Finding Kth Smallest Element in an Unsorted Array
7Finding a Number That Appears Once in Array of Duplicated Numbers
8Finding a Value in a Sorted Array
9Finding a Majority Element in an Array
10Paginating an Unsorted Array
11Simple Arithmetic Expression Evaluator
12Finding Mode of an Array
13Converting Number Bases
14Reversing an Array
15Reducing Fractions
16Maximum Sum Subarray
17Sum of First N Numbers
18Sum of Squares of First N Numbers
19Testing If Two Strings are Anagrams
20Intersection of Two Unsorted Arrays
21Testing if Number is Prime
22Finding All Prime Numbers Smaller Than Specified Value
23Removing Multiple Consecutive Spaces from a String
24Finding Two Numbers That Appear Once in Array of Duplicated Numbers
25Finding a Number which Appears Once in Array where All Other Numbers Appear Three Times
26Prime Factorization
27Finding Numbers Which Appear Once in an Unsorted Array
28Rotating an Array
29Finding Minimum Weight Path Through Matrix
30Moving Zero Values to the End of the Array
31Counting Intersection of Two Unsorted Arrays
Object-Oriented Programming Ground Up
1Lesson 1 - From Structure to Class
2Lesson 2 - Class Inheritance
3Lesson 3 - Encapsulation
4Lesson 4 - Polymorphism
5Lesson 5 - Abstract Methods
6Lesson 6 - Multiple Inheritance

webmasters