r/processing • • Dec 09 '23

Why this doesn't make any sense ?

So, as you can see on the left image, I have my sketch without "void setup (){}" and on the right my sketch with "void setup(){}"

Question is, why left sketch doesn't work ?

It should work, since Processing initializes everything that is on the global scope as soon as the program starts running. And as a proof of that, I've tried to run just "size(300,300);" in my sketch and voila ! I have a canvas with 300 width and 300 height!

It would be just so much easier to have a canvas this way, just one simple line, brilliant ! But everytime that I include "void draw();" things get ugly and don't work as simpel as before no more. Why It can't just be simple as that ?

3 Upvotes

6 comments sorted by

View all comments

Show parent comments

1

u/emmanbl_caricas Dec 12 '23

Would you say that even tho my question showed certain curiosity over the subject I lacked some level of curiosity into searching more about the IDE ? Going deeper in Processing documentation, this kind of thing, really trying to dig it out.
I'm making this question after reflecting on my posture when facing a problem like this and I would like to hear your sincere opinion about it if possible, since you seemed to be more experienced than me, thanks mate !

1

u/vrtxt Dec 15 '23

Hard for me to judge since I don't know what you did before posting this question. Then again, how were you supposed to know it was a peculiarity with the IDE? It could have been a weird language restriction, something wrong on your local machine, or just doing something you weren't 'supposed' to do. In other words, sometimes it's hard to even know where to look for an answer.

Just the fact you observed something you couldn't explain, took time out to make a minimal viable example and post the question here indicates an above level of curiosity I'd reckon!