Giter Club home page Giter Club logo

Comments (6)

greyelf avatar greyelf commented on August 13, 2024

I believe using the generic arithmetic terms addition and subtraction may confuse some end-users as they have no direct association to the subject matter of Fairmath, and I believe this is especially true for the naming of the Snowman function and the SugarCube widget.

Also would it not be a good idea to introduce the concept of Namespace (or an equivalent) in the Snowman example, as there have be a number of end-users using it that have no knowledge of either Javascript or DOM programming.

from twine-cookbook.

videlais avatar videlais commented on August 13, 2024

@greyelf: I agree about the name change. I've just updated the Harlowe entry and will work to update the others.

I'm not sure what you mean in the second paragraph. I agree that JavaScript usage should be limited, but I'm also not sure how to implement Fairmath without basically what I have now. It could become global attributes as part of something, say, window.twine, but it'd still be the same general code.

from twine-cookbook.

greyelf avatar greyelf commented on August 13, 2024

I'm not sure what you mean in the second paragraph.

Two common issues end-users seem to have are:

  1. Understanding Javascript Scope and how it effect the accessibility of variables and functions.
  2. [Semi related] Understanding that you can inadvertently overwrite existing DOM functionality if you use the window object to overcome point 1.

As the functions currently stand they assume you understand what Scope they are available in (only the passage they were define in), and that might surprise someone that tries to use them in another passage or from the Console.

I was just suggesting using best practices for these types of issues (like a Namespace or equivalent) to containerise the Javascript functions, which would increase their Scope to something similar to that of the SugarCube widget equivalents.

from twine-cookbook.

videlais avatar videlais commented on August 13, 2024

That's what I thought you meant, but I'm glad you were able to clarify it for me. I agree that having the function be of a higher scope (and able to be used in any passage) is the best way to meet the two concerns you noted. I've now updated the code and description to note that. Good call.

from twine-cookbook.

greyelf avatar greyelf commented on August 13, 2024

Could using twine as the namespace cause any potential confusion or namespace collision between the end-user's custom environment and the Twine 2 application's environment in Test / Play modes?

from twine-cookbook.

videlais avatar videlais commented on August 13, 2024

It shouldn't. Snowman doesn't use that namespace. But, just to be safe, I'll re-name it to "fairmath" in the next update.

from twine-cookbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.