News for hackers. Stuff that matters.
Re:ƒu.js - The Functional DOM traversing library. by Sephr on Sunday January 30, 2011 @02:08AM (#2157592)
Why would you use this over normal querySelector{All}? Also, why do you define a window.typeOf global? It completely defeats the purpose of using a clousure.

You also seem to be checking `typeof value.length == 'number' && typeof value.splice != 'undefined' && !value.propertyIsEnumerable('length')` to determine if something is an Array. First of all, the recommended practice is to check Object.prototype.toString.call(value) === "[object Array]", but since you're going to rely on latest browsers supporting querySelector{All}, you might as well use Array.isArray.

I'm sorry for being so harsh, but this is the most worthless library I have ever seen. You're adding an extremely thin and pointless layer of abstraction to querySelectorAll and polluting the global namespace with four globals, three of which are completely identitcal, and two of which take too much effort to type. Not to mention your use of worst practices (such as using eval(), only loose comparisons, wrapping all of your code in try..catch statements instead of just not doing things that will throw errors, etc.) and your prototypical pollution in Array, Document, and Element. For example, you define Array.prototype.flatten for internal use. You shouldn't pollute global prototypes for something that you can do privately.

Re:ƒu.js - The Functional DOM traversing library. by GrooveStomp on Sunday January 30, 2011 @03:12AM (#2157672)
I think you bring up valid points, but you should work on delivery. Your post is very offensive to read, even from someone who has no stake in this library whatsoever - even though I think you're right.

You've also got a lot of typos.

So, try to be helpful and encouraging instead of damning and dismissive? I'd appreciate that, and be more open to what you're saying.

Re:ƒu.js - The Functional DOM traversing library. by Klonoar on Sunday January 30, 2011 @06:24AM (#2157859)
His delivery is exactly what anybody is bound to get on the internet, and there's seriously nothing wrong with it. If you have an issue with brutal criticism like that, you should re-evaluate even spending time on this site.

This is, quite simply, the most _useless_ and badly written 'library' I've seen in some time. I applaud the author for pushing his work out there, but this is the part where you take criticism and run with it, fix it. Listen to Sephr, he's spot on.

Re:ƒu.js - The Functional DOM traversing library. by Sephr on Sunday January 30, 2011 @11:16AM (#2158307)
If my criticism is too forgiving, he may just brush it off and not take any action regarding it. I feel that he needed more brutal criticism so he might take some time to learn the "good" way to write JavaScript for any of his future projects.
Re:ƒu.js - The Functional DOM traversing library. by DTrejo on Sunday January 30, 2011 @03:19AM (#2157677)
Ouch. There is value in being able to handle extremely harsh criticism. There is also value in being able to say things nicely, with the knowledge that your words will be more easily heard by the person on the other end, and put to use rather than dismissed out of anger.
Re:ƒu.js - The Functional DOM traversing library. by Klonoar on Sunday January 30, 2011 @06:19AM (#2157847)
There's also value in being right, which he definitely is. Whether anyone likes it or not, brutal honesty pushes everything forward.
Re:ƒu.js - The Functional DOM traversing library. by swaits on Sunday January 30, 2011 @11:04AM (#2158282)
There is also value in not being a complete asshole about it. Especially when you're right.
Re:ƒu.js - The Functional DOM traversing library. by pg on Monday January 31, 2011 @01:39AM (#2160551)
Brutal honesty doesn't push things forward any faster than honesty.
Re:ƒu.js - The Functional DOM traversing library. by Klonoar on Tuesday February 01, 2011 @05:18PM (#2167691)
Brutal honesty places an impetus on the person being criticized to either fight back and prove why they're right, or to fix their code quicker.

Honesty without a push is just a statement and nothing more.

Re:ƒu.js - The Functional DOM traversing library. by paraschopra on Sunday January 30, 2011 @03:52AM (#2157712)
This may be irrelevant to original comment but does querySelector work in all modern browsers? My understanding was that it doesn't and so there is need for CSS selector engines like jQuery's sizzle.
Re:ƒu.js - The Functional DOM traversing library. by zootm on Sunday January 30, 2011 @07:20AM (#2157918)
I wondered the same thing so let me save you the search:

> http://help.dottoro.com/ljlumkqh.php

The page implies that there is limitations to the IE8 implementation, and that it's only available in relatively recent browsers. In addition, I believe that sizzle implements a set of selectors larger than most or all browsers support natively, although this I am less sure of; the Sizzle documentation certainly implies it strongly:

> https://github.com/jeresig/sizzle/wiki

Re:ƒu.js - The Functional DOM traversing library. by tsenart on Sunday January 30, 2011 @11:54AM (#2158420)
Even tough he is being harsh I guess he is right. I am not a ninja Javascript programmer and this is my first library. Thanks for the tips. I have a lot to learn. Also, this is a toy project made in one night that I had no internet access. If you don't like it, don't use it. I'm not selling it as the ultimate solution to all problems. It's my personal play and I learned with it and had no intentions of being so serious. If you noticed, I have the following on the README.md: "I'm sleepy. Don't know if this is too useful yet... Playing with Unicorns.(Unicodes)"
Re:ƒu.js - The Functional DOM traversing library. by tsenart on Sunday January 30, 2011 @12:03PM (#2158444)
Please fork. Let me know those good practices.