top | item 8047741

Show HN: A Javascript library to overcomplicate Five

69 points| joezo | 11 years ago |jackdcrawford.github.io

28 comments

order
[+] filearts|11 years ago|reply
Thanks for sharing, but in my app I really need five to be six. If you could address this one small issue I'm sure your lib would see much more use.
[+] joezo|11 years ago|reply
You can get 6 with `(five() + (five()/five()))`
[+] morley|11 years ago|reply
var six = five() + five() / five();
[+] jgillich|11 years ago|reply

    five.tooSlow = function() {
        var returnIn = new Date(new Date().valueOf() + 555);

        do {} while(new Date() < returnIn);

        return five();
    };
Finally a way to escape callback hell. I think somebody should write a jQuery.ajax plugin that calls the function repeatedly until a request is finished.
[+] sfeng|11 years ago|reply
That actually wouldn't work, as the response from the request would never be processed while you were looping.

You can make synchronous requests already though:

    req = new XMLHttpRequest
    req.open("some/url", "GET", false);
    req.send()
[+] zaptheimpaler|11 years ago|reply
I poked around at the source code and this really doesn't seem to be web scale at all. Please look into mongodb to store the five, maybe throw in Redis to cache five in memory, and consider using a real-time processing framework like Storm to implement mapping and reducing five.

Until then I'm afraid this is just far too slow to consider using seriously in my web-scale project. This probably cant even handle 100M+ requests/second. Right now, its just me and grandma so I need 2 requests/sec, but this really doesn't seem scalable.

[+] mooreds|11 years ago|reply
I'm a little disappointed the test doesn't verify correctness addition, subtraction, multiplication or division.

Sigh. I suppose I'll have to submit an issue and pull request.

[+] hacliff|11 years ago|reply
This can't be right, nowhere near enough dependencies
[+] talles|11 years ago|reply
Can't wait until it reach version... 5
[+] andrey-p|11 years ago|reply
Whoah. The Mongolian word for "five" means "ceiling" in Bulgarian.
[+] neals|11 years ago|reply
Wake up sheeple!
[+] dclowd9901|11 years ago|reply
Really makes me wish you could invoke instance methods on numbers (ala 5.amIFive())
[+] Softcadbury|11 years ago|reply
You can :)

Number.prototype.amIFive = function(){ return this.valueOf() == 5; }

5..amIFive();

[+] weddpros|11 years ago|reply
Who's gonna write Flappy Five in JS?
[+] sramsay|11 years ago|reply
But what good is a five overcomplication library without overly complicated documentation?
[+] assertnotnull|11 years ago|reply
This will be ported to GWT 5.5.0 in a FiveLabel. It would fit nicely.