code refactoring

code refactoring

Flattening Arrow Code

I often encounter code like this: if (rowCount > rowIdx) { if (drc[rowIdx].Table.Columns.Contains("avalId")) { do { if (Attributes[attrVal.AttributeClassId] == null) { // do stuff } else { if (!(Attributes[attrVal.AttributeClassId] is ArrayList)) { // do stuff } else { if (!isChecking) {

By Jeff Atwood ·
Comments

code refactoring

The real cost of performance

I don’t usually get territorial about modifications to “my” code. First of all, it’s our code. And if you want to change something, be my guest; that’s why God invented source control. But, for the love of all that’s holy, don’t take working code and

By Jeff Atwood ·
Comments

programming languages

The Tyranny of ElseIf

I don't understand it. I've seen this phenomenon over and over in VB.NET, in code from experienced programmers: If dt.DayOfWeek = DayOfWeek.Sunday Then Return dt ElseIf dt.DayOfWeek = DayOfWeek.Monday Then Return dt.AddDays(6) ElseIf dt.DayOfWeek = DayOfWeek.Tuesday Then Return dt.AddDays(

By Jeff Atwood ·
Comments