From: "Eregon (Benoit Daloze)" Date: 2022-07-29T17:54:23+00:00 Subject: [ruby-core:109374] [Ruby master Feature#18930] Officially deprecate class variables Issue #18930 has been updated by Eregon (Benoit Daloze). @shan Agreed. If we are not yet ready to deprecate them, could we at least discourage them in official docs? @byroot: > Yes that's what I say in my comment, and I see how some users may find this unsatisfactory. I think it is a very small inconvenience, which seems to me much less important than many people getting confused and getting bugs due to the near-impossible-to-understand semantics of class variables in Ruby. > I know it's a big ask, but I really feel a better solution would be to introduce true class variables with an usable semantic (like Python). I would be fine with that, but the last time I tried something like that it was rejected: #14541. ---------------------------------------- Feature #18930: Officially deprecate class variables https://bugs.ruby-lang.org/issues/18930#change-98523 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal ---------------------------------------- Ruby's class variables are very confusing, and it seem many people agree they should be avoided (#18927). How about we deprecate them officially? Concretely: * Mention in the documentation that class variables are deprecated and should be avoided/should not be used. * Add a parse-time deprecation warning, now that we only see those with `Warning[:deprecation] = true` it seems reasonable to add. -- https://bugs.ruby-lang.org/ Unsubscribe: