Replies: 4 comments 13 replies
-
For context, I believe, the discussion was mainly around the code in grails-core (and supported plugins). Going forward as committers to those repos, should we favor using var or def. I believe there are good points to be made for both usages. I don't remember there being talk of Groovy changing anything. So, I think, the poll above might be a bit misleading. Recently, similar chatter has come up about code formatting and standardization of styles but nothing has been committed to thus far. I look forward to more discussion here with the wider grails community. |
Beta Was this translation helpful? Give feedback.
-
This really doesn't even remotely represent the original discussion. There was no proposal to change how |
Beta Was this translation helpful? Give feedback.
-
What is the point of the poll? to make a subjective decision? You are forcing people to agree with reasoning by making a choice. I would not vote for either of those options as I don't agree with either of those statements. I recommend if you are going to conduct a poll, you provide options without forcing reasoning or personal opinion behind them. You should also provide options that account for all possible scenarios. Like only use Books and old documentation is not a reason for keeping the status quo. Should I not use The whole point of the original discussion in the meeting was writing code in a manner that is best understood to the widest audience. At no point did anyone say go do a search and replace for every Don't get me wrong, I appreciate your involvement and the passion for the language. We just need to be mindful on what the best pathway forward is to attracting new involvement. This wouldn't even be a discussion it there was an overwhelming number of people contributing to Grails, but there isn't. I am one of a few number of people actively contributing and that needs to change. If you want to submit PRs that utilize |
Beta Was this translation helpful? Give feedback.
-
A summary from ChatGpt: The discussion in this GitHub thread revolves around the potential for Groovy to support using
Community Response: Several contributors weigh in:
The Poll: gsartori creates a poll to gather community opinions, asking whether Groovy should promote Main Points of Contention:
In conclusion, the conversation is about whether Groovy should allow |
Beta Was this translation helpful? Give feedback.
-
At yesterday's meeting there was a quick discussion about using
var
instead ofdef
for local variables to follow what Java is doing with its newvar
"keyword not keyword".I haven't slept tonight LOL (I'm laughing at myself, cause that statement is true 😆).
These are my nightly thoughts:
def
to define variables and as return type on methods.def
in Groovy is an alias forObject
.def
to define variables and methods. Python lately become well known due to AI so I kind of guess thatdef
is not so alien anymore to developers (but yes, that's just speculation).var
with type inference on assignment. That triggered different opinions on Java developers, not all of them like the new feature.var
as an alternative to define variables to stay familiar with Java developers. It does not usevar
as a return type in methods.let
to fix the scope issue they have withvar
. That triggered different opinions on JavaScript developers, not all of them like the new feature. They understand the reason why, but they keep usingvar
cause in the end it's more expressive and they don't care much about scoping variables (that's not what I dediced to do with Dueuno Elements but that's my personal opinion based on random talks with my friends).I loved Python and at the same time I love the nature of Groovy of being familiar to java developers. So I like both
def
andvar
. I would be the first one to find/replacedef
->var
in Dueuno Elements if that would work out of the box. But it doesn't.What I don't like is using both of them:
var
for variables anddef
for methods (like in Grails controllers !!).7 votes ·
Beta Was this translation helpful? Give feedback.
All reactions