Skip to content

Broadcast Message Name Capitalization #918

Open
@kchadha

Description

@kchadha

This is a question about broadcast message name capitalization that came up as a result of the work in scratch-blocks#1360. This is being created as an issue so that the question can get some discussion and that both the question and response are documented somewhere.

In Scratch 2.0, users can create new messages with different capitalizations of the same message name. For example, 'message', 'mEssaGe', and 'Message' can all co-exist in the same broadcast message dropdown menu, and even though they are 3 separate options, they will all trigger the same (3) 'when I receive' hats. This means that even though the dropdown has the three different capitalizations listed above, all of these name options refer to the same underlying message being broadcasted.

The work in scratch-blocks#1360 makes Scratch 3.0 consistent with the behavior described above.

One discrepancy I noticed as a result of this work is in how scratch 2.0 projects that use this behavior are being imported to scratch 3.0. Currently, scratch 2.0 projects that use the above behavior, (e.g. this one), will get translated to a lowercase version of the message name:

image

gets imported as

image

The behavior of the two projects in 2.0 and 3.0 is exactly the same.

The questions that arise as a result are:

  1. Does the behavior of 3.0 need to be updated or changed to dis-allow this kind of broadcast message naming?
    • Is this kind of naming confusing because of the fact that creating variables with different
      capitalization makes them two separate variables)
  2. If we keep Scratch 3.0 behavior the same, should the sb2 import be updated so that it doesn't auto-lowercase message names? If not, should we document this difference somewhere?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions