Comments (5)
Let's keep this open for a little longer - if no one uses the current methods, they can go; if people are using them (and want to continue using those instead of the new callX
versions) we can just keep them.
from if.
One counter-argument is that if plugins decide to throw exceptions in these callbacks, they should expect stuff to break. My response is that as long as the intermediate state these interrupts leave the IF library in are non-permanent, non-fatal (eg. they don't matter the next the click event is called), it's fine. But if that's not the case or if code ever gets added that might get badly hit by these uncaught exceptions problems arise. Catching them is a future-proof, guaranteed bug-free solution with little overhead (both code and runtime performance-wise) and you wouldn't have to worry/think about exceptions from callbacks at all in that case.
from if.
I'm assuming you then want the listed methods to be transformed into some kind of callX
method that automatically takes care of the exception handling? I'm fine with the changes to keep IF in a 'safe' state even if the user makes a Consumer
throw an Exception
, but I'm not certain if it's necessary to replace the current methods with these new ones or just keep both of them and internally always use the callX
version. After all, if the user calls their own exception throwing Consumer
retrieved from the getX
methods as you listed, that is, at that point, their problem. It depends on if these current methods are actually used by someone I suppose; if no one uses them, no point in keeping them.
from if.
I'm assuming you then want the listed methods to be transformed into some kind of callX method that automatically takes care of the exception handling?
Yes.
I'm not certain if it's necessary to replace the current methods with these new ones or just keep both of them and internally always use the callX version.
By replacing those getters, safety in the sense of exception handling would be enforced, there would be no way to make mistakes. Granted, this change helps the developers working on or looking at IF's code more than those who are just using it.
After all, if the user calls their own exception throwing Consumer retrieved from the getX methods as you listed, that is, at that point, their problem.
Good counterargument, but as you also said:
It depends on if these current methods are actually used by someone I suppose; if no one uses them, no point in keeping them.
Exactly. I personally don't think it would affect anyone at all, but that's just a wild guess.
from if.
I've gone through the dependents of this framework and from what I can find, none of them seem to be making use of the getX
methods, so replacing them with their equivalent callX
method should be fine.
from if.
Related Issues (20)
- Inventory GUIS don't sync the player inventory (1.19.4/1.20) HOT 1
- Crafting table Gui Not Getting Populated in (IF: 0.10.10 - 0.10.11) - (MC: 1.20 - 1.20.1) HOT 1
- MerchantGui not working on 1.20.1
- Hide pagination back on the first page and next on the last page HOT 1
- Calling Player#setItemOnCursor in Gui#setOnClose does not work HOT 1
- Raw index to coordinates HOT 3
- OutlinePane inside PaginatedPane doesn't register click event HOT 2
- Support Components from Adventure API HOT 1
- AnvilGui improvements HOT 4
- Profile name must not be null when trying to use Label Fonts HOT 4
- ToggleButtons dont work unless their coordinates are 0, 0 HOT 1
- Allow IF to be put in libraries block HOT 1
- Anvil GUI not working in MC 1.20.1 on v0.10.12 HOT 2
- AnvilGUI Not Working On 1.20.2 HOT 2
- Player leaving gui clears the gui for other player HOT 2
- 1.20.3/1.20.4 Support HOT 1
- Suggestion: Add callback function to Gui#update method HOT 1
- UnsupportedVersionException when using a StonecutterGui HOT 1
- Masonry Panes position is falsely applied twice -> location multiplied by 2 HOT 1
- IntelliJ plugin with GUI preview HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from if.