Since assertions are almost always DISabled in production, I prefer to see explicit if's and throw's in the code.
On Fri, Mar 25, 2011 at 1:44 PM, Dawid Weiss <[email protected]>wrote: > Do you mean running with assertions enabled in production or having > hardcoded, explicit ifs/throws? Just curious. > > Dawid > > On Fri, Mar 25, 2011 at 9:29 PM, Ted Dunning <[email protected]> > wrote: > > That is why I prefer the default, even in production, to be to check. > Not > > checking should be the (very) special case where there are obscure > reasons > > to know that the access is correct that > > the optimizer can't see. > > > > On Fri, Mar 25, 2011 at 12:17 PM, Dawid Weiss < > [email protected]> > > wrote: > >> > >> The difference in speed may be marginal since newer hardware/hotspot > will > >> predict those branches almost never take place and probably discard > them. > > >
