Re: [svgwg] Verbose SVG for improved human readability

My main issue is with the syntax within the `d` attribute of the `path` element, the rest are mostly logical conclusions from that. The existing syntax makes code concise but hardly readable, especially if minified. Using child elements, you could always immediately identify points from other values, for instance.

File size is not an issue for this particular use case. I also doubt that the difference is huge after compression has been applied, especially when compared to non-minified hand-written code which includes optional but helpful commas and whitespace.

I’m not strongly attached to the proposed `p` moniker, which stems from _point_ obviously. An abbreviation of _coordinate_ would work just as well.

If one of SVG’s strongest advantages wasn’t its readability by humans, it could have been a more efficient non-XML, binary format in the first place.

The syntax extension I am proposing would be an optional superset that can be converted easily to the traditional style. It is just more verbose.

@longsonr is right, I could preprocess a custom syntax into standard SVG, but that would benefit only myself, hence my suggestion to standardize it. My point is that parts of the current syntax are hostile to potential new authors. Path syntax also does not afford helpful GUI solutions.

I don’t get the JavaScript argument. Yes, additional nodes make the tree more complex, but they also make working with them more straightforward. Imagine a graphical image editor: if you are dragging an anchor point, it makes more sense and feels much cleaner to alter a single child element than to update a random part of a textual attribute node. In other words, it is a more appropriate mapping of the mental and visitation models into code.

-- 
GitHub Notification of comment by Crissov
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/340#issuecomment-326239323 using your GitHub account

Received on Thursday, 31 August 2017 09:17:57 UTC