DevDevin

  Home  |   Contact  |   Syndication    |   Login
  105 Posts | 0 Stories | 36 Comments | 29 Trackbacks

News

Archives

Post Categories

Blogworthy

Design Patterns

Recommended Books

Best Practices

General, but common ways of coding for improved performance, maintenance, etc.

I plan to use the new localization features in ASP.NET 2.0 in my next personal project that I deem cool enough to be truly international. Here is an article that shows how simple it really is: http://www.codeguru.com/csharp/.net/net_asp/miscellaneous/article.php/c12407__1/.


Today I came across a set of sweet little atomic operations for manipulating integers in .NET: http://msdn2.microsoft.com/... So instead of doing this: private object counterLock = new Object(); lock (counterLock){ counter++;} You just do this: Interlocked.Increment(ref counter); This has two advantages. First, the code is much cleaner. Second, the performance is much faster. Why? I think the interlocked method is all executed within user mode whereas the other would require ......

I was just helping a buddy of mine do some cross-site scripting (XSS) prevention and came across some good resources. If you don't know what XSS is, there is decent introduction here: http://www.counterhack.net/... Now on to the ones that I really wanted to post: This one is from Microsoft Patterns & Best Practices. How To: Protect From Injection Attacks in ASP.NEThttp://msdn.microsof... Here is a download for Microsoft ......

I attended the Seattle Code Camp this weekend (where I could) and had quite a bit of fun. In addition to learning a few things, I got to preview a bunch of upcoming technologies and meet a lot of distinguished developers in the area. For those of you who weren't able to attend or didn't see the same presentations I did, I'll just share some of my notes: Refactor! is a great tool that I already blogged about before, but they deserve a special plug since Mark Miller largely contributed to the event ......

Here is a technique that I only recently came to know as “lazy loading“. First, it is useful when the variable will not always necessarily be used and therefore will not always need to be loaded. Second, since it checks to see if the variable has already been loaded, it will not reload the data multiple times. This is especially important to do performance-wise for variables that may load large amounts of data so that it does not needlessly allocate extra space in memory. In this example, ......