Blog Stats
  • Posts - 24
  • Articles - 0
  • Comments - 71
  • Trackbacks - 91

 

May 2004 Entries

Use C# comment styles to your advantage

Comments within a C# method body tend to A) make a problem statement then B) document the steps to solve the problem. The problem statements tend to be multi-line; the details of the solution tend to be single-line. I want the problem statements to stand out. Traditionally I use #region blocks to group the problems. Unfortunately, regions are single-line. They are also slightly more laborous to construct. Lately I have been using a triple-slash comment block at the top of the method body to state...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

HTTP GET Idempotence and ASP.NET

I am struck by the consequences of the experience Craig relates in this post: http://staff.develop.com/ca... He is discussing a Wiki site that mysteriously had its page content rolled back to a previous version. Wiki pages generally contain a link to do this, and it is assumed that a human would follow it with caution. Turns out that GoogleBot crawled the site and what-do-you-know the content rolled back. The underlying problem...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

C#: Properties versus getter methods

You might be wondering why some classes in the .NET Framework have properties, other classes have GetXXX methods, and some have a combination of the two. The reason is that the semantic, or meaning, is quite different. Consider this class: public class Customer{ public int CustomerID; public string FirstName; public string LastName; public Order[] GetOrders() { // do database work }} The CustomerID, FirstName, and LastName represent the customer state. The orders are derived from the customer state...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

 

 

Copyright © Eron Wright