Click here to Skip to main content
15,921,028 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Error while saving image to file "A generic error occurred in GDI+." Pin
Dave Kreskowiak6-May-08 10:03
mveDave Kreskowiak6-May-08 10:03 
GeneralRe: Error while saving image to file "A generic error occurred in GDI+." Pin
nishkarsh_k6-May-08 10:38
nishkarsh_k6-May-08 10:38 
QuestionByRef vs Return Pin
Kevin Brydon6-May-08 3:12
Kevin Brydon6-May-08 3:12 
AnswerRe: ByRef vs Return Pin
Dave Kreskowiak6-May-08 3:45
mveDave Kreskowiak6-May-08 3:45 
GeneralRe: ByRef vs Return Pin
Kevin Brydon6-May-08 4:43
Kevin Brydon6-May-08 4:43 
GeneralRe: ByRef vs Return Pin
Dave Kreskowiak6-May-08 4:55
mveDave Kreskowiak6-May-08 4:55 
GeneralRe: ByRef vs Return Pin
Kevin Brydon6-May-08 5:54
Kevin Brydon6-May-08 5:54 
GeneralRe: ByRef vs Return Pin
Dave Kreskowiak6-May-08 6:17
mveDave Kreskowiak6-May-08 6:17 
Kevin Brydon wrote:
If the first function handled all its exceptions internally it would return nothing when there was database error or there was no course with that ID in the database. The calling method wouldnt be able to tell what really happened.


Yes, it would if the function was written to throw an exception and not bury them internally. Depending on the requirements, the function should throw an exception if there was a problem, and let the caller (business rules) decide what to do about it.


Kevin Brydon wrote:
i dont think the calling method should care about how the function failed, just whether it did or not.


This is up to the business rules of your app, not you. Think about that. This is not a hard and fast rule in every application.


Kevin Brydon wrote:
Allowing the functions to throw out exceptions in my opinion is a bad idea if you can just handle them internally.


There are many cases where the caller needs to know HOW the operation failed and handle the failure in ceratin ways depending on the type of failure. Just returning a True/False doesn't convery any kind of useful failure information back to the caller.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




AnswerRe: ByRef vs Return Pin
Guffa6-May-08 6:41
Guffa6-May-08 6:41 
GeneralRe: ByRef vs Return Pin
supercat96-May-08 6:50
supercat96-May-08 6:50 
GeneralRe: ByRef vs Return Pin
Guffa6-May-08 9:35
Guffa6-May-08 9:35 
GeneralRe: ByRef vs Return Pin
Kevin Brydon7-May-08 6:26
Kevin Brydon7-May-08 6:26 
Questionsearching in listview Pin
idi6-May-08 2:45
idi6-May-08 2:45 
AnswerRe: searching in listview Pin
Dave Kreskowiak6-May-08 3:38
mveDave Kreskowiak6-May-08 3:38 
GeneralRe: searching in listview Pin
idi7-May-08 1:21
idi7-May-08 1:21 
GeneralRe: searching in listview Pin
Dave Kreskowiak7-May-08 2:01
mveDave Kreskowiak7-May-08 2:01 
Questionsend messages to cell phones Pin
Siboniso6-May-08 1:54
Siboniso6-May-08 1:54 
AnswerRe: send messages to cell phones Pin
Christian Graus6-May-08 1:56
protectorChristian Graus6-May-08 1:56 
QuestionResize / Reduce / shrink Image Size Pin
nishkarsh_k6-May-08 1:36
nishkarsh_k6-May-08 1:36 
AnswerRe: Resize / Reduce / shrink Image Size Pin
Christian Graus6-May-08 1:57
protectorChristian Graus6-May-08 1:57 
QuestionRe: Resize / Reduce / shrink Image Size Pin
nishkarsh_k6-May-08 3:57
nishkarsh_k6-May-08 3:57 
AnswerRe: Resize / Reduce / shrink Image Size Pin
John Weinhold6-May-08 9:53
John Weinhold6-May-08 9:53 
GeneralRe: Resize / Reduce / shrink Image Size Pin
nishkarsh_k6-May-08 10:01
nishkarsh_k6-May-08 10:01 
GeneralRe: Resize / Reduce / shrink Image Size Pin
John Weinhold6-May-08 10:26
John Weinhold6-May-08 10:26 
QuestionGUI Problems Pin
Tauseef A6-May-08 1:15
Tauseef A6-May-08 1:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.