Comments (6)
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.
@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.
I'm not sure what you mean in the second paragraph.
Two common issues end-users seem to have are:
- Understanding Javascript Scope and how it effect the accessibility of variables and functions.
- [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.
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.
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.
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)
- Downloading issue at the twinery HOT 6
- "Typewriter Effect" for SugarCube needs an update HOT 3
- Add Twine logo
- Harmonize (match) colors of Cookbook to online editor HOT 1
- Add Twine logo to Cookbook HOT 1
- Some pages on twinery.org/cookbook/ do not work HOT 1
- Harlowe: adding functionality
- Harlowe: storylets
- Harlowe: JS no longer works in macros HOT 1
- Inform Recipe Book broken link HOT 1
- Page not found messages HOT 1
- Markdown conversion issue on Twine 1 formatting page HOT 1
- Create Borogove.io instruction page
- Wrong Example File in "Headers and Footers"
- Twine 2 Editor section is out-of-date HOT 1
- Error: JS -> Storyformats -> SugarCube -> `windows.setup`
- Proposal for 2.2 version and tagging
- Allow all text on Proof screen to be copied HOT 3
- Accessing the html code for a Twine story without an external download
- Obsolete code in snowman left sidebar tutorial
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twine-cookbook.