You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2009/10/30 11:56:59 UTC

[jira] Updated: (MAHOUT-189) Standardize use of assert keyword

     [ https://issues.apache.org/jira/browse/MAHOUT-189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Owen updated MAHOUT-189:
-----------------------------

    Attachment: MAHOUT-189.patch

> Standardize use of assert keyword
> ---------------------------------
>
>                 Key: MAHOUT-189
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-189
>             Project: Mahout
>          Issue Type: Improvement
>    Affects Versions: 0.2
>            Reporter: Sean Owen
>            Assignee: Sean Owen
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: MAHOUT-189.patch
>
>
> This is another one of my concept issues, and I'm posting this for discussion. It can be shot down or modified.
> I believe the assert keyword is for declaring conditions that can't be false in a bug-free program. They are checks that are enabled during development -- to find out when the program isn't bug-free! -- but disabled in production, for performance. Since, of course, they'll always be true right?
> So, in particular, they are never for checking arguments to a non-private method. I see a number of cases where asserts are used for argument checking. This is bad, since these checks will be disabled in production!
> If this is a reasonable position, then I volunteer to review all uses of assert and change many to some kind of if-statement plus IllegalArgumentException.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.