Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: A Javascript library to overcomplicate Five (jackdcrawford.github.io)
69 points by joezo on July 17, 2014 | hide | past | favorite | 28 comments


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.


You can get 6 with `(five() + (five()/five()))`


var six = five() + five() / five();


var six = function() { return five() + five() / five(); }

Some people may rely on that functionality.


    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.


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()


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.


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.


This can't be right, nowhere near enough dependencies


Can't wait until it reach version... 5


Whoah. The Mongolian word for "five" means "ceiling" in Bulgarian.


Wake up sheeple!


Really makes me wish you could invoke instance methods on numbers (ala 5.amIFive())


You can :)

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

5..amIFive();


Ah, so you have to have two dots... I suppose the first one denotes the floating point value, and the second denotes the prototype accessor. Very clever.


(5).amIFive();


AHA! I knew it! ALL THINGS HAPPEN IN FIVES. What can't you accomplish with this library?

http://principiadiscordia.com/book/23.php


finally. shame it's not written in the much more scalable coffeescript.


Give it a day and someone will have ported it ;-)


How about two hours? https://github.com/vladh/five-coffee

`five-coffee` on npm.



But but but I did it first! And you didn't even publish it to npm. :C

https://github.com/vladh/five-coffee


Mine's class-based and compiles to javascript on install. HOLD DAT! ;)


oh snap



Who's gonna write Flappy Five in JS?


But what good is a five overcomplication library without overly complicated documentation?


This will be ported to GWT 5.5.0 in a FiveLabel. It would fit nicely.




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

Search: