Code packages are great, but they are also dangerous by@dhkelmendi

Code packages are great, but they are also dangerous

Dhurim Kelmendi HackerNoon profile picture

Dhurim Kelmendi

source: Unsplash

While I was developing a Laravel web application, as a feature, I had to implement the tree view of an Eloquent Model. What this means is that each model instance can be a parent, sibling or a child of another instance of the same model.

Normally, this would be implemented by adding a field parent_id in the corresponding table, which would hold the id of the parent. This is the easy part. The hard part, however, is implementing helper methods which fetch the parent, sibling(s), and child/children. Thankfully, there is a package which handles all this for you. It is called Laravel NestedSet. This package gives you many helpful helper methods out of the box, such as all the way from saving a node, to fetching a node as a tree.

Someone might say: Why is this special? Well, even though PHP, and Laravel have a huge community, developers do not always find packages like this, which give out of the box implementation of functionality. Comparing it to the Ruby, and especially the Ruby on Rails community, the PHP community falls a bit short of this aspect. Because of this, Ruby on Rails developers live a happy life, mostly configuring gems, which are packages in the Ruby world.

While having many benefits for developers, I see this as a threat. Why? Because it removes the challenging aspect of development, and makes it easy to implement almost anything using implemented gems or packages. This is great for developers, as they can come out with results really fast. But, while making their job easier, it also makes development seem like a job that only involves package or gem configuration, and it is not at all true. Software development involves a lot of problem solving and decision making, and these are the skills that make a great developer.

Personally, if a job is not exciting and challenging, I will not be attracted to it. While developing web applications with some frameworks, I find that I only have to find what package to plug in, and what configuration I need to make. Of course, this is not all there is to implementing a feature, as every software program has its special functionalities, which also brings new challenges for developers.

So, whether you like more challenges, or more configurations, you will have to choose between a community like the Ruby on Rails’, or one like Golang’s, which while being a relatively new language, has many packages, but also brings many challenges while developing. If you want to have many packages that make your life easier, I would not prefer to use a language like, say Elixir, which is a new language with quite a small community. But, if you prefer challenges more than having tons and tons of packages, you will choose regardless of the community.

This is not a rant against any community/language; rather it is an insight on how day-to-day development looks like when you are a part of a community which offers many packages, compared to other communities which do not.

I like using packages occasionally, especially when time deadlines are approaching. But, I prefer to implement things on my own, given that I have the time luxury to do so. The reason behind this is that I want to keep myself excited and learn all the time, which one can only do if one digs deeper and gets one’s hands dirty.

Feel free to email me if you have any questions, challenging opportunities, or you just want to say hi.

Finally, be sure to follow me so that you do not miss any new stories I publish.