Rearrange Variables and Custom Blocks

A feature I’d like to see in Hopscotch is:

I’m pretty sure we’ve all wished for this feature before…

The ability to strategically rearrange, or alphabetize the following:

  • global variables
  • custom blocks
  • custom rules

I’d use it for this type of project:

Any project. But more specifically:

Any project with a lot of variables and/or custom blocks.

Currently, finding my variables or custom blocks is like being forced to play “I Spy” or “Where’s Waldo”.

Here are some examples of Hopscotch code that could be improved if we had this:

This project that I created contains the most amount of custom blocks (aka functions) that I’ve ever made. However, when I made so many, it got so very frustrating and time consuming because whenever I wanted to use one, I’d have to look for it.

If you edit the code and view my custom blocks, you can see that some portions are alphabetical (which I had to do by hand) and others are not.

It’s not a happy place. Not at all.

Here is an example design I’ve made:

Here’s a pretty clever idea:

This feature should be relatively simple to add.

Even if the implementation was as minor as a toggle to determine how to sort the variables and blocks, it would go a long way.

I’ve seen something similar in other programming languages, it looks like this:

You just rearrange your variables or functions. With text based programming languages, it’s very simple: cut and paste.

Some languages have static variables and static functions that are grouped within objects so they can even be organized by category.


Community Poll

Select the option(s) that you are good with:

  • Idea 1: Ability to rearrange variables and custom blocks, just like how I can rearrange my code.
  • Idea 2:
    Option to sort my variables and custom blocks alphabetically, chronologically, etc.
  • Idea 3: Ability to group variables and custom blocks into categories and subcategories for more perfect organization.
  • Any of these ideas will make my life much better and will allow me to code even faster.
  • I’ll still live if there are no changes
  • Other (Add a comment below)

0 voters

7 Likes

first

3 Likes

Cool idea I would like this though it feels a little unnecessary

2 Likes

Oh no my bad I messed up on the poll.

It was supposed to let you choose as many options as you liked. My mistake.

4 Likes

Since all functions and variables in Hopscotch are global (they are all created/initialized at the same time), you are right in saying that this feature request is unnecessary.

One idea I just thought of: However, if Hopscotch plans to add local variables in the future (who knows) this feature will be crucial.

But in the meantime, being able to organize variables and others will make some of us a lot more happy. But it all depends on how much more happy it will make us, and if that happiness is worth the dev time. My bet is that it is.

5 Likes

Once you are in a groove coding along you want to be able to quickly find the variables you want for the current expression you’re editing.
As it is, to find a variable you have to re-witness the sad fumbling thought history that led you to create the variables in the order you did, but that is not the same as the ordering of variables that is coherent for your current vision of your code.
In the editor of a text-based language this is a non-issue: you just type the name of a variable and maybe the IDE auto-completes for you.
In a graphical environment, respecting the programmer’s mental model of variable organization will make programming more enjoyable.

7 Likes

Yes, I agree with this. It would definitely make variables in projects with a larger amount of them easier to find.

5 Likes

I’ve reeeeaaaally been wanting a feature where you can move a variable from one section to another, like say change an object variable into a user variable, and all you code would change with it.

4 Likes