Hacker News new | past | comments | ask | show | jobs | submit login

Ahh.... lovely, thank you. So what I'm referring to as "asynchronous javascript" is technically a colloquialism used to describe the event-driven callback-y nature of the code.

I'm not sure I'm still against referring to javascript as asynchronous or at least as having asynchronous methods for the purposes shorthand and quick communication.

Consider the code (or paste it into a chrome console)

     function _done(){ console.log(arguments) }
     var db = window.openDatabase("dbfoo", 1, "test db", 5e6)
     db.transaction(function(tx){
        tx.executeSql('CREATE TABLE t1(a, b PRIMARY KEY);', _done, _done)
     })
     console.log("i happen before the line above me")
Notice how the lines of code complete out of order. I think it's really useful to think of that as asynchronous code. It appears I'm using async as a term interchangeably with non-blocking... which may not be correct. So it may be the case that my nomenclature is off, but I'm sure I got that from somewhere. Perhaps a lot of people were referring to node as async in the early days, I'm re-watching this: https://www.youtube.com/watch?v=ztspvPYybIY now, but it doesn't look like Ryan Dahl uses the term async.

Anyways, looks like I'll have to train myself to use the right word for it. Thanks for pointing that out without making me feel dumb or being all insulting and internet-y. :) I really appreciate that.

EDIT: Hmmm... additionally, to be fair: it appears that some agree that it is OK to refer to parts of javascript as async http://stackoverflow.com/a/16524240/398055 so it might not be perfectly accurate, but it isn't wildly inaccurate either.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: