TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Andro.js

49 pointsby maryrosecookabout 13 years ago

4 comments

swannodetteabout 13 years ago
Nice post! It's interesting that hardly anyone has chimed in that some programming language features make addressing this problem considerably simpler without forcing the programmer to write excess boilerplate. Objective-C delegation, JavaScript Proxies <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Proxy" rel="nofollow">https://developer.mozilla.org/en/JavaScript/Reference/Global...</a>, ClojureScript protocols all provide the machinery to make this kind of thing work without making the code too hard to reason about.
david_a_r_kempabout 13 years ago
I really like the loosely coupled approach.<p>However, I think that sprinkling andro.eventer all over the place is a stumbling block to me - it's essentially a global variable.<p>I realise that you don't want to polute the objects too much, but why not just add bind and emit methods to the composed object? Either that or pass andro as a parameter to the mixin's setup method?<p>Also, the bind(this, "touch", function...) to me looks like you're binding to the "touch" event of "this". Is the closure tax really so high that you can't store "this", or use something like jQuery.proxy()?<p>Like I said, I think this approach has a lot of potential, and seems to fit quite naturally the eventful model that the DOM uses.
评论 #3616742 未加载
jcromartieabout 13 years ago
I wish Node.js had not introduced "evented" as an adjective, leading to "event" as a verb and "eventer" as a noun...
revelationabout 13 years ago
string hell squared.
评论 #3616383 未加载
评论 #3616381 未加载