Skip to content

Potential point of confusion between documentation and Quest instructions... #2

Description

@dkwolfe4

In MQ-215, Quest request that you use a method ("str".method()) to change the concatenated string to uppercase. The proceeding sentence says that there are both operators and methods that return transformed copies of the string rather than modifying the original.

Having my "newbie" hat on, there is the potential for confusion, as the difference between operators and methods has not been explained at this point in the quest.

The example - someString.someTransform() - does not distinguish whether an operator or method is being called. And the read the docs link, doesn't help as it takes you to a page that shows:

def upper(self) -> String

without any examples of actual usage. Unless one is familiar with the word self and its relationship to a class, one could easily assume that calling upper(family + "-" + model) would be acceptable.

Implementing some or all of the following suggestions might help prevent this potential point of confusion:

Call out the difference between an operator and method in the quest wording by changing it to "A String is Mojo’s text type, and offers operators that can concatenate two strings together ("str" + "str") and transformational methods ("str".upper()) that return a transformed copy of the string rather than changing the original."

Change "someString.someTransform" to "someString.someTransformMethod" to make it clear that a method is being called.

Add examples to the documentation page... eg

var s = "hello"
print(s.upper())   # "HELLO"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions