Is it better practice to have void method throw an exception or to have the method return a boolean?
There's quite a few questions about this on stackoverflow but I think my general rule tends to be leave exceptions for exceptional circumstances and booleans for where failure occurances is an accepted/known possible behaviour.  

So I personally probably prefer your option 2 (interested to see what others think), where if anything the exception is thrown a bit higher up the chain.  That way I could re-use the isValid logic elsewhere and deal with the failure without needing to wrap it in an exception handler.

Of course, I think this is probably a case by case basis and depends on the kind of logic being checked.

I'm sure I remember a really good Q&amp;A on this somewhere but can't quite find it.  However found a couple of discussions:

Throw exception or return boolean - SO 

Throwing exceptions - SO

EDIT:  To further comment after the edits, perhaps you could also consider the option of returning status codes (enums) instead of the exceptions if there are a number of options.  This has the benefit of being more efficient however as some have mentioned on SO could expose unecessary workings if this is a API or assembly.  Some links I found on SO about this with some good discussions were:

Exception or error code enum
to use error codes or not

And there were more.  I see this coming down to a few options.


Throw exception
Return true/false
Return a status/error code enum


All probably have their place.  Exceptions do occur the most overhead so if performance is an issue or the routine is called in many places perhaps this is not the best solution.  I also saw mention that it was not necessarily a good idea to use exceptions to control the flow of application logic which it would seem to be doing in your case?

Basically my thoughts are to use return true/false, use a status error code, and then exceptions in that order.

An alternative suggestion might be something along the lines of (whether it's a decent alternative or not hopefully someone might comment on ???):

public int playWord(string w) {
    Word word = new Word(word);
    if (word.isValid()) {
       return word.getScore();
    } else {
       throw new InvalidDataException(word.GetErrorMessage());
    }
}

class Word {
   private String word;
   private String errorMessage = null;

   public Word(string w) {
       word = w;
   }

   public boolean IsValid() {
       // TODO: perform various checks calling private methods as required and if fail store against errorMessage
      return errorMessage == null;
   }

   public String GetErrorMessage() {
      return errorMessage;
   }

   public int getScore(string word) {
     // return the score of the word no matter what it is
   }
}