News for hackers. Stuff that matters.
Re:30 years later, QBasic is still the best by kragen on Friday May 06, 2016 @06:17PM (#11647091)
That's really a question of the APIs you're using rather than the language. If you're using a browser, you don't even need JS to draw the line; you can just go to this URL:

    data:text/html,<svg><line x1=0 y1=30 x2=40 y2=50 stroke=black>
If you're using an API other than the browser, it can be super simple. Like, with processing.js, http://sketchpad.cc/sp/pad/view/zdsBK2b9xo/latest consists of:

    line(0, 30, 40, 50);
and that works. (Although you could surely argue that the language of processing.js isn't itself JS, but you can invoke its facilities from JS.)

There are also clumsier ways to draw lines, like with DOM manipulation in SVG or drawing stuff on a <canvas>, and those might be desirable for the extra flexibility they give you. But you don't have to start with them.

Re:30 years later, QBasic is still the best by krapp on Friday May 06, 2016 @06:41PM (#11647222)
>and that works.

Depends on the browser. IE > 8 doesn't support it.

Re:30 years later, QBasic is still the best by kragen on Sunday May 08, 2016 @09:31AM (#11653974)
Are you saying processing.js doesn't work in IE after IE 8?
Re:30 years later, QBasic is still the best by krapp on Sunday May 08, 2016 @10:54AM (#11654269)
IE 8 and above only supports image data URIs within CSS, link and image tags[0]. Processing.js probably works around that with Canvas or something.

[0]https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs