Thanks @allObjects for the insights.
I will try to understand what you were saying and refactor my code a bit.
It seems there were a fews ways of doing OOP in Javascript for some historical reasons, but it is hard to find the "right" just for the Espruino world since there are not many examples here.
Most of the code snippets here are just simple and short and just do everything globally.
I felt like having some things encapsulated, so this it what I ended up with.
Minification is a thing to try, but I was worried about possible error messages and not being able to track them back to their source.
Actually after one session when everything froze I had a syntax error in my ErrorLog object:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thanks @allObjects for the insights.
I will try to understand what you were saying and refactor my code a bit.
It seems there were a fews ways of doing OOP in Javascript for some historical reasons, but it is hard to find the "right" just for the Espruino world since there are not many examples here.
Most of the code snippets here are just simple and short and just do everything globally.
I felt like having some things encapsulated, so this it what I ended up with.
Minification is a thing to try, but I was worried about possible error messages and not being able to track them back to their source.
Actually after one session when everything froze I had a syntax error in my
ErrorLog
object:Any idea about that?
The code had no errors when it was uploaded. May it have changed itself?
Memory issues?