bitcoindevkit / bdk-ffi

Please consider this project *experimental*. But we hope to have an official release out soon.
Other
85 stars 37 forks source link

Consider creating `examples` directories for JVM and Swift libraries #563

Open thunderbiscuit opened 2 weeks ago

thunderbiscuit commented 2 weeks ago

I was looking at some of those examples directories in Rust projects and it occurred to me that Kotlin libraries do that as well. After asking ChatGPT, it appears that Swift libraries also sometimes include those types of directories (they call them Samples instead? to be confirmed).

I wonder if this might be a better way to showcase how to use the library than the tests. Our current tests basically do work as examples and it's very much how we use them (they're full of print statements and complete workflows rather than simple tests of APIs).

Just a thought. We could also of course run the examples as part of our CI runs.

ItoroD commented 2 weeks ago

I think its a great idea to have examples. Having examples also gives room to explain what we are trying to show (via comments) and gives a direct place for a user to go and look at how to use stuff.

Call me Flintstone, but tests aren't the first place I go to to check out how to use a lib.