5 ms·
Because for some people, they don't want to spend the extra time to build and maintain a solution that they are now responsible for. `npm install --save faker`
by jffry 5y ago
Because for some people, they don't want to spend the extra time to build and maintain a solution that they are now responsible for.
`npm install --save faker` and boom you have access to a huge variety of random test data, across different locales. Doesn't stretch my imagination to see the appeal.
- exdsq 5y agoSure but realistically most people only use a few of fakers features right? It’s not that time consuming to make in-house. And after those few hours of work you don’t have a dependency/new security vector to consider. I guess the JS ecosystem like to import everything (isOdd).
- jffry 5y agoBuilding something in-house comes with its own sets of pros and cons, which can be compared against the pros and cons of taking a new dependency. The balance and the "correct" decision will vary by team/project/org.
- exdsq 5y agoOf course! That's good engineering. However I argue that the default is far too often to use something 'off-the-shelf' and trusting it A) works, B) is secure, C) is supported, and D) will remain so for the lifetime of your project. I wonder if those who say "2 days?! Just npm install!" answered those questions, or if they googled "nodejs fake data generator" and installed it onto their businesses main product in the next 5 minutes.
- deleted 5y ago[deleted]
- abraham 5y agoNote that for this new community version its: `npm install @faker-js/faker --save-dev`
- exdsq 5y agoThis just helps my point, I believe. Someone is going to google how to import fake data, find the npm repo with loads of downloads, import it, read a stackoverflow issue on how to use it, and not understand why it's broken for a while (because it's now a dead project). All so they can get a dictionary of first names and strings that look like addresses in a unit test somewhere, probably.
- DrFell 5y agoA lot of webdev is just pre-built stuff. When webdevs say "don't reinvent the wheel" it means "I'm too scared of doing it wrong to program it myself."
- ZephyrBlu 5y agoMore like "I don't want to waste time building something low impact when I could pull in a dependency and be working on something high impact".
- exdsq 5y agoIt's a combination of both. You're weighing up the time to build the right thing for yourself vs picking something up from the shelf. Specifically you have to factor in: 1) Is the project built correctly 2) Is it the correct project for your issue 3) Is the project maintained 4) Is the project going to be maintained for the lifetime of your project 5) Is the project secure, and how risky is including it to your project? And if these are all good then sure, it makes sense to include it in your project. And this is good engineering. But what people seem to do is go "Oh hey, I need to get a random name from a dictionary of names. Let's google that. Oooh faker!" without even thinking these questions through.
- slenk 5y agoNo, they value their time more than re-writing a known algorithm/pattern.