tags:

views:

184

answers:

6

How do you call those little annoying cases that has to be checked , like "it's the first time someone entered a record / delete the last record in a linked list (in c implementation) / ... " ?

The only term I know translates not-very-nicely to "end-cases" . Does it have a better name?

+18  A: 

Edge cases.

Aram Verstegen
A: 

I call it work ;-).

Because they pay me for it.

But edge cases (as mentioned before) is probably a more correct name.

Gamecat
+9  A: 

Corner cases

mikelikespie
+2  A: 

Ever prof I have ever had has referred to them as boundary cases or special cases.

Kevin Loney
A: 

I call them "nigglies". But, to be honest, I don't care about the linked list one any more.

Because memory is cheap, I always implement lists so that an empty list contains two special nodes, first and last.

When searching, I iterate from first->next to last->prev inclusively (so I'm not looking at the sentinel first/last nodes).

When I insert, I use this same limit to find the insertion point - that guarantees that I'm never inserting before first or after last, so I only ever have to use the "insert-in-the-middle" case.

When I delete, it's similar. Because you can't delete the first or last node, the deletion code only has to use the "insert-in-the-middle" case as well.

Granted, that's just me being lazy. In addition, I don't do a lot of C work any more anyway, and I have a huge code library to draw on, so my days of implementing new linked lists are long gone.

paxdiablo
+1  A: 

I use the term special cases

tehvan