Re: [ALL] Use of assert checks in code

2024-07-26 Thread Gary Gregory
On Thu, Jul 25, 2024 at 6:56 PM sebb wrote: > > On Thu, 25 Jul 2024 at 17:46, Gary Gregory wrote: > > > > Java assertions only make sense in specific cases. > > > > Never in test code, use JUnit for that (or TestNG). > > > > It might make sense in low level libraries to enable some semantic check

Re: [ALL] Use of assert checks in code

2024-07-25 Thread sebb
On Thu, 25 Jul 2024 at 17:46, Gary Gregory wrote: > > Java assertions only make sense in specific cases. > > Never in test code, use JUnit for that (or TestNG). > > It might make sense in low level libraries to enable some semantic checking > which can be enabled on the CLI. This might be more con

Re: [ALL] Use of assert checks in code

2024-07-25 Thread Gary Gregory
Java assertions only make sense in specific cases. Never in test code, use JUnit for that (or TestNG). It might make sense in low level libraries to enable some semantic checking which can be enabled on the CLI. This might be more convenient instead of "if debug is on AND some condition then thro

[ALL] Use of assert checks in code

2024-07-25 Thread sebb
I'm not convinced that it ever makes sense to use assert checks in our code. In the case of test code, it seems to me that a JUnit assertion makes more sense, as it is unconditionally checked. In main code, does it make sense to use a check that is not guaranteed to run? I would expect to see an