c#

c#

C#, VB.NET, and echoing strings in the VS.NET Immediate Window

I've become rather agnostic on the whole topic of C# versus VB.NET, but there are still those annoying little differences that sneak up behind you and rabbit-punch you in the kidneys. Like, say, using the VS.NET 2003 command window in immediate mode to print a string:

By Jeff Atwood ·
Comments

programming languages

Please use .ToString() responsibly

I've seen this kind of code a lot recently: try { int i = 0; int x = 0; Console.WriteLine(i / x); } catch (Exception ex) { Console.WriteLine(ex.Message); } This results in the following output: Attempted to divide by zero. Unless there's some compelling reason you need an

By Jeff Atwood ·
Comments

c#

C# implementation of ASCII85

As promised, here is my C# implementation of the ASCII85 algorithm. This code is a loose port of the C sample referenced from the Wikipedia page. It's too much code to paste into a single entry, so I packaged it as a VS.NET 2003 solution -- using

By Jeff Atwood ·
Comments

c#

TryParse and the Exception Tax

In .NET 1.1, TryParse is only available for the Double datatype [http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDoubleClassTryParseTopic.asp] . Version 2.0 of the framework extends TryParse to all the basic datatypes [http://www.mikepope.com/blog/DisplayBlog.aspx?permalink=1239]. Why do we care? Performance. Parse

By Jeff Atwood ·
Comments

performance

On Managed Code Performance, Again

Managed code may be fat and slow, but it fares surprisingly well in Rico's C# port of Raymond Chen's C++ Chinese/English dictionary reader: Sure, the C++ version eventually outperforms the managed code by a factor of 2x, but what's interesting to me-- and

By Jeff Atwood ·
Comments

programming languages

You Can Write FORTRAN in any Language

A recent user-submitted CodeProject article took an interesting perspective on the VB.NET/C# divide by proposing that the culture of Visual Basic is not conducive to professional software development: We’ve seen that the cultures of VB and C# are very different. And we’ve seen that this is

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

c#

Logging TraceListener Improved

I made a few improvements to the Logging TraceListener: * Files can now be aged by date as well as size * Filename is now completely templated using a single FileNameTemplate property, which supports standard String.Format codes for file number and date * Added separate properties to specify units of scale for

By Jeff Atwood ·
Comments

vb.net

The Slow Brain Death of VB.NET

It’s amusing that the very people defending VB.NET are, ironically, illustrating precisely why VB.NET is in such trouble: I just want to make it clear that I am one MVP that does NOT intend to sign this petition about VB. And by the way, my background is

By Jeff Atwood ·
Comments

.net

Paging Dr. Dotnetsky...

You always notice the names that appear frequently in your code related Google searches. For me, one of those names is Peter Bromberg, PhD, the driving force behind Egghead Cafe. There are some great articles there, but the pick of the litter are the ones by Peter’s alter ego,

By Jeff Atwood ·
Comments

programming languages

MS Language Equivalents

As a complement to my C# to VB.NET cheat sheet links, here's a comparative list of programming language equivalents in VB, J#, C++, C#, JScript, and even Visual FoxPro. Since .NET is just a thin wrapper over Win32 (or so I've been told), you may

By Jeff Atwood ·
Comments

.net

The One Trillion Dollar Development Pyramid

Kit George is the program manager for the .NET Base Class Library team. Kit recently posted an entry on the BCL blog describing a solution to a customer problem: We recently got asked this question by a customer: “In C#, how do I ensure that a string entered into a

By Jeff Atwood ·
Comments