Hacker News new | ask | show | jobs
by GaiusCoffee 3983 days ago
This JS "library" contains one function:

> function fuzzysearch(r,e){var n=e.length,t=r.length;if(t>n)return!1;if(t===n)return r===e;r:for(var f=0,u=0;t>f;f++){for(var a=r.charCodeAt(f);n>u;)if(e.charCodeAt(u++)===a)continue r;return!1}return!0}

I mean.. come on, guys. This is getting absurd..

4 comments

Libraries that can be explained quickly and have good marketing material gain traction.

The popularity of my projects appear to be nearly inversely proportional to their amount of complexity and sophistication. Things I've been refining over 5 years like (https://github.com/kristopolous/EvDa) has a userbase of 1, while my occasionally evening hacks have significantly more traction.

At least for me, working long and hard on things I believe are of value and writing tests, dogfooding, and documentation basically means it's just going to be used by me ... bizarre but true.

> This is getting absurd

I honestly wonder why you believe that.

Efficient algorithms are hard, even when their implementation is small. Having a good algorithm as a library lets you rely on it instead of writing your own.

Libraries shouldn't have the requirement to be bloated.

Why should we only have huge libraries like jquery full of stuff we never use?

Think about Linux: it's all about lots of small applications all doing one small thing each.

How is JS different?

Look at it this way, it's a collaborative effort to write the most efficient function.