5 ms·
>As a PHP dev when I have to perform something is to find if there is a Linux CLI app that does this, install the app on the server and call it (like ffpmeg, wk
by ryukafalz 8y ago
>As a PHP dev when I have to perform something is to find if there is a Linux CLI app that does this, install the app on the server and call it (like ffpmeg, wkhtml2pdf, an epub to mobi app, etc) I can trust a CLI app that is packaged in Linux then a random package.
This is only better because your distribution has a curated set of packages with trusted maintainers that (in theory) read through the source code to make sure it's not doing anything malicious.
- buboard 8y agoalso because most of those libraries are just thin wrappers of other C libraries, which have already been vetted and most of the time are already part of the OS. Javascript reinvents everything .
- simion314 8y agoIs not JS itself, but the NPM culture where you instead of writing a few lines of code you include someone else package. So in my example the job was to get the video length, the dev tried to use https://github.com/eugeneware/ffprobe https://github.com/eugeneware/ffprobe if it all would have worked would have been faster but at the cost of not knowing what is happening under the hood and depending on this package that also seems to depend on 3 others(not sure if those also depend on others)
- buboard 8y agoI believe the culture started from people who didnt trust themselves to write good code. Also, the lack of preexisting libraries compatible with the async model led to de novo implementations of many things that are covered by wrappers in other languages.
- simion314 8y agoI agree, but I think you can call a CLI app using node without any need for at least 4 extra packages. IMO browser vendors should check some statistics , see what helper libraries are most popular and put those functions in the browser, similar for node, see what is popular and install that. Also the culture needs to change, when someone wants to explain how to create a thumbnail using image magic or other task that is just a wrapper then they should show the code on how to do it and avoid creating a new NPM package. I assume but I could be wrong that some developers think that having published npm packages, github repos, blog posts are helpful n getting better jobs so the culture of "CV programming" appeared where a lot of packages,side projects and blogs are created but the quality suffers.
- BigJono 8y agoI was hoping Gist would become this, a place for sharing patterns and implementations so that devs would learn what they're doing rather than just blindly playing npm lego. But it doesn't seem to have happened. I think the biggest problem with the JS community is that the mindset is always "implement first, understand second", rather than the other way around. It's ok to use libraries but you should at least have a think about how you would implement it yourself first, and understand at a basic level what's happening under the hood. Whenever I've brought up this idea the pushback in the real world is absolutely insane. Here on HN people are more receptive to the idea, but in most companies the mindset is just "shortest path to implementation at all costs". The ironic thing is that bigger companies, rather than giving their devs the time to learn, will force them to spend 80% of their effort on processes and unit testing to try and account for the shit code being produced in the other 20% of their time.
- jtbayly 8y agoWhich is, as you say, better.
- simion314 8y agoNot only that but I use the CLI app directly then using a package that wraps it and hides what is happening from you. Plus you will not have a surprise that an update (on an LTS server distro) removes your dependency, replaces it with malware or drops a feature. I noticed that my colleagues that never used Linux are not familiar with the CLI tools and the power this tools have so they are not trained to think "hey we can use this CLI tools and we can solve our problem" but they think let's search SO, GitHub, or NPM for a solution on how to do X with node/PHP etc.