debugging

programming languages

Whitespace: The Silent Killer

Ever have one of those days where everything you check into source control is wrong? Also, how exactly is that day is different from any other? But seriously. Code that is visible is code that can be wrong. No surprise there. But did you know that even the code you

By Jeff Atwood ·
Comments

programming languages

Have You Met Your Dog, Patches?

The Gamasutra article Dirty Coding Tricks is a fantastic read. One part of it in particular rang true for me. Consider the load of pain I found myself in when working on a conversion of a 3D third person shooter from the PC to the original PlayStation. Now, the PS1

By Jeff Atwood ·
Comments

logging

The Problem With Logging

A recent Stack Overflow post described one programmer's logging style. Here's what he logs: INFO Level * The start and end of the method * The start and end of any major loops * The start of any major case/switch statements DEBUG Level * Any parameters passed into the

By Jeff Atwood ·
Comments

software development concepts

Who Wrote This Crap?

Does this sound familiar? > your program (n): a maze of non-sequiturs littered with clever-clever tricks and irrelevant comments. Compare MY PROGRAM.my program (n): a gem of algorithmic precision, offering the most sublime balance between compact, efficient coding on the one hand, and fully commented legibility for posterity on

By Jeff Atwood ·
Comments

javascript

JavaScript and HTML: Forgiveness by Default

I've been troubleshooting a bit of JavaScript lately, so I've enabled script debugging [http://blogs.msdn.com/ie/archive/2004/10/26/247912.aspx] in IE7. Whenever the browser encounters a JavaScript error on a web page, instead of the default, unobtrusive little status bar notification.

By Jeff Atwood ·
Comments

software development

The "Works on My Machine" Certification Program

Joseph Cooney had a brilliant idea for a new application certification program [http://jcooney.net/archive/2007/02/01/42999.aspx]. But Vista's bland white-on-gray badge, in my opinion, doesn't properly communicate the.. authoritative.. nature of said program. With the help of Jon Galloway [http://weblogs.

By Jeff Atwood ·
Comments

networking

Localhost HTTP debugging with Fiddler

I've had great success using ethernet sniffers (such as Etherdetect [http://www.etherdetect.com/], or Ethereal [http://www.ethereal.com/]) to troubleshoot communication problems. Installing a sniffer, even after installing the required WinPcap packet capture library [http://www.winpcap.org/install/default.htm], doesn't require a

By Jeff Atwood ·
Comments

debugging

Revisiting Edit and Continue

Edit and Continue, which shipped in Visual Studio 2005, is generally regarded as A Good Thing. It's pretty difficult to argue against the benefits of immediacy when debugging, but that isn't about to stop some people: * Frans Bouma People who grew up with assemblers, the gnu

By Jeff Atwood ·
Comments

programming practices

Why Programmers File the Worst Bug Reports

Who files better bugs? Users or developers? In How to Report Bugs Effectively [http://www.chiark.greenend.org.uk/~sgtatham/bugs.html], Simon Tatham notes that software developers, contrary to what you might think, file some of the worst bug reports: > It isn't only non-programmers who produce

By Jeff Atwood ·
Comments

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

programming concepts

It looks like you're writing a for loop!

Even the best programmers make shitty software, with bugs. But some programmers are naturally proficient at creating this special kind of software, as illustrated by a Croatian developer known as Stinky: The anecdote that best reveals how little Stinky knew about programming started when he asked Bojan to help him

By Jeff Atwood ·
Comments