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.

Jsig - precise & concise javascript signature notation

25 pointsby jasondenizacabout 12 years ago

7 comments

opminionabout 12 years ago
TypeScript comes to mind. It's for a different purpose (jsig is meant only for humans) but formal annotations, if successful, will be read by machine.
评论 #5497217 未加载
评论 #5497209 未加载
tompabout 12 years ago
I guess this complaint should really be pointed at TypeScript, or even to C#, but also to Jsig...<p>It's really sad that different languages keep pushing `=&#62;` for "function" type, instead of `-&#62;`, which has been the standard mathematical notations for a long time...
评论 #5497380 未加载
评论 #5497542 未加载
stormbrewabout 12 years ago
I'm wary of things like this. They tend to require more cognitive effort than either of the alternatives: strict typing or a purist version of duck typing. That javascript makes either of those difficult or impossible (the former for obvious reasons and the latter because of flexible implicit conversion rules and an inflexible message receiver mechanism) is a failing of javascript that can't really be bandaided over with something optional.<p>I just think that this is, with even the best intentions, extremely prone to bitrot.
arcatekabout 12 years ago
I'm actually not really sure that it's more readable than the JSDoc way : /<p>I think that it's fine for very small projects, but if you want to share your docs, it's better to use an already conventioned syntax, which already solves edge cases (such as deeply nested callbacks).<p>For reference : <a href="http://usejsdoc.org/tags-callback.html" rel="nofollow">http://usejsdoc.org/tags-callback.html</a>
评论 #5497056 未加载
xxgregabout 12 years ago
If adding signatures to a codebase, why not use the closure syntax? Because then you also get a compiler which gives you nice warnings as well as better minification.
woahabout 12 years ago
This is awesome. Thanks for doing this.
jasondenizacabout 12 years ago
If you have feedback, please open an issue thread or pull request on github