Today I just read this post on Medium
The author uses a strong language but from the first lines I understood his points, because I face them often. Most developers (including myself) have this routine:
- I need a piece of code in order to do X
- I google and I find library Y
- I like library Y but after a couple of hours library Y is not enough for my needs
- If the descrepancy is small and the source is available I fork library Y
- If the descrepancy is big I throw away library Y and I code from scratch
Let’s say we are lucky and the library suits perfectly. After few months I need to modify the code or I must update a dependency, the castle starts to fall apart. Real dev situation: DropNet.
DropNet is a fantastic .NET library to interact with Dropbox, few lines and you are ready to go. The downside is that DropNet rely on RestSharp, a precise version of RestSharp.
The NuGet package says under Dependencies RestSharp (≥ 105.0.1).
The ≥ is a lie, if you update RestSharp to a newer version (because another project requires it) DropNet will throw an exception.
This was the first point, everytime you rely on something you didn’t create you need to consider the hidden cost. 95% of the time you will not have problems, the remaining 5% normally is balanced by the time the library saved you compared to the time you spent to fix the issue. If you spent more time fixing external components than actually use them you learned a lesson (and I learned a lot in this way).
But I’m a dinosaur, a slow one, and I want simple things. Another real dev situation happened few days ago: Lightbox.
For my previous post I needed a library to show some pictures, I used Lightbox in the past but I wanted to try something new, then I googled and I found PhotoSwipe.
Looks nice, GitHub link, source code available. I read the readme and I see
- NPM: npm install photoswipe.
- Bower: bower install photoswipe.
I think (because I’m a dinosaur): “why I need to install all the nodejs stuff in order to get a client library, just give me the code and I can attach to my template.”
I downloaded the code but the structure of the library made me switch instantly to Lightbox. Lightbox is also available for NPM and Bower, but the instructions to setup the library with just the source code are available in the main page: copy the files inside your folder, refer the files in your code, add one tag and you are ready.
Of course mine are just two examples and the use of NPM (or Bower or Angular, you name it) gives you many advantages, but we need to consider that not all the developers use the last technologies or they are able to follow the trends. Many
dinosaurs developers write code because they have a full-time job, not just for fun. Try to tell to a classic ASP dev “tomorrow you start to rewrite all the application using Node.js”, probably he will like Node.js but definitely not in the first two weeks.