Difference: ProgrammingNotes (23 vs. 24)

Revision 2423 Jan 2007 - TobyCabot

Line: 1 to 1
 
META TOPICPARENT name="TechNotes"
Line: 57 to 57
  My rule of thumb is that you shouldn't throw when you get empty responses. So if the database returns 0 rows for your query you should return an array or collection with zero elements, but there should be no exception since everything was processed properly. Save the exception for when things actually go wrong, such as timeouts, communications failures, etc.
Changed:
<
<
This affects protocols as well. Let's say you're trying to design a message that can say "I know that the value of foo is 27" but it also needs to express "I don't know what the value of foo is". You've got a few possibilities, but the most important issue is: do you assign a specific value of the parameter (e.g. -1) to mean "don't know" or do you indicate that in some other way, such as a flag or different message type. I prefer the latter approach since it eliminates the issue of having to figure out a "magic" value of your parameter that means something different than all of the other possible values.
>
>

How to say "I don't know"

Let's say you're trying to design a message that can say "I know that the value of foo is 27" but it also needs to express "I don't know what the value of foo is". You've got a few possibilities, but the most important issue is: do you assign a specific value of the parameter (e.g. -1 if the parameter is an integer) to mean "don't know" or do you indicate that in some other way, such as a flag or different message type. I prefer the latter approach since it eliminates the issue of having to figure out a "magic" value of your parameter that means something different than all of the other possible values.

  A guy that I once worked with wrote a research paper that went into extreme detail about the differences between different types of uncertainty in software development, i.e. the difference between "I don't know" and "I know that there's no answer". Actually, I didn't understand much beyond the abstract but my co-worker spent some time explaining it to me.
View topic | History: r25 < r24 < r23 < r22 | More topic actions...
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding The Caboteria? Send feedback