News for hackers. Stuff that matters.
Re:Please, do not install every shit by nukeop on Monday February 19, 2018 @10:06AM (#16413265)
This is the modern Javascript coding style - you install small packages that implement your required functionality. The idea is to not solve problems that were solved before by somebody else. After all, if you're going to include somebody else's code that you didn't write anyway, what's the better way to do it - copy & paste, or use a package manager with versioning and high degree of control over downloaded packages that lets you abstract the required functionality away into a single line?

What is to be avoided is inclusion of packages that implement a ton of functionalities, and then only using a very small subset of those. In these cases it's better to create your own solution.

Re:Please, do not install every shit by westoque on Monday February 19, 2018 @10:11AM (#16413304)
This is what separates experienced coders from amateurs imo. I’ve seen newer programmers tend to always “find” a library that would implement their required solution even what they needed is a super small subset of that library which could have been better off by just writing their own function.
Re:Please, do not install every shit by get on Monday February 19, 2018 @10:15AM (#16413335)

    what's the better way to do it
    copy & paste, or use a package manager 
When you add a dependency, how do you prevent the maintainer of the dependency or any sub- or sub-sub-...dependency to break your system in the future?
Re:Please, do not install every shit by nukeop on Monday February 19, 2018 @10:18AM (#16413360)
You do the same thing you'd do if anything else in your toolchain or runtime environment changes - change relevant code so it works again. Browsers change all sorts of stuff all the time and break millions of websites in the process. Easier to use a package manager to propagate the required changes to all dependent projects than copying and pasting bits of code between many different files.
Re:Please, do not install every shit by get on Monday February 19, 2018 @10:22AM (#16413386)
That sounds scary. That means the security of your system and data is at the mercy of all those maintainers?

I can't imagine any big companies work like that. Execute code on their servers which is under the control of 'somebody from the internet'.

Re:Please, do not install every shit by nukeop on Monday February 19, 2018 @10:28AM (#16413413)
I can't imagine the opposite could ever happen, be it small companies or big ones - there is not a single company on Earth that has the time to audit every line of every piece of software they run. Especially if that software is proprietary and source isn't even available.
Re:Please, do not install every shit by get on Monday February 19, 2018 @10:40AM (#16413480)
It's not about auditing every line of code. It's about a chain of trust.

I can not imagine that the security of Facebooks servers is at the mercy of a chain of anonymous coders.

Re:Please, do not install every shit by tpxl on Monday February 19, 2018 @10:36AM (#16413459)
You do what any sane package manager does and pin the version. Having the option to declare a dependency version as >= 4.0.3 is a bug, not a feature.
Re:Please, do not install every shit by get on Monday February 19, 2018 @10:43AM (#16413498)
So you first recursively read the code and the code of all the dependencies? And then pin it?

That sounds like a lot of work. Compared to copying/writing 30 lines.

How do you know the pinned version and it's dependencies do not get changed by the maintainers?

Re:Please, do not install every shit by tpxl on Tuesday February 20, 2018 @08:56AM (#16420300)
I meant as a solution to not breaking in the future. If you have a system with pinned versions that work, it will always work, regardless of the changes in new versions.