# Advice for understanding Processing 'under the hood'

**URL:** <https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778>\
**Category:** Coding Questions\
**Created:** [February 1, 2023, 10:06am UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778 "2023-02-01T10:06:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![MuddyGardener](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/muddygardener/32/1719_2.png) [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Post date:** [February 1, 2023, 10:06am UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/1 "2023-02-01T10:06:23Z")

</div>

Sometimes I run into something about Processing that I think is super useful but isn’t obvious from the surface level documentation, such as [this answer to a query from the old Processing forum](https://forum.processing.org/one/topic/run-methods-on-a-layer-created-by-pgraphics.html):

```auto
the PGraphics object used as the main drawing surface for a sketch is called g. 

```

When I read something like this, I think ‘I definitely should have known that’, then I look for info about it in the surface level docs, but often I don’t find anything. Reading the entire core docs doesn’t seem like a very efficient approach…

Can anyone recommend a useful resource that lives between the core docs and the surface docs? Or can you recommend a strategy for figuring out what I don’t know that I should, that’s not in the surface docs?

Many thanks.

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [February 1, 2023, 10:21am UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/2 "2023-02-01T10:21:41Z")

</div>

> [@MuddyGardener](#):
>
> Sometimes I run into something about Processing that I think is super useful but isn’t obvious from the surface level documentation

I have created several libraries for Processing and it is impossible to document everything that someone else might find useful. When you consider the size of Processing the task becomes impossible.

Processing has a very useful reference section and users must be careful if they use anything that is undocumented because the developers are not promising it will be available in later versions.

The first version of Processing I used was V1.2.1 and if I remember correctly the reference strongly recommended not to use the variable `g` because it might be changed at some later date. I don’t think that restriction is still in effect but I haven’t looked.

If you think you have found something useful you can always ask on the forum if anyone else has used it and what for.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [February 1, 2023, 12:48pm UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/3 "2023-02-01T12:48:41Z")

</div>

> [@MuddyGardener](#):
>
> Can anyone recommend a useful resource that lives between the core docs and the surface docs?

[http://Processing.GitHub.io/processing-javadocs/core/](http://Processing.GitHub.io/processing-javadocs/core/)

---

<div class="post-metadata">

**Author:** ![debxyz](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@debxyz](https://discourse.processing.org/u/debxyz)\
**Post date:** [February 1, 2023, 5:02pm UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/4 "2023-02-01T17:02:40Z")

</div>

> [@MuddyGardener](#):
>
> Can anyone recommend a useful resource that lives between the core docs and the surface docs? Or can you recommend a strategy for figuring out what I don’t know that I should, that’s not in the surface docs?

A really Great question @MuddyGardener !!  
I have sometimes wondered this myself.

I appreciate reading @quark 's reality check that :

> [@quark](#):
>
> …it is impossible to document everything that someone else might find useful. When you consider the size of Processing the task becomes impossible.

🤓

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [February 11, 2023, 1:59pm UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/5 "2023-02-11T13:59:34Z")

</div>

Hello @MuddyGardener,

I often explore the source code to see what is going on “under the hood”:  
[https://github.com/processing](https://github.com/processing)

PApplet.java has a lot of the “helper functions”:  
[https://github.com/processing/processing4/blob/main/core/src/processing/core/PApplet.java](https://github.com/processing/processing4/blob/main/core/src/processing/core/PApplet.java)

For example the _dist()_ function:  
[https://github.com/processing/processing4/blob/main/core/src/processing/core/PApplet.java#L4565](https://github.com/processing/processing4/blob/main/core/src/processing/core/PApplet.java#L4565)

`:)`

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [February 11, 2023, 3:00pm UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/6 "2023-02-11T15:00:42Z")

</div>

Hi @MuddyGardener,

I would also recommend to study the sources for processing on GitHub. There are quite well commented sections in the code, which sometimes can be very helpful to find out what happens under the hood…

> **[GitHub - processing/processing4: Processing 4.x releases for Java 17](https://github.com/processing/processing4)**
>
> Processing 4.x releases for Java 17. Contribute to processing/processing4 development by creating an account on GitHub.

Cheers  
— mnse

---

<div class="post-metadata">

**Author:** ![MuddyGardener](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/muddygardener/32/1719_2.png) [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Post date:** [February 11, 2023, 4:30pm UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/7 "2023-02-11T16:30:26Z")

</div>

Yes, good point about the risks of going offroad and trying to be ‘clever’ but in doing so, relying on things which may change. (As a learner, I have been finding there are things about Processing that would be ultra obvious if you knew Java, but if you don’t, aren’t. Fortunately the help community is very helpful.)

---

<div class="post-metadata">

**Author:** ![MuddyGardener](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/muddygardener/32/1719_2.png) [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Post date:** [February 12, 2023, 2:18pm UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/8 "2023-02-12T14:18:21Z")

</div>

Useful reference - thank you.

---

<div class="post-metadata">

**Author:** ![MuddyGardener](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/muddygardener/32/1719_2.png) [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Post date:** [February 12, 2023, 2:21pm UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/9 "2023-02-12T14:21:45Z")

</div>

Ha ha - as they say, “the code is its own documentation”. I was afraid that was the answer ;-). - useful to know I’m not missing some other resource, though.

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [February 13, 2023, 3:04pm UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/10 "2023-02-13T15:04:37Z")

</div>

> [@MuddyGardener](#):
>
> “the code is its own documentation”

Only if it is well written and the reader has the skills to understand it LOL

As to using undocumented code, I’ve just remembered an issue I raised on github related to using GUI Builder with P4. If you are interested I have linked to the issues here -

[Issue 545](https://github.com/processing/processing4/issues/545) - read first  
[Issue 596](https://github.com/processing/processing4/issues/596) - follow up to 545

---

<div class="post-metadata">

**Author:** ![MuddyGardener](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/muddygardener/32/1719_2.png) [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Post date:** [February 14, 2023, 11:15am UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/11 "2023-02-14T11:15:41Z")

</div>

That is indeed a place I want to go soon. Thanks.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [February 15, 2023, 1:33am UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778/12 "2023-02-15T01:33:25Z")

</div>

Hello @MuddyGardener,

Also explore the Wiki:

> [@Library for Processing](https://discourse.processing.org/t/library-for-processing/40901/4):
>
> The Contribute section on the website needs an update! Start here: [https://github.com/processing](https://github.com/processing) Open the Processing 4 repository: [https://github.com/processing/processing4](https://github.com/processing/processing4) You will find Wiki along the top which links to: Lots of resources there including libraries. slight_smile

`:)`
