You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Thanks - that app's looking like it's coming together well!

    Documentation is definitely a weak point

    Again, it's a matter of lacking time. I think the actual built-in function reference is ok (maybe not the rendering, but the data itself) - and we create that from comments in the code so it's always up to date.

    But if you see somewhere where documentation could be improved, please do create a PR for it. Espruino only exists in the state it is at the moment because many people contribute to it - and documentation is something that almost anyone can do, and it is hugely helpful for everyone.

    I think right now there's also a big problem of actually finding information - there's quite a lot of documentation, but making it so that users find it and read it when they need to is a big problem.

    But...

    I would definitely use the documentation to nudge people to use small modular functions over single large code chunks

    It's more complicated than that. GC does work as you'd expect, but function code (unless you explicitly mark it not to be) is kept in flash and is executed direct from there. The thing that takes RAM is the function declaration (which references arguments and where in storage the code is).

    So actually having bigger functions, and defining the functions you need inside those is probably preferable, as it reduces RAM but also the amount of vars/functions that are defined at one time.

    So it's important not to point people into doing what you believe is correct/optimal, without actually having tested it first.

About

Avatar for Gordon @Gordon started