-
Notifications
You must be signed in to change notification settings - Fork 4
Refactor #76
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
Conversation
…eporter, make HealthManager work for things other than Inputs
… getNestedReplacement to use VarStatement to preserve invariance, adds FieldDoesNotExistException
…, fix handling of replacement being null
…ens and statements
… remove wildcard destructuring support in loops, add test environment for fuzzing
… with TemplateLexer
I can give a bit of an update to the sections about classifying the code by "safety": My solution to that would be to relatively frequently try-catch at points where we would definitely would want to stop any exception, even if no exceptions are specified in the called functions! |
I want to pretty majorly refactor the current bot.
The main goal is to improve stability and increase the ability to reason about the bot as a system, and to remove some features that were prototyped already but are now dropped.
How this should be done is via organising the code based on how 'safe' it is.
More flaky code goes into a special folder, and gets an API that clearly states all the failure conditions. I think something like this necessary because a lot of the Java ecosystem has hidden failure modes (most often RuntimeExceptions) and protecting yourself against all of these hidden failures everywhere is hardly possible.
So the idea is to put all of this flaky code with hidden failure modes in one place, and only export safe (with all failure modes clearly stated) API's to the rest of the application.
The benefit is that you can reduce the mental load because you have one place where you really need to focus on what you are doing, and if there are any additional failure modes. This idea draws inspiration from Rust's unsafe {} block.
I don't think we will be able to eliminate all unexpected behaviour, but I think we should be able to reduce it, and make it easier to find the issue.
This special directory would also include most IO code because it is inherently messy, and no specifications of outside parties should be fully trusted.
This split would also make it pretty easy to have different standards when it comes to testing. Testing IO code is significantly harder compared to a normal function, so you may need to make some compromises or use manual testing instead.
(I mean IO not on a low-level level but more generally as anything where we are interacting with something outside this application, like a database)
The following features will be removed: