Re: [css-houdini-drafts] [css-paint-api] Rename paint(name, args) to paint-name(args)

@tabatkins I don't remember the discussions from back then, but I suspect the reasons were very different. For one, this change does not increase the number of characters that need to be typed, whereas `var-foo` was more verbose. Secondly, one issue with that variable syntax was the inconsistency between defining and referencing, whereas here `paint-foo()` is the only way this is referenced in the CSS.
Lastly, variables are usually temporary and do not require the same amount of work as defining a paint operation. Having a function to show for the latter is much more rewarding, whereas for variables there is no such psychological distinction: you are defining a new property either way.

Imagine if you were making a JS (or any other prog lang) library and the only way to expose its API was to hook into some other function and have people call your function by passing its name as an argument to the mega-function that calls everything. Does that seem normal? Is it a good developer experience?

@nox Wouldn't that apply to defining custom function mames anyway?

I understand that it may bring a little extra parsing complexity, but I believe it's a significant gain for readability and IMO worth it.

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/751#issuecomment-379741340 using your GitHub account

Received on Monday, 9 April 2018 12:54:06 UTC