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

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!"



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.


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.


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.


True, I think it was my stupidity. Sorry about that.


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 :).


Why not

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




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: