Live data from Hacker News

ƒu.js - The Functional DOM traversing library.

tsenart.github.com

41–47 of 47 posts

Re: ƒu.js - The Functional DOM traversing library.

#41
post #36

Earlier quoted context omitted.

I do that to be able to do: ƒ('ul li:nth-child(2n)', 'style.background = "black"').

A better way to do that would be to split() it first on '=' then, split() the left side on '.' and iterate the results. You don't want to evaluate just anything anyone puts in that second argument.

Well... Actually I do.

Re: ƒu.js - The Functional DOM traversing library.

#42
post #27

There are alot of bad practices being used in this code. It gives the impression that you've (ab)used JavaScript for a long time, but haven't actually bothered to read the 101 introduction to the language. E.g.: try { eval('el.' + argv[1]); return el; } catch(e) { return null }; Why in the world would you do this? JavaScript has property access via bracket syntax for a reason: return el[argv[1]] || null; Give this a…

Using JavaScript is a bad practice!

Re: ƒu.js - The Functional DOM traversing library.

#45
post #41

Earlier quoted context omitted.

A better way to do that would be to split() it first on '=' then, split() the left side on '.' and iterate the results. You don't want to evaluate just anything anyone puts in that second argument.

Well... Actually I do.

If you want to eval anything anyone passes you with no consideration for what it could be, then I have to agree with OP that you must not be aware of the pitfalls of using eval.

Consider that the "black" portion of that argument actually comes from user input and that you were passed instead:

black"); alert('This framework is awesome!

Try eval'ing that.

Re: ƒu.js - The Functional DOM traversing library.

#46
post #19
post #13

Earlier quoted context omitted.

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.

There's also value in being right, which he definitely is. Whether anyone likes it or not, brutal honesty pushes everything forward.

Brutal honesty doesn't push things forward any faster than honesty.

Re: ƒu.js - The Functional DOM traversing library.

#47
post #46
post #19

Earlier quoted context omitted.

There's also value in being right, which he definitely is. Whether anyone likes it or not, brutal honesty pushes everything forward.

Brutal honesty doesn't push things forward any faster than honesty.

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.

Post reply on HN