-
@allObjects you are absolutely right.
I used PHP for most of the time, and a bit of MySQL too. I did some Web/Frontend stuff too. JQuery mostly, but maybe lacked a deeper understanding of the Javascript language which was slightly changing over the years too.I also like it because it is so easy to try. And pretty fast too...
I will update my other Puck.js today to run the lap-simulation code and then run a thorough test again.
One last question:
Does it matter that the console still stays attached to the BLE service, even if there is no active connection?
Can this cause issues?
I would expect that any output or error occurring will be queued somewhere in RAM and flushed to the console once you reconnect to the BLE service some time later.
That's why I added theErrorLog
mechanism, but it lacks a proper stack trace.
Are there better ways?
@ChristianW, indeed... but that is what you get:
...with - I would call it - conceiving a brilliant language and implementation that can handle simple scripting as well as advanced application constructs. Sure, there are other very powerful languages out there with all their strength and hardship (weakness would be too easy to say it). If I need something to quickly try something out: the browser and html5 is my friend: I can do logic, I can do display, I can ui, I can single step debug with value setting... I do not need to compile... I do not need a separate ide... incredible. To pay the price for not being pure oo, not having interfaces, needing special stuff to do inheritance the easy way... JS is still good bet. Not for nothing took nodeJS off... against much 'older' stuff, like Python or so. Worked and still working with all kinds of environments - language and runtime - and somewhat 'like' them all. When I have an issue with my code it is most of the time I do not understand the application / biz problem. After getting that - meat - part, implementing becomes due diligent work. But that's me. Of course the right tool for the right material - like a hammer when have to deal with nails - is a good start... but may be considering nails was the problem.
For some further conversation it would be good to know with what (programming) language you spent and/or still are spending most of your coding.
Another thing I wanted to bring to your attention is this:
Assuming you use a constructor function for creating instances that then have the same state properties you specify in the constructor and behavioral properties that you specify in the prototype. After you constructed the instance, you are free to add or remove and replace state properties and add or replace behavioral properties (methods)... Many languages do not easily support such flexibility but also prevent you from making it the abyss you easily can fall into. A lot is up to your coding discipline and conventions. Some extensions can help with that but need preprocessing, since the execution is after all JS running in a JSVM, same as with many other languages that boil down to Java and run in a JVM.
I'll pull now a couple puckJSs and a PixleJS and see if I can get your code going...