# 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:** 1

<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 17, 2020, 10:13pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/1 "2020-05-17T22:13:43Z")

</div>

Hi everyone!

I heard of Processing through Daniel Shiffman’s videos, and while I do not use it personally, I feel the it is a great tool for teaching and creative coding. I would love to contribute to the development of Processing.

The first thing that I would like to contribute is a better naming scheme for new sketches. I personally feel that the way new sketches are named is horribly boring and difficult to read.  
The p5.js web editor uses the Glitch friendly word list to generate random, fun names for new sketches. I have replicated the behaviour in the Processing IDE.

Now, how do I get it accepted into the main branch? Should I just submit a PR? I did read the [Contributing Guidelines](https://github.com/processing/processing/blob/master/CONTRIBUTING.md), but that was not of much help.

Thanks for your time.

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [May 17, 2020, 10:22pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/2 "2020-05-17T22:22:02Z")

</div>

> [@KartikSoneji](#):
>
> I personally feel that the way new sketches are named is horribly boring and difficult to read.

I see what you’re saying, but on the other hand Processing sketches are named after today’s date. I’m sure at least a few folks find this naming convention more useful than randomly-generated names. I also wouldn’t be surprised if certain tools and libraries depended on this naming convention.

Not saying you shouldn’t contribute your change, but I think you’d probably want to make it a setting that people could choose.

---

<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 17, 2020, 10:25pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/3 "2020-05-17T22:25:07Z")

</div>

I was worried about that.

> [@Kevin](#):
>
> a setting that people could choose

That is a good solution. Should I start working on it? My Swing is a little rusty, so might take a while.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [May 18, 2020, 10:06am UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/4 "2020-05-18T10:06:46Z")

</div>

Can you post a link for the list of friendly words?

---

<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 18, 2020, 12:22pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/5 "2020-05-18T12:22:32Z")

</div>

The original list is here:

> **[glitchdotcom/friendly-words](https://github.com/glitchdotcom/friendly-words/tree/master/words)**
>
> The Glitch word list, packaged into an NPM module for easy use. - glitchdotcom/friendly-words

I combined the lists into one Java class along with a few helper functions:

```java
//Words from the Glich list of friendly words.
//Link: https://github.com/glitchdotcom/friendly-words

package processing.app;

public final class FriendlyWords {  
  static public String generateProjectName() {
    String adj = predicates[Math.random() * predicates.length];
    String obj = objects[Math.random() * objects.length];
    
    return capitalizeFirstLetter(adj) + capitalizeFirstLetter(obj);
  }
  
  
  static public String generateCollectionName() {
    String adj = predicates[Math.random() * predicates.length];
    
    return "My " + capitalizeFirstLetter(adj) + " collection";
  }
  
  
  static private String capitalizeFirstLetter(String s) {
    return Character.toUpperCase(s.charAt(0)) + s.substring(1);
  }
  
  
  public static final String[]
    collections = {
      "accrual",
      "aggregation",
      "album",
      "analects",
      "anthology"
	  //...
    }

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [May 18, 2020, 1:18pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/6 "2020-05-18T13:18:21Z")

</div>

Thank you so much!

Chrisir

---

<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 18, 2020, 1:25pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/7 "2020-05-18T13:25:45Z")

</div>

You’re welcome 😄.

---

<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 20, 2020, 8:21pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/8 "2020-05-20T20:21:36Z")

</div>

Hi @KartikSoneji – have you opened an issue on the Processing github repo proposing that you work on a PR? This sounds like something that would be up to benfry – you might get good feedback, and you might also be suggested to move it to a PR on Processing4 instead of 3.

I think as an option it sounds like a great idea. Currently:

> sketch\_200520b

…I would imagine the options might be:

> sketch\_iridescent\_turnip\_200520b  
> sketch\_iridescent\_turnip  
> iridescent\_turnip\_200520b  
> iridescent\_turnip

No strong opinions, but I can see reasons to prefer different approaches, depending on the goals.

---

<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 20, 2020, 9:05pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/9 "2020-05-20T21:05:33Z")

</div>

Hi @jeremydouglass !

> [@](#):
>
> have you opened an issue on the Processing github repo proposing that you work on a PR?

I have just [opened a PR](https://github.com/processing/processing/issues/6045).  
The Fork with my code is [here](https://github.com/KartikSoneji/processing/tree/feature-friendly-names).

Right now, I have the naming as: `IridescentTurnip`. If you enable the “Use Old naming scheme for new Sketches” setting in Preferences, it defaults to `sketch_200520b`. Please let me know if you have any suggestions.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2a93a97662bf0309bc04ed15feadaef91aa6dc72.png)

---

<div class="post-metadata">

**Author:** ![Bobby54](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bobby54/32/9302_2.png) [@Bobby54](https://discourse.processing.org/u/Bobby54)\
**Post date:** [May 21, 2020, 10:17am UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/10 "2020-05-21T10:17:38Z")

</div>

Sounds like a good idea but you should name the switch for friendly and not-friendly names differently because especially new users won’t know what is meant by “old naming scheme”.  
Maybe name it “Use alphanumeric scheme for new sketches”.

---

<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 21, 2020, 12:37pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/11 "2020-05-21T12:37:12Z")

</div>

Hi @Bobby54,

> [@](#):
>
> new users won’t know what is meant by “old naming scheme”

You are right, perhaps “Old naming scheme” is not very clear.

> [@](#):
>
> Maybe name it “Use alphanumeric scheme for new sketches”.

Technically, “alphanumeric” means comprised of Alphabets and Numbers, so the name `iridescent_turnip_200520b` also qualifies as alphanumeric.

Maybe something like:  
`Use Old naming scheme for new Sketches (Eg: sketch_200520b)`  
OR  
`Use Old naming scheme for new Sketches (Eg: sketch_{yy}{mm}{dd}a)`  
will be better?

---

<div class="post-metadata">

**Author:** ![Bobby54](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bobby54/32/9302_2.png) [@Bobby54](https://discourse.processing.org/u/Bobby54)\
**Post date:** [May 21, 2020, 2:16pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/12 "2020-05-21T14:16:21Z")

</div>

Hi @KartikSoneji,

alphanumeric probably wasn’t the best term for it but I like your second example.

---

<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 21, 2020, 3:52pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/13 "2020-05-21T15:52:26Z")

</div>

What do you think, @jeremydouglass ?

---

<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 21, 2020, 8:21pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/14 "2020-05-21T20:21:04Z")

</div>

Maybe a dropdown, like “Language:”

```nohighlight
Default sketch naming: Dates (sketch_201231)
                       Friendly (IridescentTurnip)
                       Friendly dates (IridescentTurnip_201231)

```

---

<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 22, 2020, 10:21pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/15 "2020-05-22T22:21:48Z")

</div>

@jeremydouglass, @Bobby54 How is this?

 ![K4LKIkNaXL](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1845f04c285e1aabe20444d378d23e8d35c85b40.gif)

I have also updated my [GitHub branch](https://github.com/KartikSoneji/processing/tree/feature-friendly-names).

---

<div class="post-metadata">

**Author:** ![Bobby54](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bobby54/32/9302_2.png) [@Bobby54](https://discourse.processing.org/u/Bobby54)\
**Post date:** [May 22, 2020, 11:12pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/16 "2020-05-22T23:12:03Z")

</div>

I would say that this is perfect. Great idea to use a drop-down menu and show example names behind it.

---

<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 22, 2020, 11:46pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/17 "2020-05-22T23:46:44Z")

</div>

Awesome.

One suggestion. The issue that you opened – that I’m assuming you will submit a PR to close – says “New sketches are a mix of numbers that need to be read VERY carefully.”

It might be good to edit the issue description to something like “New sketches are named with a number date string, sketch\_201231b. This mix of numbers can make it hard to distinguish sketches.”

I suggest this because Ben might get the misimpression from your description that you wrongly think the sketches are named _at random_ – and then discount your issue as a misunderstanding.

---

<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 22, 2020, 11:47pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/18 "2020-05-22T23:47:43Z")

</div>

Thanks! I still need to work on language support, should submit a PR by tomorrow.

---

<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 23, 2020, 12:13am UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/19 "2020-05-23T00:13:57Z")

</div>

> [@](#):
>
> the sketches are named _at random_

To be honest, I only recently found out that the numbers at the end of sketch names are NOT random numbers. Personally, I find it quite difficult to parse the numbers as a date, especially as it is in an unusual format (`yymmdd` as opposed to the ISO `yyyymmdd`).

> [@](#):
>
> It might be good to edit the issue description to something like “New sketches are named with a number date string, sketch\_201231b. This mix of numbers can make it hard to distinguish sketches.”

But I do see your point. I have updated [the issue](https://github.com/processing/processing/issues/6045).

Thanks.

---

<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 23, 2020, 11:24pm UTC](https://discourse.processing.org/t/friendly-names-for-processing-sketches-like-the-p5-js-web-editor/20986/20 "2020-05-23T23:24:25Z")

</div>

I have submitted [a PR](https://github.com/processing/processing/pull/6048)!

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