|
2 | 2 | draft: false |
3 | 3 | date: 2023-08-17 |
4 | 4 | categories: |
5 | | - - chorus |
6 | | - - updates |
| 5 | + - chorus |
| 6 | + - updates |
7 | 7 | authors: |
8 | | - - bitfl0wer |
| 8 | + - bitfl0wer |
9 | 9 | --- |
10 | 10 |
|
11 | | -# Self-updating structs, moving blog posts to GitHub, and more! |
| 11 | +# Self-updating structs, moving blog posts to GitHub, and more |
12 | 12 |
|
13 | | -Introducing self-updating structs, explaining how they work, and what they are good for. Also, moving blog posts to GitHub, and other improvements. |
| 13 | +Introducing self-updating structs, explaining how they work, and what they are good for. Also, |
| 14 | +moving blog posts to GitHub, and other improvements. |
14 | 15 |
|
15 | | -{/* truncate */} |
| 16 | +{/_ truncate _/} |
16 | 17 |
|
17 | | -It has been a while since the last update post - 1 month to be precise! I haven't gotten around to writing one of these, mostly because of personal time- and energy constraints. However, now that these resources are finally replenishing again, I figured that it is once again time! |
| 18 | +It has been a while since the last update post - 1 month to be precise! I haven't gotten around to |
| 19 | +writing one of these, mostly because of personal time- and energy constraints. However, now that |
| 20 | +these resources are finally replenishing again, I figured that it is once again time! |
18 | 21 |
|
19 | 22 | ## Moving Blog Posts to GitHub |
20 | 23 |
|
21 | | -This is a pretty self-explanatory point. I thought, that opencollective would find more use by me and other polyphony-curious folk, however, this didn't go as planned. Also, opencollective made their Discord embeds really poopy, which is why I am moving all the blog posts over to GitHub. |
| 24 | +This is a pretty self-explanatory point. I thought, that opencollective would find more use by me |
| 25 | +and other polyphony-curious folk, however, this didn't go as planned. Also, opencollective made |
| 26 | +their Discord embeds really poopy, which is why I am moving all the blog posts over to GitHub. |
22 | 27 |
|
23 | 28 | ## A big one: Self-updating structs |
24 | 29 |
|
25 | | -Ideally, you want entities like Channels, Guilds, or Users to react to Gateway events. A Gateway event is basically a message from Spacebar/Discord to you, which says: "Hey, User `x` has changed their name to `y`!". If you can reflect those changes immediately within your code, you save yourself from having to make a lot of requests and potentially getting rate-limited. |
| 30 | +Ideally, you want entities like Channels, Guilds, or Users to react to Gateway events. A Gateway |
| 31 | +event is basically a message from Spacebar/Discord to you, which says: "Hey, User `x` has changed |
| 32 | +their name to `y`!". If you can reflect those changes immediately within your code, you save |
| 33 | +yourself from having to make a lot of requests and potentially getting rate-limited. |
26 | 34 |
|
27 | | -This is exactly what Self-updating structs set out to solve. The first implementation was done by @SpecificProtagonist and me (thank you a lot again, btw) on the 21st of July. However: This implementation, being in its' infancy, has had some design flaws, which to me made pretty clear, that this whole thing needed to be thought through a little better. |
| 35 | +This is exactly what Self-updating structs set out to solve. The first implementation was done by |
| 36 | +@SpecificProtagonist and me (thank you a lot again, btw) on the 21st of July. However: This |
| 37 | +implementation, being in its' infancy, has had some design flaws, which to me made pretty clear, |
| 38 | +that this whole thing needed to be thought through a little better. |
28 | 39 |
|
29 | | -The second iteration of these Self-updating structs was finished... today, actually, by me. It saves memory compared to the first iteration by storing unique objects only once, instead of `n = how many times they are being referenced`-times. While this way of doing things is really efficient, it also has been a pain in the ass to make, which is precisely the reason why this took me so long. I've learned a lot along the way though. |
| 40 | +The second iteration of these Self-updating structs was finished... today, actually, by me. It saves |
| 41 | +memory compared to the first iteration by storing unique objects only once, instead of |
| 42 | +`n = how many times they are being referenced`-times. While this way of doing things is really |
| 43 | +efficient, it also has been a pain in the ass to make, which is precisely the reason why this took |
| 44 | +me so long. I've learned a lot along the way though. |
30 | 45 |
|
31 | | -The public API has also gotten a *lot* better in "v2". This is mostly because I am a big believer in writing tests for your code, and through writing what are essentialy real-world-simulation-examples, I noticed how repetitive or stupid some things were, and thus could improve upon them. |
| 46 | +The public API has also gotten a _lot_ better in "v2". This is mostly because I am a big believer in |
| 47 | +writing tests for your code, and through writing what are essentialy real-world-simulation-examples, |
| 48 | +I noticed how repetitive or stupid some things were, and thus could improve upon them. |
32 | 49 |
|
33 | | -Having this whole thing finished is a big relief. This self-updating thing is an essential feature for any Discord/Spacebar compatible library, and I think that we implemented it very nicely. |
| 50 | +Having this whole thing finished is a big relief. This self-updating thing is an essential feature |
| 51 | +for any Discord/Spacebar compatible library, and I think that we implemented it very nicely. |
34 | 52 |
|
35 | 53 | ## Documentation and other improvements |
36 | 54 |
|
37 | | -@kozabrada123 took it upon himself to re-write a lot of the codes' Documentation. Thanks for that! This will massively improve the ease of use of this library - both when developing *for* and *with* it. koza also improved our CI/CT pipeline by incorporating build-caching into it, which speeds up builds. |
| 55 | +@kozabrada123 took it upon himself to re-write a lot of the codes' Documentation. Thanks for that! |
| 56 | +This will massively improve the ease of use of this library - both when developing _for_ and _with_ |
| 57 | +it. koza also improved our CI/CT pipeline by incorporating build-caching into it, which speeds up |
| 58 | +builds. |
38 | 59 |
|
39 | 60 | This has been the last month of Polyphony. In the coming weeks, I will be working on |
| 61 | + |
40 | 62 | - Implementing self-updating-struct behavior for every struct which needs it |
41 | 63 | - Fixing bugs |
42 | 64 | - Adding more features, like emojis, 2FA, Guild Settings, etc.! |
|
0 commit comments