# Friendly names for Processing Sketches like the p5.js web editor

**URL:** <https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986>\
**Category:** Development\
**Created:** [May 17, 2020, 10:13pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986 "2020-05-17T22:13:43Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![KartikSoneji](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@KartikSoneji](https://discourse.processing.org/u/KartikSoneji)\
**Post date:** [May 26, 2020, 4:31pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/21 "2020-05-26T16:31:21Z")

</div>

@jeremydouglass Any updates on this?

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 26, 2020, 4:37pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/22 "2020-05-26T16:37:27Z")

</div>

Hi @KartikSoneji – sorry, no updates. I am not a core developer on the Processing repo. I believe that ben fry is reviewing and merging almost everything there, and things happen as they can based on his limited availability. I’m hoping this gets a favorable look soon and am happy to chime in further on the issue / PR when it does.

---

<div class="post-metadata">

**Author:** ![KartikSoneji](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@KartikSoneji](https://discourse.processing.org/u/KartikSoneji)\
**Post date:** [May 26, 2020, 5:07pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/23 "2020-05-26T17:07:49Z")

</div>

> [@](#):
>
> I am not a core developer on the Processing repo

@jeremydouglass oh, I thought that you were a core developer.

> [@](#):
>
> ben fry is reviewing and merging almost everything there, and things happen as they can based on his limited availability.

I completely understand.

Could you suggest something else that I could work on in the meanwhile?

Thanks again for your help and support.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 27, 2020, 2:09am UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/24 "2020-05-27T02:09:44Z")

</div>

> [@KartikSoneji](#):
>
> oh, I thought that you were a core developer.

Sorry for the confusion. I am a moderator on the forums and active on repo issues, but I tried to communicate the key gatekeeper is ben fry.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 27, 2020, 2:39am UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/25 "2020-05-27T02:39:36Z")

</div>

> [@KartikSoneji](#):
>
> Could you suggest something else that I could work on in the meanwhile?

Great question! Do you mean issues on Processing 3 specifically, or other things in the ecosystem with quicker PR review times?

One suggestion that I have is to reach out to @sampottinger about the current work on Processing 4 – there might be ways to get involved there.

Another possibility beyond the core is if you wanted to contribute to one of the Processing libraries. There are fork mirrors to ~400 here:

- [Archive for Processing · GitHub](https://github.com/archive-for-processing)

Contributing to a library or mode can also be a great way to learn the how libraries work and the PDE Contributions architecture and distribution system. Here are a few libraries that are currently in active development / recently updated:

> **[GitHub - Milchreis/uibooster-for-processing: 🚀 Creates fast and easy dialogs...](https://github.com/Milchreis/uibooster-for-processing)**
>
> 🚀 Creates fast and easy dialogs for utility tools for Processing - GitHub - Milchreis/uibooster-for-processing: 🚀 Creates fast and easy dialogs for utility tools for Processing

> **[GitHub - boydhont/LiveBrush: A library for live coding with dynamic brushes,...](https://github.com/boydhont/LiveBrush)**
>
> A library for live coding with dynamic brushes, developed for Processing 3 - GitHub - boydhont/LiveBrush: A library for live coding with dynamic brushes, developed for Processing 3

> **[GitHub - csinac/Infinidecimal: A numeric canvas library for Processing that...](https://github.com/csinac/Infinidecimal)**
>
> A numeric canvas library for Processing that stores the image as a number array to create visuals with arbitrary ranges. - GitHub - csinac/Infinidecimal: A numeric canvas library for Processing tha...

> **[GitHub - VisualComputing/nub: A rendering and interaction Processing library](https://github.com/VisualComputing/nub)**
>
> A rendering and interaction Processing library. Contribute to VisualComputing/nub development by creating an account on GitHub.

> **[GitHub - cansik/deep-vision-processing: Deep computer-vision algorithms for...](https://github.com/cansik/deep-vision-processing)**
>
> Deep computer-vision algorithms for the Processing framework. - GitHub - cansik/deep-vision-processing: Deep computer-vision algorithms for the Processing framework.

> **[GitHub - nafeu/oavp: Open source audio visualization software built on...](https://github.com/nafeu/oavp)**
>
> Open source audio visualization software built on Processing - GitHub - nafeu/oavp: Open source audio visualization software built on Processing

> **[GitHub - Izza11/shader-mode](https://github.com/Izza11/shader-mode)**
>
> Contribute to Izza11/shader-mode development by creating an account on GitHub.

In addition, if you are excited about the pedagogical side, you might also consider contributing to the Rosetta Examples set (disclaimer: I coordinate that project):

> **[GitHub - jeremydouglass/rosetta\_examples\_p5: Example set from Rosetta Code...](https://github.com/jeremydouglass/rosetta_examples_p5)**
>
> Example set from Rosetta Code for P5 (Processing). Contribute to jeremydouglass/rosetta\_examples\_p5 development by creating an account on GitHub.

There are many fun simple issues for first contributions, and the sky is the limit there (as there are many hundreds of unported tasks, some quite difficult).

Other people may have other suggestions – it is a big community with a lot of worthy projects in it that welcome contributions.

---

<div class="post-metadata">

**Author:** ![erkosone](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@erkosone](https://discourse.processing.org/u/erkosone)\
**Post date:** [May 27, 2020, 11:00am UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/26 "2020-05-27T11:00:41Z")

</div>

Al iniciar el IDE, si yo me llamo “luis”, podria crear sketches con el sistema basico de nombres:  
sketch name = “luis” + “\_” + counter + “.pde”;

asi, si yo soy luis, mis aportaciones seran luis\_000… luis.001… luis\_xxx…

---

<div class="post-metadata">

**Author:** ![KartikSoneji](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@KartikSoneji](https://discourse.processing.org/u/KartikSoneji)\
**Post date:** [May 27, 2020, 7:29pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/27 "2020-05-27T19:29:38Z")

</div>

Hi @erkosone!

Thanks for your suggestion.

I have two questions:

- What happens after `luis_999`?
- What happens if the user creates `luis_001` and `luis_002`, then deletes `luis_001`? Does the next project have the name `luis_001` or `luis_003`?

Also, are you sure that this scheme will be used by many users?  
What do you think, @jeremydouglass ?

---

<div class="post-metadata">

**Author:** ![KartikSoneji](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@KartikSoneji](https://discourse.processing.org/u/KartikSoneji)\
**Post date:** [May 27, 2020, 7:56pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/28 "2020-05-27T19:56:26Z")

</div>

Thanks for such a comprehensive answer.

> [@](#):
>
> Great question! Do you mean issues on Processing 3 specifically, or other things in the ecosystem with quicker PR review times?

Nothing in particular. I was thinking of improving the build process for Processing 3 because as it stands right now, the build environment is a pain to setup. But if Processing 4 is coming out then I think that it will be better to work on that first.

I was also thinking of setting up a Dockerfile so that we can at least check that PRs compile successfully.

> [@](#):
>
> One suggestion that I have is to reach out to @sampottinger about the current work on Processing 4 – there might be ways to get involved there.

That seems like a good idea. I will look at the issues do what I can.

> [@](#):
>
> Another possibility beyond the core is if you wanted to contribute to one of the Processing libraries.

Contributing to libraries tends to be prone to feature-creep, especially as I do not use Processing and am not familiar with the libraries.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 27, 2020, 8:00pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/29 "2020-05-27T20:00:35Z")

</div>

Hmm. Counters in the Untitled\_1, Untitled\_2, Untitled\_3 system are used by a lot of office / document software. On creating a new file, it tries to create Untitled\_1 and then fails-up until it hits a number that isn’t taken – so if you have

Untitled\_1  
Untitled\_2  
Untitled\_4

…then your next one created will be Untitled\_3. MSWord does this. So does TextMate.

So it seems like this would be two things:

1. a counter
2. a customized label – so instead of “sketch” it could be “bosquejo” or “luis”.

In theory you could then mix and match – luis\_200512b, sketch\_3, IridescentTurnip\_3 etc. – but it all seems like this is all potentially getting very complicated for an interface aimed at least partly at learners.

If the goal is to have a list of sketches:

luis\_1  
luis\_2  
…  
luis\_48

…for instance for upload to a gallery or repo, then it might make sense to use a renaming script instead?

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 27, 2020, 8:03pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/30 "2020-05-27T20:03:52Z")

</div>

> [@KartikSoneji](#):
>
> I was thinking of improving the build process for Processing 3 because as it stands right now, the build environment is a pain to setup. But if Processing 4 is coming out then I think that it will be better to work on that first.
> 
> I was also thinking of setting up a Dockerfile so that we can at least check that PRs compile successfully.

Sounds great! Perhaps before diving into that take a look at Sam’s fork, and/or issues / open PRs on Processing 3. It is possible that those things were already suggested and either haven’t happened yet or current main contributors have a specific way of working for builds / CI that they might not want to change. I personally would love a Docker based CI setup.

---

<div class="post-metadata">

**Author:** ![KartikSoneji](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@KartikSoneji](https://discourse.processing.org/u/KartikSoneji)\
**Post date:** [May 27, 2020, 8:13pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/31 "2020-05-27T20:13:57Z")

</div>

> [@](#):
>
> this is all potentially getting very complicated

I agree, this might become too complicated.  
It is quite easy to write a renaming script in Java itself.

As a side note, I was thinking that if we are including the list of friendly words then it makes sense to give the users access to the `FriendlyWords` class. Combined with the `random(Object[])` function, it can be used as a simple random word generator.

---

<div class="post-metadata">

**Author:** ![erkosone](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@erkosone](https://discourse.processing.org/u/erkosone)\
**Post date:** [May 27, 2020, 9:21pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/32 "2020-05-27T21:21:56Z")

</div>

Bien… quizas seria mejor algo asi:. Date + \_xxx

Es poco probable que alguien cree 1000 proyectos el mismo dia.

Cuando se crea un proyecto nuevo siempre sera con +1 al numero mas grande encontrado.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 27, 2020, 9:38pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/33 "2020-05-27T21:38:17Z")

</div>

Creo que la forma en que ya funciona en este momento es que la Date obtiene un sufijo de letra (200512a …b …c …d) en lugar de un contador.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 27, 2020, 9:39pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/34 "2020-05-27T21:39:43Z")

</div>

> [@KartikSoneji](#):
>
> give the users access to the `FriendlyWords` class

Sorry, I didn’t understand this part. Give users access how?

---

<div class="post-metadata">

**Author:** ![KartikSoneji](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@KartikSoneji](https://discourse.processing.org/u/KartikSoneji)\
**Post date:** [May 28, 2020, 12:23am UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/35 "2020-05-28T00:23:09Z")

</div>

> [@](#):
>
> Give users access how?

For example, the user should be able to write a sketch like:

```java
void setup(){
    print(FriendlyWords.objects[10]);
}

```

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 28, 2020, 4:49am UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/36 "2020-05-28T04:49:04Z")

</div>

Ah, yes! That could definitely be done with a library, so a user could `import FriendlyWords.*;` – it just wouldn’t be included in the core Processing API, and the sketch wouldn’t access code used by the PDE application in that way.

As I understand it, when Processing is used in PDE (as opposed to using Processing as a Java library e.g. with Eclipse or Netbeans) the pre-imported functionality includes the core Processing API and passing through some Java 8 builtins that you don’t need to explicitly import. For the core itself, I believe that almost all dependencies are java.etc or javax.etc (with a few exceptions like com.jogamp.opengl and org.xml). Otherwise all other code available to sketch writers is handled through library imports – including even core libraries that pre-installed, like Network, Serial, and PDF Export. Even audio and video are handled through library imports.

---

<div class="post-metadata">

**Author:** ![KartikSoneji](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@KartikSoneji](https://discourse.processing.org/u/KartikSoneji)\
**Post date:** [May 28, 2020, 3:33pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/37 "2020-05-28T15:33:52Z")

</div>

Hmmm. So what you are saying is that the `FriendlyWords` class will need to be included as a library? I do not see the point of duplicating code, as the Processing app will already have the entire class.

Is there no way to import the class directly from the app? Maybe as a default import so that the user does not have to worry about the import path.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 28, 2020, 3:48pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/38 "2020-05-28T15:48:33Z")

</div>

> [@KartikSoneji](#):
>
> I do not see the point of duplicating code, as the Processing app will already have the entire class.

I think this is unfortunately a moment where, because you are not a Processing user, you may not be quite getting what Processing _is_. It isn’t an app. It is a language (a Java dialect transpiled into Java) and a core API, and the app supports working with that language.

So this is like a bit like saying “now we are using FriendlyWords in Eclipse to handle file saving – can’t all Java programs automatically import FriendlyWords?” They can’t for a variety of reasons. One is that Eclipse is not Java. Processing is used to program outside of PDE, so it sets up an expectation that something will work which won’t. Another is that the API is targeted (with more or less coverage) by many other modes, including p5.js, processing.js, processing.py, p5py, pyp5js, Processing.R, JRubyArt, and others. Some of these modes are modes for the PDE app itself – you can load them through Contributions Manager and change mode on a sketch window. Just because FriendlyWords is in the PDE file manager doesn’t mean it is available in any of those contexts, and the PDE app itself – because it is designed for multiple language support – treats each language as separate, and doesn’t mix its own internals in with those languages. (although Java mode is default / first). The number of things that PDE does in a “built-in” / magic-import way without explicit import is constrained almost entirely to what the core is as a shared target of support – the language API itself covered in the reference documentation, which you can also import into a Java project and use in a non-transpiled Java syntax.

> **[Reference](https://processing.org/reference/)**
>
> Find further documentation of the Processing language

Over time, Processing’s core has expanded to include a few things like Table and PShape, but these are all multipurpose general programming facilities. FriendlyWords are convenient methods for manipulating a specific list of fun words. It doesn’t make sense to add to a language core.

---

<div class="post-metadata">

**Author:** ![KartikSoneji](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@KartikSoneji](https://discourse.processing.org/u/KartikSoneji)\
**Post date:** [May 28, 2020, 4:00pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/39 "2020-05-28T16:00:30Z")

</div>

OK. That makes sense.

But what I was referring to is that we provide some way for users to access just the list of `FriendlyWords`, but I understand that might get complicated if other languages are involved.

The only other option that I see is making (just) the list of `FriendlyWords` part of the core Processing library itself, but that seems unnecessary.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 28, 2020, 4:02pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/40 "2020-05-28T16:02:28Z")

</div>

The easiest thing would be just to create a FriendlyWords library package. It could even have multiple mode support if you liked, so that it would also work in p5.js etc. Then any user could import it and use friendly words.

I see you what you mean about “just the list”, but to put it another way: programming editors in general don’t have a sense of “non-project data” in this way, for lots and lots of reasons, a main one being portability. Eclipse and Netbeans don’t have magic data text files that can be referenced without import and that only work when Java programs are run within them, or that are magically copied into project directories only when referenced in code without import. (This is important because PDE has a sketch export-to-app feature – it needs to bundle up the sketch with a mac/win runtime that will execute outside PDE, so on export you have to either break the sketch or implicitly copy out the data). With a few exceptions (long lists of color name constants, for example), most programming languages don’t have much “data” in this way at all. If you want to add data to a program / project / sketch, you add it explicitly.

[Previous page](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986.md?page=1)

[Next page](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986.md?page=3)
