Replies: 4 comments 6 replies
-
It is already too late to make breaking changes. We shall either do v2 and break stuff with also adding a lot of other features such as the permission api and other platforms support or leave it as is. There's no middle point. |
Beta Was this translation helpful? Give feedback.
-
Rough decision, the api will take a hard hit in the short term but will probably be the best on the long term. Just seeing your example makes it obvious. The idea is to minimise the bloat but we failed, we should correct our mistakes. Don't put me on yes/no yet |
Beta Was this translation helpful? Give feedback.
-
Honestly the only reason the Subscriber model exists is because you thought futures were too complicated - this was a less complex (to understand, not to write!) alternative. My thoughts on this were expressed pretty extensively in the PR for this (here, for instance: #37 (comment)). Futures are cleaner, but they make it easier for inexperienced developers to write low quality code. I wouldn't mind overloads (I know we had discussed and decided against them) but I do feel like the explicit failure handling and lack of ability to block the main thread for a return value are both important for making Treasury beginner-friendly. Personally I think for advanced developers Futures are a better approach. The subscriber model was purely for accessibility and correct adoption of Treasury. |
Beta Was this translation helpful? Give feedback.
-
For future viewers, a resolution seems to have been made: in v2 we will be making a breaking change which switches to CFs as the standard rather than Subs. |
Beta Was this translation helpful? Give feedback.
-
Current votes:
Problem: Subscription Model
Treasury has been out for a little over 3 weeks now. I have noticed the difficulty that developers face when they try to use our subscription model.
Ivan and I developed a simple 'set balance' method that would be commonly used, using both the subscription model and the Future model. The Future variant had 64% less lines of code, yet looked far cleaner, flowed better, and is much easier to maintain.
View Future code
(32 lines)
View Subscription code
(89 lines, harder to follow, 'bloated' looking, harder to maintain)
The entire purpose of the subscription system being the default was with the intention that it was easier to use. In fact, turns out it's harder to use, almost everyone will prefer the Future variant.
I propose that we make the methods use CompletableFutures by default. We could keep the subscription as an optional conversion if a developer does prefer using it, otherwise we could remove it entirely.
(Note: Nobody who worked on the Subscription system is at fault - we democratically decided to use it, without understanding the current realization of this outcome.)
Tagging users who may be interested: @MrIvanPlays @Jikoo @MrNemo64 @yannicklamprecht @creatorfromhell
Beta Was this translation helpful? Give feedback.
All reactions