Question: Is it bad form to do something you know will throw an exception (assuming you handle it properly)? For example:

```
 JSONArray stuff = new JSONArray();
 JSONArray otherStuff = new JSONArray();
 try{
     for(i = 0; i < stuff.length(); i++){
         JSONObject a = stuff.getJSONObject(i);
         otherStuff.add(a);          
      }
 } catch (JSONException e){
     Log.e("FAIL", e.toString());
 }

//more code adding things to array later on

```

In this case the first time you ran the sequence the array would be empty and getJSONObject would throw an excpetion because there would be nothing at index i. However, later on, if things were added to the array, it would not throw an exception.

Granted this code is just a hypothetical (I'm sure there are better examples - someone may have one) but as a matter of form/style is it ok to intentionally throw an exception? Or should you just avoid throwing them all together?

Answer: 
In my experience it's generally considered bad practice to use Exceptions as flow control. They should be reserved for Exceptional situations.
In my opinion it is ok, if the exception is only thrown in exceptional cases and not as a regular way to e.g. quit a loop.

But be aware: create, throw and than catch an exception is not fast. 

=> If possible (and not too complicated, I would highly recommend not to use an Exception.