-
Notifications
You must be signed in to change notification settings - Fork 279
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusion with symbols and strings #699
Comments
I agree in principle. Since I'm going to go over part of the config, how about I pick some of that up as well? That way we can avoid another big bang change. I would also like to get rid of constants used just for config keys. I much prefer using the literal symbol instead (not so much literal strings, though). Hm, I'm thinking if we force keys to symbols from the config, we will have to update the keys in the smell classes everywhere as well. So, we will have to do this all in one go anyway. |
What part are you referring to?
Yes, please.
Yep, this will be a bigger change for sure. But after that we can finally rely on symbols which will increase my productivity about 2000% ;) |
#694. |
Ah, ok, makes sense ;) |
I’m all for symbols as keys everywhere, provided we keep the string keys in read/written YAML files (we have to do it for backwards compatibility anyway). Symbol keys in YAML files are way less nice than string keys, but I’m for turning them to symbols upon reading. I don’t think we should care about symbols not being gc’d in Ruby < 2.2, as I don’t see any reasonable vectors of attack (a malicious reek config taking down a bigger tool using reek…?). |
I always assumed that was the idea, yes. |
It was! ;) |
I'll look into this since I believe it is vital for Reeks future to get this right. |
@mvz still assigned to you - do you think you'll take care of this any time soon? If not, I'd volunteer to take over. |
@troessner feel free to take over. |
I'd like to back-pedal on this one big time. While waiting for the as-usual-fucking-late-flight I started looking into this and this would be a huge refactoring that would touch literally half of Reeks source files and tests. How about approaching this differently. What we are striving for is not necessarily that all-the-things are symbols but consistency. How about this simple rule of thumb: Everything that is coming from "outside" is a string and will be treated as string everywhere.
If we agree on this rule the current set up is consistent as it is right now. WDYT? |
The one thing I would really like to get rid of is all the |
On not making a change that hits every file: 👍. |
Wild TEAM LEAD appeared.
The technical merit for this is sound. Downside is it resists programmatic enforcement--and education is at least one order of magnitude more expensive than programmatic enforcement. That said, if this has worked reasonably well so far, I am sure it is a price that can be paid. 😊 |
@Drenmi we're basically only talking about hash keys here, and the choice is limited to strings or symbols. Not much enforcement either way. There are configuration objects, but that's another story. |
Fully agree with that in general. Big factor is with how many conventions like this you have to juggle at the same time. I think this is still manageable. |
My æsthetic is to go with symbol keys, but I agree it’s not worth doing at the moment, especially when we haven’t had an actual issue with this so far – so +1 for sticking to the current situation and reopening if needed. |
Ok, seems like we have an agreement to leave it like it is, closing this one. |
Right now we're mixing them everywhere unfortunately which is confusing and error-prone.
Suggestion:
WDYT?
The text was updated successfully, but these errors were encountered: