-
Notifications
You must be signed in to change notification settings - Fork 23
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
[RFC?] Redesign commands #224
Comments
What's the use of the |
Instead of returning a proper |
That appears to be a really bad idea to me. |
Could always use |
Could always expect programmers to be able to use |
Returning a valid value on out of bounds without changing |
No, this clearly breaks the contract of |
With |
Maybe, but not as the main API, it should have |
Should |
@SoniEx2 semantics, return a Collections.immutableList view of it. |
@RX14 why? |
Why not? |
@RX14 Well idk but why should |
Because they are in reality immutable, you run the command with arguments, and you can't retroactively change what the user meant. |
@RX14 Technically, you're given an |
Technically, you're wrong. |
@RX14 Why limit the user? |
because it's the true state of the world that you cannot retroactively change the arguments the user passed into a command. That's time travel and pretending otherwise has no benefits and doesn't show the true state of the user interaction. |
@RX14 Everything is mutable if you put enough hacks into it. And you might want to pass the |
@SoniEx2 I have explaied why multiple times, and I'm pretty sure the other developers will agree with me that having Args be mutable "feels wrong". You can construct your own Args objects with your own list. |
I agree with having Args be immutable. |
Should there be a |
I'm not sure the purpose of a CommandFactory other than to waste my RAM? |
Current idea:
Questions:
asString
?as
take anyClass
, and if there's no converter for it then cause a runtime error? (This seems like bad API design, but it'd let you pass inString.class
)Args.asList()
return the backing list, or should it return a copy of the backing list? Should we wrap the backing list such that it doesn't acceptnull
?Collection
?The text was updated successfully, but these errors were encountered: