News for hackers. Stuff that matters.
Re:An alternative to alert() by envex on Tuesday February 26, 2013 @11:57AM (#5286755)
If you're going to build an alternative to something, it should be easier to use.

    alert("Your request has succeded!");
is way easier than

    $.globalMessenger().post "Your request has succeded!"
Re:An alternative to alert() by zackbloom on Tuesday February 26, 2013 @12:00PM (#5286782)
Would

    alert = $.globalMessenger().post
help?

Each time you call globalMessenger() it gets a chance to do some checking to make sure it's at the right place on the page and has the right classes, but if you're not doing anything fancy (like injecting it into a page which keeps getting rewritten), this should be fine.

Re:An alternative to alert() by envex on Tuesday February 26, 2013 @12:08PM (#5286838)
My main concern is the amount of typing especially when I'm just wanting to debug something with alert or console.log().

It seems like overkill for a function that's (mainly) used to debugging.

Re:An alternative to alert() by zackbloom on Tuesday February 26, 2013 @12:19PM (#5286923)
That's a miscommunication then. It's mainly for providing feedback to the user, e.g. "Document saved", "Error deleting user", "Can't connect to the server, retrying in 4", etc.

For debugging, you should probably use console.log.

Re:An alternative to alert() by envex on Tuesday February 26, 2013 @03:32PM (#5288381)
True, I think it was my stupidity. Sorry about that.
Re:An alternative to alert() by zackbloom on Tuesday February 26, 2013 @05:20PM (#5289061)
Not at all, it wasn't the best title. Thanks for pointing out the confusion. We (HubSpot) are all talking about writing an actual alert replacement now :).
Re:An alternative to alert() by lcampbell on Tuesday February 26, 2013 @03:32PM (#5288382)
Why not

    alert = (args...) -> $globalMessenger().post args...
This allows $globalMessenger to be notified for upkeep whenever the call to .post is proxied.