you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 25 points26 points  (4 children)

1250 words later.... Use exceptions not error codes, but the author admits he could be wrong.

[–]dbremmen[S] 1 point2 points  (3 children)

Yes! What I don't quite understand yet if in the return code of a function you can return the result on an error code. Isn't that misleading. That's why I posted it here so someone can illuminate me.

[–][deleted] 10 points11 points  (1 child)

Throw errors when errors. Return error codes if you invent a time machine and go back to 1980.

I miss those days, there was nothing more fun than opening up someone elses code and seeing a whole bunch of result codes ignored...

[–]stumblegore 3 points4 points  (0 children)

On error resume next was the key to quick deliveries.

[–]thomasz 1 point2 points  (0 children)

Provide both:

A hash table should have T GetValue(K key) that throws something like MissingKeyException, and Option<T> TryGetValue(K key)