Comments (2)
Thanks! I think if we want to keep using that feature, we should probably run tests with and without it in CI.
from gdext.
Originally the intention of convenience
(possibly to be renamed as yolo
😀) was that someone who wants to be aware of fallible operations can disable that feature and the number of panicking functions will be drastically reduced.
That said, I'm not sure if there are people truly wishing for that or if it's something we want to encourage as a best practice, as it has two notable downsides:
- Verbosity of code that never fails due to external invariants.
- E.g. scene tree has a certain structure, so getting a node of a given name/type must succeed or it's a bug.
- If I know the value on GDScript side fits into a
u8
, thento_variant()
must succeed or it's a bug.
- Worse error messages.
- People tend to use
unwrap()
orexpect("literal")
, which lacks context information. get_node_as::<T>("path")
on the other hand can include a precise panic message, e.g. "there is a node at pathpath
with typeU
, but typeT
was requested".
- People tend to use
Maybe I'll remove this feature but keep the commented-out #[cfg]
statements around in case we want to re-introduce it later. Keeping it may add quite some maintenance overhead which is probably not justifiable at this stage of the library.
from gdext.
Related Issues (20)
- Back trace in `handle_panic_with_print` HOT 1
- Docs.rs shows "The requested resource does not exist" HOT 1
- Discussion: Integrating directly into Godot HOT 16
- `@rpc` support and examples HOT 14
- `impl Export for PackedScene`? HOT 2
- [Feature Request] Consider adding a feature flag for enhanced determinism option of glam HOT 10
- [Performance Issue] Array methods duplicate Variant param or Callable take ownership when it could not. HOT 3
- [Performance Issue] Extra calls to std::write HOT 3
- [Performance Issue] Unneeded calls to class_name::to_string_name HOT 1
- [Performance Issue] The godot ffi layer is a bottleneck for my use cases HOT 7
- api discomfort: `MultiplayerApi.set_multiplayer_peer()` requires manual upcast
- How to use signals between GDScript and Rust? HOT 3
- `Array<T>` can hold values that are invalid representations of `T` HOT 4
- Docs comments do not show up if only some of the class members/methods are documented
- Docs comments do not follow usual markdown newline rules HOT 4
- Broken link in godot-core in ExtensionLibrary documentation HOT 1
- Unable to get auto completion on node classes HOT 5
- A class that inherits from Button , displayed as Node ? HOT 1
- Implementing `EditorExportPlugin::export_file` causes compile error due to macro generating a parameter named `type` HOT 1
- `Key` type makes `KeyMask | Key` combinations impossible without `.call()` hacks HOT 3
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 gdext.