Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I Add Full Stops/Periods to My Errors?

This may sound like a stupid question but it's causing some disagreement among my team. Should you add full stops (that's periods for you programmers over the pond) to my errors?

Which is better?

throw new \Exception( 'Failed to delete ' . $model_name );

or

throw new \Exception( 'Failed to delete ' . $model_name . '.' );

Problems arise when you need to concatenate multiple messages so I guess it's just a matter of consistency but is there a standard way of doing this?

like image 319
voidstate Avatar asked Jul 30 '13 10:07

voidstate


1 Answers

If it falls nicely into the definition of a sentence it probably requires a full stop.

A grammatical unit that is syntactically independent and has a subject that is expressed or, as in imperative sentences, understood and a predicate that contains at least one finite verb.

like image 191
Max Avatar answered Oct 11 '22 13:10

Max