.net framework

.net framework

Computers are Lousy Random Number Generators

The .NET framework provides two random number generators. The first is System.Random [http://msdn2.microsoft.com/en-US/library/system.random.aspx]. But is it really random? > Pseudo-random numbers are chosen with equal probability from a finite set of numbers. The chosen numbers are not completely random because a

By Jeff Atwood ·
Comments

documentation

Avoiding Undocumentation

Have you ever noticed that much of the online MSDN .NET framework help is.. not helpful? Take the the MSDN help for the IBindingList.AddIndex method [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemComponentModelIBindingListClassAddIndexTopic.asp] , for example: Scott Swigart calls this undocumentation, and elaborates further

By Jeff Atwood ·
Comments

enums

Avoiding Booleans

Brad Abrams recently posted [http://blogs.msdn.com/brada/archive/2005/10/26/475085.aspx] another great excerpt from the unfortunately named .NET Framework Standard Library Annotated Reference Volume 2 [http://www.amazon.com/exec/obidos/ASIN/0321194454/codihorr-20]: > Avoid creating methods with Boolean parameters. Boolean parameters make calls

By Jeff Atwood ·
Comments

.net

The bloated world of Managed Code

Mark Russinovich recently posted a blog entry bemoaning the bloated footprint of managed .NET apps compared to their unmanaged equivalents. He starts by comparing a trivial managed implementation of Notepad to the one that ships with Windows: First notice the total CPU time consumed by each process. Remember, all I’

By Jeff Atwood ·
Comments

c#

Custom wsdlHelpGenerator + webroot = error

Why are the smallest bugs in the .NET framework always the most disproportionately frustrating? Take the wsdlHelpGenerator element, for example. Sure, it seems straightforward enough; you want to replace the default crappy, random hash sorted list of Web Service methods with one that’s (shock!) in alphabetical order. I know,

By Jeff Atwood ·
Comments

.net framework

Make Mine XCOPY

Steve “what the heck does furrygoat mean” Makofsky crystallized a lot of my thoughts in his recent rant on software installers. One of the biggest advantages of using the .NET framework is the way it enables XCopy deployments for the first time.* Installing a program by copying it to a

By Jeff Atwood ·
Comments

.net framework

Console apps and AppDomain.CurrentDomain.UnhandledException

This one has me stumped. I’d swear this behaved differently prior to .NET 1.1 service pack 1 (and/or XP SP2), but I can’t prove it. As reported by a CodeProject reader, you’ll get the standard .NET crash dialog in a console app, even if you’

By Jeff Atwood ·
Comments

asp

Classic ASP

I just went to the Radio Shack website to look for something, and after every click on the main page, I was greeted with this: If I was running a giant corporation, I think I’d hire coders who could develop a rational error handling strategy for our production website.

By Jeff Atwood ·
Comments

.net framework

Creating Even More Exceptional Exceptions

In response to my previous post decrying the lack of a master list of Exception classes for .NET, a helpful reader pointed out a clever little utility buried in the .NET SDK: Program FilesMicrosoft Visual Studio .NET 2003SDKv1.1Binwincv.exe Wincv works well, but it doesn’t allow me to

By Jeff Atwood ·
Comments

.net framework

Managed HTML rendering

At some point in any WinForms project, you’re bound to need either: 1. WYSIWYG text entry areas with text formatting 2. Quick and dirty printed report generation The obvious choice for both of these things is HTML. No problem! I’ll just drag my HtmlTextBox on the form, set

By Jeff Atwood ·
Comments

vb.net

Stuck in a VB.NET Ghetto

At a recent trinug user group meeting, Richard Hale Shaw was going off on a tirade about how Visual Basic 6 was “the ultimate anti-pattern.” I don’t disagree. VB6 had some serious issues, many of which .NET resolves. Then he put a question to the audience: “What specific things

By Jeff Atwood ·
Comments

vb.net

VB vs. C# - FIGHT!

If I see one more blog entry complaining about VB's verbosity, or the elitism of C# developers, I think I'm gonna puke. Why can't we all just get along? Part of what makes the .NET Runtime unique is that it offers you a choice

By Jeff Atwood ·
Comments