Yes, but there still would be lots of repetitions even in short-form. Maybe I can write an own article soon about possible refactorings so that people can learn and compare. The original poster went with the simple if solution but there are multiple ways to make it shorter and easier to maintain.
These if statements could also be one-liners to save some more characters and space.
Yes, but there still would be lots of repetitions even in short-form. Maybe I can write an own article soon about possible refactorings so that people can learn and compare. The original poster went with the simple
if
solution but there are multiple ways to make it shorter and easier to maintain.Indeed.
Tell me where can I start a new discussion?
Just put a comment on the root of this article: dev.to/kaperskyguru/multiple-role-...