|
> Isn't that's just having a property/field on a struct/class/type/object that contains the list of tags? I have never used the library, but it seems you get a lot more with just 2-3 lines of configuration (e.g. for a tag context named „interests“): - The ability to find the n most or least used tags with a single method call
- The ability to track which user tagged a record
- The ability to find records with the same tags
- Calculation of tag statistics for a tag cloud Now, all that would certainly be possible with EF. But many libraries for Rails give developers a very simple way to configure a feature, and deliver very expressive methods to use the feature. Which is an important property imo, since it often makes obvious what the code does, even for newcomers. This is probably an effect from Ruby itself, where the standard library is quite expansive and has many often-used patterns built in. For example, calculating an arrays maximum value is just arr = [1,2,3,4]
arr.max
Meanwhile, in JS: arr = [1,2,3,4]
let max = arr[0];
for (let i = 1; i < arr.length; i++) {
if (arr[i] > max) max = arr[i];
}
And to address the README of the above library: I think it is a bit confusing because it starts with a comparison with another library, expecting readers to already know how tagging worked there. |
What's the chance that this is the exact set of features that you're gonna need and not a slightly different set of features? E.g. maybe your users are part of teams and you need to know which tags were set by a given team? Or maybe your tags are hierarchical? Will the library be flexible enough to accommodate that?
It just seems that this library makes a lot of assumptions about the business logic of your application - but that can change at any point and then you're possibly stuck with a library that you have to weirdly workaround, or rip out entirely.
I would understand that tradeoff if the library solved an actually complex use case, but every competent developer should know how to implement these use cases from scratch in a relatively short amount of time, and while it undoubtedly takes longer than just adding 2-3 lines of config, what you get in return is code that you own and understand and can modify in whatever way you want.