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/27 13:18:59 UTC
[jira] Created: (MAHOUT-189) Standardize use of assert keyword
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
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.
[jira] Commented: (MAHOUT-189) Standardize use of assert keyword
Posted by "Ted Dunning (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MAHOUT-189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12770520#action_12770520 ]
Ted Dunning commented on MAHOUT-189:
------------------------------------
+1
Since asserts are almost always disabled, I view them mostly as fancy comments.
> 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
>
>
> 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.
[jira] Work started: (MAHOUT-189) Standardize use of assert keyword
Posted by "Sean Owen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MAHOUT-189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on MAHOUT-189 started by Sean Owen.
> 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.
[jira] Updated: (MAHOUT-189) Standardize use of assert keyword
Posted by "Sean Owen (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Resolved: (MAHOUT-189) Standardize use of assert keyword
Posted by "Sean Owen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MAHOUT-189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sean Owen resolved MAHOUT-189.
------------------------------
Resolution: Fixed
> 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.