[ 
https://issues.apache.org/jira/browse/THRIFT-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776742#action_12776742
 ] 

David Reiss commented on THRIFT-623:
------------------------------------

bq. What would you think about renaming Fields to _Fields?  I think it would be 
good to use leading underscores [...]

bq. However, your proposal was to put the underscore at the end.

Um...

bq. Personally I just don't like putting an underscore on a name that actually 
is exposed to the user. Usually you only use that stuff internally.

I agree, but in my mind the ugliness of ad-hoc reserved words trumps the 
ugliness of a leading underscore.

> Use a Java enum to represent field ids in generated structs
> -----------------------------------------------------------
>
>                 Key: THRIFT-623
>                 URL: https://issues.apache.org/jira/browse/THRIFT-623
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.2
>
>         Attachments: thrift-623-v2.patch, thrift-623.patch
>
>
> The way things work today, field IDs get constants in their structs, but all 
> the methods take ints as parameters when they actually want a field id. This 
> is not the best, since it can lead to accidentally putting in field ids that 
> don't exist, and we have to do extra work to make sure things behave 
> correctly.
> Instead, we should make the field IDs into a proper Java enum class, and make 
> the methods take that class as the parameter type. That way, we'll get the 
> compiler's help enforcing our use of only legal field IDs, plus easier 
> association with name info, docstrings, etc. All in all, it should amount to 
> a usability improvement.

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

Reply via email to