Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] "assert" in cdt source vs. java compiler versionsinprojects


cdt-dev-bounces@xxxxxxxxxxx wrote on 12/12/2007 11:37:57 AM:
> 4) By default asserts are not enabled at runtime, they do nothing
> unless you run with the vm argument -ea.  It may be more effective
> to use org.eclipse.core.runtime.Assert instead.

>
> This subject is probably tangential, but I think a key advantage of
> using the built-in Java assert feature is the very thing you imply
> is a disadvantage--the ease in which it can be turned on-off at
> runtime, and the fact that it's a standard/universal mechanism. I
> don't know why the use of a home-grown assert should be necessary or
> encouraged; it made sense prior to 1.4 but not now, in my opinion.
>


I agree that it can be a good thing that they do not show up at runtime.  However, if developers are not aware
that they need to run with -ea to enable them, then the asserts are actually counterproductive by implying checks
that are not occuring.

(Personally, I did not know about -ea until today).

-Andrew

Back to the top