![]() Ruby Gems are sets of code that implement common functionality. In Ruby, we address this issue by using third-party libraries known as Gems. So while it might be a good learning exercise to write your own solution to one of these problems, ultimately your application would be best served by using one of these pre-existing solutions. Once you start trying to add complex functionality–such as HTTP communication between different applications–you will often find yourself working in well-defined problem domains that have well-known solutions. You can mitigate this issue by encapsulating the code into separate classes–which solves the reuse problem–but this solution only scales to a certain point. This repetition is obviously inefficient since now any changes to that code need to occur in multiple places when you introduce a new feature or a bug fix. We’ll also take a look at managing gem sources, giving you more options to install additional functionality libraries from various third parties.Īs your software code base grows more complex, you may find that you have to write the same code multiple times. In this article, we’ll look at how Ruby solves the problem of code reuse in a repeatable way with Ruby Gems. Most programming languages give you some way to package common code, making it reusable across multiple applications. ![]() Programming often involves repetitive tasks. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |