Is there a deep reason that some of the javascript Math functions are jammed into the block that has sqrt in drop down but round got its own block? I’m kind of wishing there was at least a dedicated floor block in the standard palette and if there was floor I’d expect ceiling? (I feel like a good discussion of Snap!'s proper mod would involve some discussion of floor which is why I’d like a dedicated block.)
Would folks be opposed to a patch that added floor and ceiling to the standard palatte? Or, more dramatically making separate blocks for all the stuff jammed into the sqrt menu block?
We inherited many of these decisions from Scratch.
Jens has a pathological fear of increasing the number of blocks in the palette and would rather make things undiscoverable to prevent that.
(Except when it comes to media computation, for which he’s happy to add a dozen new blocks at a time, before SHOW and HIDE in the palette.)
It kind of makes sense for Scratch to emphasize ROUND, which is something kids always need for graphics projects, whereas you don’t even know the words FLOOR and CEILING (in their mathematical meaning) until you’re a teenager. We, on the other hand, are in the teenager business.
There are a couple of other candidates for pulling out of that monadic function menu that are imho more urgent than FLOOR and CEILING, namely, ID, because its proper domain is Any type rather than Number, and NEG, because nobody knows what that means and Jens just added it there in a (futile) attempt to get me to stop nagging him about monadic minus, , which belongs right after dyadic minus in the arithmetic operators, preferably next to dyadic minus but I’d settle for on the next line.
Those super long operation menus are a crock. The other horrible one is the LENGTH block for lists. Ideally all of those options would be their own blocks, located inside drawers hidden by arrowheads in the palette
like this
with the blocks underneath each of them.
So there could be a trig function drawer, a statistical function drawer, etc.
You guys don’t realize that you are the minority group here. We are constantly receiving - beyond the point of geing overwhelmed by it - the most outspoken, passionate, angry, complaints about everything in Snap being way too much for CS classes in school. Too many blocks, way too long menus (not dropdown menus, Brian, nobody complains about them except you, but the project menu in the IDE), the fact that there is such a thing as a context menu, which most teachers regard as a direct attack on their expertise (because they never use that gesture), and the fact that everybody wants their current feature to be a big, colorful, ballooningBUTTON right in their face, with nothing else interfering, because otherwise Snap is “completely unusable” in school, and they have no choice than to use some commercial offering.
I tried the ID block out, and it just seems to report its input. What’s its intended purpose?
Out of curiosity, what’s the advantage of even having NEG? Wouldn’t using the multiplication block with -1 as one of the inputs achieve the same goal? After all, it’s trivial to recreate with a custom block.
I don’t really know, I guess it takes me slightly less time to realize what ([neg V]of(x::variables) does when I’m checking my scripts than ((x ::variables)x(-1).
I don’t mind the menus to be honest. Yes, they make features less discoverable, but they make the palette more usably sized, and honestly drawers would probably bother me more, not less. Often if I’m working with lists I have some variation of the LENGTH block sitting around, at which point I can duplicate it and change the menu item to the feature I require rather than, say, losing my place in the Operators palette or moving a block editor window out of the way.
That being said, if the menus were being split apart (based on what jens said though…), I would want to do it based on the return type of the options. So “lowercase” and “uppercase” would have their own separate block from “length of text”, and “length” would be separate from “columns” and “reverse” which would in turn be separate from “text” “csv” and “json”.
My complaint about those portmanteau blocks isn’t just that their menus are long, but that they’re heterogeneous. So, for example, if in the palette you saw
you’d immediately understand that if you click on SIN you’ll get a menu with COS, TAN, and maybe also ARCSIN, ARCCOS, ARCTAN, and maybe also COT, SEC, and CSC and their inverses. But when you see
you have no reason to suppose that the menu under SQRT will also have CEILING, let alone NEG or ID. If there were a separate palette block
you’d expect that dropdown to have other log and exponential functions. As a side benefit, the one for trig functions could look like
or even have a degrees/radians menu.
If Operators is too big, let’s have a Numbers one and a Text one, or something. (Yes, that division makes it non-obvious where to put the LENGTH OF TEXT block. But if we split that category we could live dangerously and put LENGTH OF TEXT in both categories!)
(Speaking of input types, is it way too late to exchange Any and Number in the long form input dialog? Any should be above Any (unevaluated)!)
As for project menus (I take it you mean, e.g., in the Open dialog?), Mary and I have been loudly begging for a hierarchical directory structure since the BYOB days. And you (and Michael and Bernat) have been saying that filtering on tags (which we don’t have either) is a better organizing feature.
Going meta for a moment, you are clearly suffering a lot from taking the complaints from teachers too seriously. I mean, really, if they can’t handle context menus, let them use some other block-based language with first class functions, I don’t mind. (Actually I bet their problem is that they use smart whiteboards and their mouse-substitute pen doesn’t have enough buttons.) There may be more of them than of me, but I know more about programming languages than they do, some of which I learned from you, such as the word “discoverable.”
Right, on a minimize-blocks theory there’s no reason for a monadic minus. But mathematically speaking, negation is a different idea from subtraction (and a way different idea from multiplication!), and if we could fit the two minus blocks on a single line (yes, requiring a little implementation effort) it wouldn’t even cost any palette space. (And elementary school kids learning about negative numbers are part of our audience.) As it is, what I use as the closest fit to what I mean is
and then I get in trouble if I use that within a HOF script.
If shallow copying were its main purpose, it’d be called SHALLOW COPY. (In fact we should have such a block. I’d be fine if SHALLOW/DEEP were a dropdown menu in it.) It’s for putting a (text or) number input in a non-writeable input slot such as a List or Boolean or something. Or because you need to make a constant reporter:
Or because you want to choose from function alternatives:
Yes. This is exactly what I want! Well, except that I also think it’d aid discoverability to separate trig functions from exponential functions, either in separate blocks altogether (best choice) or at least in openable/closable submenus.
if it were for me I’d totally put ROUND into the dropdown of the monadic number-function reporter. In fact, I’m increasingly leaning towards doing just that.
These are by no means “unrelated”, if your field is computer programming and learning to deal with functions. All of them are in the numbers domain and their syntax is the same. If you’re looking for a “fun-arg” to put into a MAP-ring to transform a list of numbers, this is exactly where to look.
If you want to teach trigonometry or other branches of mathematics I do understand that you want a finer-grained distinction and grouping of functions. So I’d encourage you to make just that! Make a special palette with explicit monadic reporters. You could then also use more verbose labels, “square root” instead of SQRT etc.
Jens, I know config flags are the cowards way out in UI development but it does seem that there are really different audiences for Snap! in the lower grades and the high school/college context.
What if there was a per project flag that gave either a minimal palette suitable for lower grades or a richer more computer science-y palette for use in high school and college. Then teachers or curriculum developers can set up their starter code how they like and get an appropriate palatte for what they’re trying to teach.
I played with those ideas some and came up with this: