Open Ant13731 opened 1 year ago
Welcome back @Ant13731. Great to hear from you! The double pendulum example should definitely benefit from the single pendulum example. The change you suggest makes sense to me. I wonder if we can go further? We don't really want the same code in two different places. Can we have the common parts of the code once and share between both examples? I believe that nopcm and swhs share code. We should do the same thing for our pendulum examples.
Hi all! It's been a while since I've looked through Drasil but I saw something in the most recent PR (#3479) that piqued my interest.
The underlying issue with the PR seemed really familiar to one of the first issues I worked on with SglPendulum (#2360) and I noticed there are some slight differences regarding the structure of chunks between the two examples. Now that both examples have had some time to mature, I think it would be beneficial for the lines listed below (and possibly other parts of the pendulum examples) to reach some level of parity. For example, in DblPendulum, this line:
https://github.com/JacquesCarette/Drasil/blob/7dea78cf8abe794160f2f3a29bd507f307a69b0a/code/drasil-example/sglpendulum/lib/Drasil/SglPendulum/Unitals.hs#L42
aligns with this line in SglPendulum:
https://github.com/JacquesCarette/Drasil/blob/42281e85aa09e277284c7e7cba78312773f56fa7/code/drasil-example/dblpendulum/lib/Drasil/DblPendulum/Unitals.hs#L59
So, we could change DblPendulum's
(cn "length of the rod")
to(len `ofThe` rod)
to better match up with the comparable line in SglPendulum. This ensures we are making the most out of our existing chunks and reduces the chance of having duplicate strings.Something to think about for the future could be allowing more than one instance of a chunk. Or having something that could modify what the chunk writes to the SRS while having the underlying concept remain the same. So for double pendulum, we could reuse many of the same concepts by adding an identifier/label for each instance of a concept taken from single pendulum. In reality, I'm not sure how useful this would be (and maybe Drasil has something that does this already - apologies, my knowledge is a bit rusty), but it could allow some of our examples to be more extensible.
Anyways, looks like there's some really good progress being made! I'm excited for Drasil's future! 😄