Transitioning to p5.js from Processing. Maybe. Begrudgingly

It is my understanding that p5.js still puts a bunch of stuff in the global scope which isn’t a common pattern for JS libraries anymore, and isn’t very comforting to someone coming from Java. This also trips up my desire to use Typescript. Am I missing something?

Thanks.

1 Like

For most single-page apps meant to mostly showcase the P5.js sketch, using the global scope is completely fine.

If you have a different context or it just bothers you, then you can always use instance mode.

More info here:

3 Likes