Skip to content

Notes on middle section of menu/toolkit #348

@WestsideRobotics

Description

@WestsideRobotics

New Blocks is looking good!

This post is not a typical Github “Issue” to suggest a specific correction. It’s a simple comparison of New Blocks to Legacy Blocks, limited to one section of the menu/toolkit.

It includes a few minor points that developers may wish to implement with PRs. Please disregard, if this is not the right place for such comments.

The middle section reviewed includes these New Blocks headings:

  • Test
  • Logic
  • Loops
  • Math
  • Text
  • Lists
  • Miscellaneous

=============

Test

This section contains only call Print. It seems to duplicate the print Block added under Text. See below for a question about that New Block (and this one).

Logic

The only change I noticed was null to None. I looked it up and found that None is a special Python constant similar to Java’s null. Namely it’s not the text string “None”, or the number zero (“none”).

The pop-up balloon says only: “Returns None”. Hopefully students will use this only in the Logic Compare Blocks. It does click into New Blocks for Math and Create Text With; not sure how it’s processed there. (I can’t run New Blocks to find out.)

Loops

Seems unchanged.

Math

I noticed only a change in the pop-up balloon for atan2 as follows.

Legacy Blocks:

Returns a numerical value between -180 and +180 degrees, representing the counterclockwise angle between the positive x axis, and the point (x, y).

New Blocks:

Returns the arctangent of point (X, Y) in degrees from -180 to +180.

I was going to comment here that I personally favor the longer description for younger programmers (pre-trigonometry). But then I realized the New Blocks description is technically incorrect:

atan2 is a more comprehensive version of arctan that takes two arguments (y and x) and determines the correct quadrant for the resulting angle, providing a full range of (-pi ,pi) or (-180,180) degrees. In contrast, arctan takes only one argument (y/x) and its output is limited to the range (-pi/2, pi/2) or (-90, 90) degrees, making it unable to distinguish between opposite quadrants.  

Text

This menu contains 3 New Blocks not offered in Legacy Blocks:

  • replace - “occurances” should be “occurrences”
  • reverse
  • print - where does this ouput appear? Will this be replaced with broader Telemetry options?

Lists

  • adds Reverse

  • Find first occurrence now returns -1 instead of 0, when item not found. Seems OK, forces special handling?

Also, get # and set # both change first item from #1 to #0. I presume this was an intentional move away from Legacy Blocks’ (gentle) treatment for younger programmers not yet familiar with the “zeroth” item.

Without commenting on that decision, I would simply mention that the next Block Get sub-list from # to # needs to use (and document) the same new convention, starting from zero. (I can’t test New Blocks to confirm.)

Miscellaneous

This section contains only 2 of the 8 Legacy Blocks; perhaps more are coming later.

For the New Block evaluate but ignore result comment balloon, consider changing “function” to “Method” (per New Blocks).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions