4 ms·
So is the primary purpose of the library to save you from having to type "M 0 0 L 1 0 L 1 1", instead letting you type "Path().moveto(0, 0).lineto(1, 0).lineto(
by dgreensp 12y ago
So is the primary purpose of the library to save you from having to type "M 0 0 L 1 0 L 1 1", instead letting you type "Path().moveto(0, 0).lineto(1, 0).lineto(1, 1).print()"?
- pathsjs 12y agoWell, if you are familiar with SVG and you just want to write at this level of abstraction, yes. But of course, this is only the lowest level API. The actual purpose of library is to provide with more complex shapes and graphs, while still leaving you the possibility to write a path by hand, should the need arise. Moreover, consider that even if you stay wit the lowest level API, the data you have may be dynamic, so that it may be easier to call a function with parameters at every frame, rather than hand-concatenating string (although this use is admittedly rather limited)
- bshimmin 12y agoI guess you didn't make it more than a third of the way through the README. This looks super useful for the many circumstances where interpolating things into strings to generate SVG paths is quite unpleasant (ie. anything much beyond "M #{x} #{y}").
- mambodog 12y agoConsider, why do people use SQL query builders when you could just use a string?
- josteink 12y agoNot sure you actually meant it as a question, but just to spell it, in case someone might actually consider it a genuine question. SQL query builders can have the capability that they make queries composable. Sending a string around will require you to do double and tripple check for parameters, logical combinations and what not in every step of a composable action. Besides that, most SQL query composers assist you in isolating parameters from query, and this protects you from SQL injection.
- untog 12y agoYes, which is actually very useful once you start doing things like working with variables.