nature-of-code / noc-book-2-archive

Repository for The Nature of Code book with p5.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

display() function name

shiffman opened this issue · comments

The examples using display() in Mover, Particle, Vehicle, etc. I believe display() is a keyword in JavaScript in some contexts, I'm thinking of changing this to show(). render() is also a possibility but has such a technical sound to it.

@shiffman - oh! I didn't realize this. I know that display is a property of DOM elements - https://www.w3schools.com/jsref/prop_style_display.asp - but AFAIK it isn't a function. Is this what you're referring to?

I avoid render() as it is a function name to render jsx in react. Likely this won't be a point of confusion for NOC readers, but maybe worth considering.

show() would be fine for me, though display() is my first choice.

Let's stick with display(), I have this memory of code editors syntax highlighting display() but I'm not seeing this happen with anything I'm currently using so I think I'm maybe imagining things!