News for hackers. Stuff that matters.
Re:Show HN: Textures.js, SVG Patterns for Data Visualization by ttty on Wednesday March 18, 2015 @06:51PM (#9229183)
Image you have an UI which talks to this. For example you have a button on/off. How would you do?

    var t = texture().lines().stroke('red')
    if(this.button.on) t= texture.heavier()
Compare the previous with this one.

    var t = texture({lines: true, heavier: this.button.on, stroke: 'red'})
I also hate the non standard constructor: this should be like this

    var texture = new Texture({lines: true, heavier: this.button.on, stroke: 'red'});
Re:Show HN: Textures.js, SVG Patterns for Data Visualization by siddboots on Wednesday March 18, 2015 @11:53PM (#9230118)
"heavier: this.button.on" has ambiguous semantics. Do libraries really use this pattern?

Also, use of the "new" keyword is contentious. You can hardly pretend that it is best practice.

Re:Show HN: Textures.js, SVG Patterns for Data Visualization by ricsca on Thursday March 19, 2015 @10:50AM (#9232300)
It should be

    var t = texture().lines().stroke('red')
    if(this.button.on) t.heavier()