Go to home page mail me! RSS Feed
FoxMetrics Web Analytics

January 2012 Entries

DateTime.Now vs DateTime.UtcNow

Try to use .UtcNow() as much as you can over .Now() as it is inherently faster than the later. The problem seems to stem from the fact that DateTime.Now performs a DateTime.UtcNow first and then performs a very expensive called to figure out daylight savings time and time zone information. public static DateTime Now { get { DateTime utcNow = DateTime.UtcNow; bool isAmbiguousDst = false; long ticks = TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc(utcNow, out isAmbiguousDst).Ticks; ...

posted @ Tuesday, January 10, 2012 2:50 PM | Feedback (0)

Framework layers on layers

As an architect, I stress to my team, colleagues or anyone that wants to talk IT that a solid developer needs to understand the fundamentals of how things work – especially when dealing with such a large framework such as the .Net Framework. I’m usually very slow when it comes to adopting new versions of the framework, as of now I still write code in 2.0/3.5 while 4.5 is about to start collecting dust. It has become clear to me in the past years that sometimes frameworks simply get bloated. I wrote comfortable powerful and sophisticated applications with .NET...

posted @ Tuesday, January 10, 2012 2:38 PM | Feedback (0)

HandleError – ASP.NET Mvc Attribute

I’m not a fan of hiding error messages, as it could bite you real hard. However, there are existing functionalities that just need to be discussed such as the HandleError attribute of the ASP.NET MVC application. If you are not a fan of displaying the very common Yellow Screen of Death, then HandleError should be your new friend. By default, I take certain steps when I’m setting up a new MVC app to prevent my users from ever seeing a single error page by implementing NLog, creating custom error pages and so on and so forth. HandleError is...

posted @ Monday, January 09, 2012 4:47 PM | Feedback (0)

Next entries »