Loading...
DotNetKicks.com
.NET links, community driven
login
register
submit a story
upcoming stories
about
blog
Why not
join our community?
, there are
22 users online
home
users
bzbetty
comments
DotNetKick.com is an
open-source project
. Please
report any bugs
and let us know
your great suggestions
.
Currently running svn revision
620
(rss)
Kick Spy!
,
Kick Zeitgeist
and
Kick Widgets
bzbetty
bzbetty
Profile
Kicked
Submitted
Comments
Tags
Friends
Kicked By Friends
Submitted By Friends
Comments:
.NET Coding Standard & Code Review Points
22. Please check your spelling, grammar and example code for correctness before submitting an article.
picking out a couple (but obviously not all)
#7. TryParse returns a bool for whether it succeeds, not a 0 value integer... it also fails if you pass null to it, so you don't actually need to check it first.
#17. Please learn how to use the "using" keyword
#23. The two samples have entirely different behaviour... oddly enough I'm presuming the one he said was bad to do is the one that will work correctly.
posted by
bzbetty
2 months, 7 days ago
Implementing Generic Caching
Also commenting here since the original site is broken.
--------------------------
What's the advantage of using a constructor like that vs a static property that basically contains the same code, this would mean you wouldn't need to create an instance of the SafeCache class to use it (however minor that is) I do think it would make the syntax of using it a little cleaner
Would also mean you could type this instead no?
DropDownList1.DataSource = SafeCache<Widgets>.Object.WidgetIds;
DropDownList1.DataBind();
That said the Activator.CreateInstance might be more of a performance hit anyway.
Have you also thought about abstracting your caching strategy out a little? basically meaning you rely on HttpContext.Current.Cache existing, if you were using this in a BusinessLogic class that you wanted to unit test I'm guessing you'd either have to go to extra effort to get it working (create a HttpContext it could use), change it to not use the cache if HttpContext.Current is null, or use some form of dependency injection to replace the httpcontext implementation with another custom one (say a static hash table)
posted by
bzbetty
7 months, 6 days ago
C# HTML Helper Class
More overhead maybe, but there has to be something said about using standard built in framework classes over rolling your own ones.
posted by
bzbetty
8 months, 25 days ago
« Previous
1
Next »
Sponsored Link:
www.carlist.ie
Search:
Ads via The Lounge
DotNetKicks is an open source project from
Incremental Systems