You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2009/04/13 17:47:14 UTC

[jira] Created: (THRIFT-455) Compiler flag to make optiona/required field modifiers compulsory

Compiler flag to make optiona/required field modifiers compulsory
-----------------------------------------------------------------

                 Key: THRIFT-455
                 URL: https://issues.apache.org/jira/browse/THRIFT-455
             Project: Thrift
          Issue Type: New Feature
          Components: Compiler (General)
            Reporter: Bryan Duxbury


if we are unwilling to globally require users specify "required" or "optional" when creating their structs, I think we should at least add a command line switch that causes us to enforce that behavior. It would certainly make my implementations more reliable, especially when I'm giving non-experts the tools to make their own IDLs.

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


[jira] Updated: (THRIFT-455) Compiler flag to make optional/required field modifiers compulsory

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-455:
---------------------------------

    Summary: Compiler flag to make optional/required field modifiers compulsory  (was: Compiler flag to make optiona/required field modifiers compulsory)

> Compiler flag to make optional/required field modifiers compulsory
> ------------------------------------------------------------------
>
>                 Key: THRIFT-455
>                 URL: https://issues.apache.org/jira/browse/THRIFT-455
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>            Reporter: Bryan Duxbury
>
> if we are unwilling to globally require users specify "required" or "optional" when creating their structs, I think we should at least add a command line switch that causes us to enforce that behavior. It would certainly make my implementations more reliable, especially when I'm giving non-experts the tools to make their own IDLs.

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


[jira] Commented: (THRIFT-455) Compiler flag to make optiona/required field modifiers compulsory

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698556#action_12698556 ] 

David Reiss commented on THRIFT-455:
------------------------------------

What about the current default behavior, where fields are assumed present in C++, but not required when reading?

> Compiler flag to make optiona/required field modifiers compulsory
> -----------------------------------------------------------------
>
>                 Key: THRIFT-455
>                 URL: https://issues.apache.org/jira/browse/THRIFT-455
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>            Reporter: Bryan Duxbury
>
> if we are unwilling to globally require users specify "required" or "optional" when creating their structs, I think we should at least add a command line switch that causes us to enforce that behavior. It would certainly make my implementations more reliable, especially when I'm giving non-experts the tools to make their own IDLs.

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


[jira] Commented: (THRIFT-455) Compiler flag to make optional/required field modifiers compulsory

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698561#action_12698561 ] 

Bryan Duxbury commented on THRIFT-455:
--------------------------------------

I think that we should make a name for the "default" status if we intend to keep it so that it's a clear state.

> Compiler flag to make optional/required field modifiers compulsory
> ------------------------------------------------------------------
>
>                 Key: THRIFT-455
>                 URL: https://issues.apache.org/jira/browse/THRIFT-455
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>            Reporter: Bryan Duxbury
>
> if we are unwilling to globally require users specify "required" or "optional" when creating their structs, I think we should at least add a command line switch that causes us to enforce that behavior. It would certainly make my implementations more reliable, especially when I'm giving non-experts the tools to make their own IDLs.

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


[jira] Commented: (THRIFT-455) Compiler flag to make optional/required field modifiers compulsory

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743259#action_12743259 ] 

Bryan Duxbury commented on THRIFT-455:
--------------------------------------

I agree with Jonathan here. "default" is confusing, and I'd love to get rid of it.

> Compiler flag to make optional/required field modifiers compulsory
> ------------------------------------------------------------------
>
>                 Key: THRIFT-455
>                 URL: https://issues.apache.org/jira/browse/THRIFT-455
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>            Reporter: Bryan Duxbury
>
> if we are unwilling to globally require users specify "required" or "optional" when creating their structs, I think we should at least add a command line switch that causes us to enforce that behavior. It would certainly make my implementations more reliable, especially when I'm giving non-experts the tools to make their own IDLs.

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


[jira] Commented: (THRIFT-455) Compiler flag to make optional/required field modifiers compulsory

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743231#action_12743231 ] 

Jonathan Ellis commented on THRIFT-455:
---------------------------------------

> fields are assumed present in C++, but not required when reading

I have no idea what this means, but having fields that are neither required nor optional and get special cased differently in different places of the code is broken.

If you really want to have 3 states then 2 of them should not be called "required" and "optional" because common sense implies that if a field is not one it must be the other.

> Compiler flag to make optional/required field modifiers compulsory
> ------------------------------------------------------------------
>
>                 Key: THRIFT-455
>                 URL: https://issues.apache.org/jira/browse/THRIFT-455
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>            Reporter: Bryan Duxbury
>
> if we are unwilling to globally require users specify "required" or "optional" when creating their structs, I think we should at least add a command line switch that causes us to enforce that behavior. It would certainly make my implementations more reliable, especially when I'm giving non-experts the tools to make their own IDLs.

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


[jira] Commented: (THRIFT-455) Compiler flag to make optional/required field modifiers compulsory

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743309#action_12743309 ] 

David Reiss commented on THRIFT-455:
------------------------------------

That is not going to happen.  In C++, optional fields require applications to manually set __isset fields, otherwise they are not serialized on writing.  Required fields throw an exception if they are absent.  The default has neither of these issues.  It is the most sensible choice when working with C++.  I'd be okay with renaming optional, though.  A few days ago, I was thinking about how to implement annotations for fields.  We could move optional and required to an annotation.

> Compiler flag to make optional/required field modifiers compulsory
> ------------------------------------------------------------------
>
>                 Key: THRIFT-455
>                 URL: https://issues.apache.org/jira/browse/THRIFT-455
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>            Reporter: Bryan Duxbury
>
> if we are unwilling to globally require users specify "required" or "optional" when creating their structs, I think we should at least add a command line switch that causes us to enforce that behavior. It would certainly make my implementations more reliable, especially when I'm giving non-experts the tools to make their own IDLs.

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