Latertater / jbox2d

Automatically exported from code.google.com/p/jbox2d
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Assertion errors aint no exceptions #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I find that throughout the JBox2d code there are assertions used in placed 
where exceptions are the right thing to use, e.g.,
assert (2 <= count && count <= Settings.maxPolygonVertices);
This is especially odd if one does not enable assertions in the vm and code 
crashes.

Original issue reported on code.google.com by stefan.s...@googlemail.com on 3 Sep 2012 at 5:21

GoogleCodeExporter commented 9 years ago
Yes, but unnecessary ifs will cause the engine to perform slower.  The 
assertions are more for validating that the engine is running correctly 
internally while developing.  Production code should not use them.

Original comment by toucansa...@gmail.com on 27 Jan 2013 at 6:04