[jira] [Commented] (THRIFT-3799) Make constants to use iota
[ https://issues.apache.org/jira/browse/THRIFT-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15953732#comment-15953732 ] ASF GitHub Bot commented on THRIFT-3799: Github user astromahi closed the pull request at: https://github.com/apache/thrift/pull/995 > Make constants to use iota > -- > > Key: THRIFT-3799 > URL: https://issues.apache.org/jira/browse/THRIFT-3799 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Mahendran Kathirvel >Priority: Minor > Labels: easyfix > Original Estimate: 24h > Remaining Estimate: 24h > > Now, the constants and enumerations are using hardcoded values but Go has a > elegant way of doing this by using `Iota` -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (THRIFT-3799) Make constants to use iota
[ https://issues.apache.org/jira/browse/THRIFT-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15952506#comment-15952506 ] ASF GitHub Bot commented on THRIFT-3799: Github user jeking3 commented on the issue: https://github.com/apache/thrift/pull/995 @jfarrell please close this pull request as it was rejected last year. Thanks. > Make constants to use iota > -- > > Key: THRIFT-3799 > URL: https://issues.apache.org/jira/browse/THRIFT-3799 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Mahendran Kathirvel >Priority: Minor > Labels: easyfix > Original Estimate: 24h > Remaining Estimate: 24h > > Now, the constants and enumerations are using hardcoded values but Go has a > elegant way of doing this by using `Iota` -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (THRIFT-3799) Make constants to use iota
[ https://issues.apache.org/jira/browse/THRIFT-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15344427#comment-15344427 ] Chris Bannister commented on THRIFT-3799: - I would say this is not a good idea, and is not idiomatic Go. Using iota is for when the value does not matter, but in the case of thrift the value does matter so iota should not be used. It does not effect the code but makes it clear that the value of the enum is a specific value. > Make constants to use iota > -- > > Key: THRIFT-3799 > URL: https://issues.apache.org/jira/browse/THRIFT-3799 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Mahendran Kathirvel >Priority: Minor > Labels: easyfix > Original Estimate: 24h > Remaining Estimate: 24h > > Now, the constants and enumerations are using hardcoded values but Go has a > elegant way of doing this by using `Iota` -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3799) Make constants to use iota
[ https://issues.apache.org/jira/browse/THRIFT-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15264073#comment-15264073 ] Mahendran Kathirvel commented on THRIFT-3799: - Alright, thanks Jens for your time, Yes, I can write test cases for the changes I made, If you would like. I am newbie here. May be I get some suggestion from you otherwise. > Make constants to use iota > -- > > Key: THRIFT-3799 > URL: https://issues.apache.org/jira/browse/THRIFT-3799 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Mahendran Kathirvel >Priority: Minor > Labels: easyfix > Original Estimate: 24h > Remaining Estimate: 24h > > Now, the constants and enumerations are using hardcoded values but Go has a > elegant way of doing this by using `Iota` -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3799) Make constants to use iota
[ https://issues.apache.org/jira/browse/THRIFT-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15264023#comment-15264023 ] Jens Geyer commented on THRIFT-3799: > understand what you mean but I don't see any risk in here. I do. > to be initialised while keeping "their value" same Today. You need only one additional value in between of existing ones to screw things up. Even if this is a small risk, the "elegance" and "idiomatic go" and "everyone does it this way these days" gained from it is not enough to outweight that risk. > The 'Go' community encourages to use `iota` declaration Encourages does not read "anything else is wrong2. It's just a recommendation. We don't have to follow blindy like the lemmings. > Alright, let me write the test cases for the changes Honestly? > Make constants to use iota > -- > > Key: THRIFT-3799 > URL: https://issues.apache.org/jira/browse/THRIFT-3799 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Mahendran Kathirvel >Priority: Minor > Labels: easyfix > Original Estimate: 24h > Remaining Estimate: 24h > > Now, the constants and enumerations are using hardcoded values but Go has a > elegant way of doing this by using `Iota` -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3799) Make constants to use iota
[ https://issues.apache.org/jira/browse/THRIFT-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15263853#comment-15263853 ] Mahendran Kathirvel commented on THRIFT-3799: - Thanks Jens, I understand what you mean but I don't see any risk in here. we just changed the way constants to be initialised while keeping "their value" same. The 'Go' community encourages to use `iota` declaration than manual. It's not only elegant but the way to declare constants. Alright, let me write the test cases for the changes. > Make constants to use iota > -- > > Key: THRIFT-3799 > URL: https://issues.apache.org/jira/browse/THRIFT-3799 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Mahendran Kathirvel >Priority: Minor > Labels: easyfix > Original Estimate: 24h > Remaining Estimate: 24h > > Now, the constants and enumerations are using hardcoded values but Go has a > elegant way of doing this by using `Iota` -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3799) Make constants to use iota
[ https://issues.apache.org/jira/browse/THRIFT-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15263248#comment-15263248 ] Jens Geyer commented on THRIFT-3799: Sorry, but I'm against this patch. While it clearly does make the code elegant, we get this at the cost of the newly introduced risk of potential incomaptible behaviour. A good portion of these constants are used across languages, hence they are part of the implicit underlying Thrift API. So consequently, to make sure the values are correct we would at least need test cases for these, and that essentially would render the whole elegancy away. IMHO we should keep it as it is now. > Make constants to use iota > -- > > Key: THRIFT-3799 > URL: https://issues.apache.org/jira/browse/THRIFT-3799 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Mahendran Kathirvel >Priority: Minor > Labels: easyfix > Original Estimate: 24h > Remaining Estimate: 24h > > Now, the constants and enumerations are using hardcoded values but Go has a > elegant way of doing this by using `Iota` -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3799) Make constants to use iota
[ https://issues.apache.org/jira/browse/THRIFT-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15260015#comment-15260015 ] ASF GitHub Bot commented on THRIFT-3799: GitHub user astromahi opened a pull request: https://github.com/apache/thrift/pull/995 THRIFT-3799 Make constants to use iota https://issues.apache.org/jira/browse/THRIFT-3799 Converted constant declaration to use `iota` construct rather than manually specifying value. You can merge this pull request into a Git repository by running: $ git pull https://github.com/astromahi/thrift THRIFT-3799 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/995.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #995 commit 370d51180be2af520a4c2a3a7fddf4a44a43e0e7 Author: Mahendran KathirvelDate: 2016-04-27T11:54:31Z THRIFT-3799 Make constants to use iota > Make constants to use iota > -- > > Key: THRIFT-3799 > URL: https://issues.apache.org/jira/browse/THRIFT-3799 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Mahendran Kathirvel >Priority: Minor > Labels: mentor, newbie > Original Estimate: 24h > Remaining Estimate: 24h > > Now, the constants and enumerations are using hardcoded values but Go has a > elegant way of doing this by using `Iota` -- This message was sent by Atlassian JIRA (v6.3.4#6332)