sigvef/arktis-tweet-demo

Shorthand for Math.PI

Opened this issue · 7 comments

Shorthand for Math.PI

3 good enough? :P

That's good enough for most effects. But then there are for example fractals and effects with arcs, where errors multiply and become large. This is where an accurate variable would be nice.

Feature creep!!

But in all seriousness, we should have a discussion on how many features we
want. It feels awesome with more shortcuts, but at some point we might as
well just have increased the length limit. I'm torn.

On Fri, Dec 25, 2015, 01:11 iver56 notifications@github.com wrote:

That's good enough for most effects. But then there are for example
fractals and effects with arcs, where errors multiply and become large.
This is where an accurate variable would be nice.


Reply to this email directly or view it on GitHub
#14 (comment)
.

I like the 140 limit, because a oneliner of 140 characters conveniently fits in the screen width of a laptop. Also, it limits the complexity of the demo and doesn't tax the human's working memory as much as a more complex demo. And then there's the concept of a tweet.

I'm not saying we should remove the 140 character limit. But I'm wondering how many shortcuts we should have? I mean, we could end up with demos consisting of almost only single-character functions and variables, at which points it's not really a 140 character javascript demo any longer.

I'm just arguing the other side, here. I just want to hear what you guys think.

(...) wondering how many shortcuts we should have

Should have:
Basic mathematical concepts such as sin, cos, tan, pow, pi and abs
Nice to have:
Math.random! And the HSV color space and the mouse/touch position. That could be fun. Math.exp, Math.log, Math.tanh, the heaviside step funcion? String.fromCharCode (in case unicode support is lacking)? I could probably come up with more things... How about clamp, lerp and smoothstep? And a PRNG? The list could go on and on 😛 Here's where we need to limit the number of shortshands, I think.

(...) we could end up with demos consisting of almost only single-character functions and variables

That's pretty much what I'm already doing, but mostly with the limited set of shorthand functions and with the occasional c.width and x.fillRect

(...) it's not really a 140 character javascript demo any longer

It's still JavaScript, but with a tiny demo framework on top. For example, three.js-based demos are also JavaScript demos, but with the framework in place, the code for the actual demo becomes much smaller and more fun to play with.

I'm new to this very old thread, but what's wrong with using PI? Also, JavaScript supports Unicode. Why not use π?