Live data from Hacker News

Plink-plonk.js – hear webpages render with DOM observer and audio API

gist.github.com

11–20 of 61 posts

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#12
post #10
post #7

Earlier quoted context omitted.

Just minify it...?

Imagine still using semi-colons in JS source in 2020 and "bookmarklet compatibility" being your reasoning.

Semicolons in JS is how you differentiate between someone who understands that code ambiguity leads to pain, vs someone who shouldn't be allowed near multi-line statements.

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#13
I once did something similar. There is this strace-like program for Windows that captures things like memory allocations or mouse movement as part of the Win32 API. I modified the source so it emitted an OSC message on every trace and sent it to PureData which would output MIDI. The result was, well, pure cacophony. But it was amusing to, for example, belt out a dissonant piano piece by typing in VIM or use calc.exe as a (really shitty) drumpad.

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#14
post #10
post #7

Earlier quoted context omitted.

Just minify it...?

Imagine still using semi-colons in JS source in 2020 and "bookmarklet compatibility" being your reasoning.

Imagine not understanding why bookmarklet compatibility is cool for something like this and putting people down for it with a cheap "it's 2020" meme.

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#15
post #12
post #10

Earlier quoted context omitted.

Imagine still using semi-colons in JS source in 2020 and "bookmarklet compatibility" being your reasoning.

Semicolons in JS is how you differentiate between someone who understands that code ambiguity leads to pain, vs someone who shouldn't be allowed near multi-line statements.

Honest question: how often does the code ambiguity due to lack of semicolons lead to non-obvious bugs? I'm nowhere close to being a JS expert, but I've done some JavaScript-heavy pet projects and I've got an ambiguous statement interpreted wrong exactly once, and the cause was pretty obvious within a minute of looking at the error.

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#16
post #14
post #10

Earlier quoted context omitted.

Imagine still using semi-colons in JS source in 2020 and "bookmarklet compatibility" being your reasoning.

Imagine not understanding why bookmarklet compatibility is cool for something like this and putting people down for it with a cheap "it's 2020" meme.

A bash one-liner solves this problem for you. If you think it's "cool" to execute JS as a bookmarklet you are free to distribute your own version of the library. The original commenter was the one "putting people down" by demanding the author do it "the right way".

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#17
post #12
post #10

Earlier quoted context omitted.

Imagine still using semi-colons in JS source in 2020 and "bookmarklet compatibility" being your reasoning.

Semicolons in JS is how you differentiate between someone who understands that code ambiguity leads to pain, vs someone who shouldn't be allowed near multi-line statements.

Please give a concrete example of this pain that you have actually experienced. I understand that ASI (automatic semi-colon insertion) is in theory ambiguous because you are relying on the compiler, or in some cases many different compilers, to execute the statement correctly. In practice, for over a decade, I have never run into such an issue. I suspect it's due to engineers trying to get too cute with their implementations.

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#19
post #12

Earlier quoted context omitted.

Semicolons in JS is how you differentiate between someone who understands that code ambiguity leads to pain, vs someone who shouldn't be allowed near multi-line statements.

Honest question: how often does the code ambiguity due to lack of semicolons lead to non-obvious bugs? I'm nowhere close to being a JS expert, but I've done some JavaScript-heavy pet projects and I've got an ambiguous statement interpreted wrong exactly once, and the cause was pretty obvious within a minute of looking at the error.

If you accidently write a comma instead of semicolon it can have interesting effects.

Re: Plink-plonk.js – hear webpages render with DOM observer and audio API

#20
post #17
post #12

Earlier quoted context omitted.

Semicolons in JS is how you differentiate between someone who understands that code ambiguity leads to pain, vs someone who shouldn't be allowed near multi-line statements.

Please give a concrete example of this pain that you have actually experienced. I understand that ASI (automatic semi-colon insertion) is in theory ambiguous because you are relying on the compiler, or in some cases many different compilers, to execute the statement correctly. In practice, for over a decade, I have never run into such an issue. I suspect it's due to engineers trying to get too cute with their impleme…

    if(foo)
      doX()
      doY()
Post reply on HN