Hello girls and guys,
p5.js doesn’t give any information whatsoever about the nature of an error or it’s location if it’s during the execution.
Since I started making bigger and bigger programs, I’ve come to fear this well known enemy of mine: “Script error. (:line 0)”
I mean what a wonder to know that there is an error somewhere in a 500 lines long program… like finding a needle (that looks like hay) in a haystack.
I’ve come to rewrite entire programs from scratch because I was unable to find the source of an error, and that is quite unsatisfying.
Now that I started coding in C++ with Xcode (which btw is an amazing IDE), getting back to p5.js is not fun at all.
Anyway, I’m getting lost in my thoughts…
So, in my frustration, I’m calling for help to the community. Do you have the same problem ? Is it due to some navigator settings ?
(Safari version 10.1.2 (11605.3.8.1) and MacOs El Capitan 10.11.6) Should I accept my fate ?
I could have just pasted my entire program here, but to be honest, it’s really not a well documented program and even I struggle to understand it sometimes.
However, if you’re interested in a biologicaly realistic ant-simulator, you’ve come to the right person.
What I do know is that most JS online hosts run our code inside an <iframe>, which by itself gets a little in the way when we need to debug it.
But by itself an <iframe> shouldn’t interfere that much.
It would only make it harder to directly access global variables and that’s it.
My guess is that the p5js online editor goes further than that, w/ “features” like console logs redirection, “friendly” custom error messages and so on; which end up interfering w/ normal console debugging!
Having so many other options available in the JS world, I fail to understand why you would feel like so!
For most cases, where my sketches are small, I just use a simple text editor like Notepad2; and Atom for bigger 1s:
Once I’ve got them running properly I pick some JS host site:
Thank you for enlightening me on this matter.
It seems now that the p5.js web editor I used was good and fun for a starter.
Moving onto a “local” IDE like Atom is the right move.
I didn’t know about OpenProcessing, and it is very very helpful.
Thank you again for your advice.
I’m so much back in the mood for JS programming.
It’s gonna be amazing.