Bogdan Crudu

Movie rental refactor challenge


I got this refactor challenge for a simple ruby script that has 3 objects and produces a statement. In effect we have a Movie object, a Rental object and a Customer object. The purpose of the script is to print out a statement with the customer’s name, order, amount due and frequent renter points. The [...]

How To write an Armstrong number checker


Hello there, and for those of you who have read my previous work, welcome back. Now, what is an Armstrong number: “In recreational number theory, a narcissistic number (also known as a pluperfect digital invariant (PPDI), an Armstrong number (after Michael F. Armstrong) or a plus perfect number) is a number that is the sum [...]

How To Write a Custom Decoupled CSV Importer


Hey there! Last time I spoke about how to add a bit of microservices style architecture flavor to your monolithic app and the benefits of doing it in such a way. Now I’m going to go through a concrete working example of a modularly built, ‘plug-in and play’, intuitive and reusable CSV importer. We’ll have [...]

Applying Microservices Style Architecture to Monolithic Apps


Def: Microservices is a software development technique—a variant of the service-oriented architecture (SOA) architectural style that structures an application as a collection of loosely coupled services. – wikipedia “A collection on loosely coupled services”. Bit of a brain twist. Ok, loosely coupled we get from the get-go, it’s good software practice and design, but what [...]

Finding And Promoting Abstractions In Your Code


Throughout my posts and in many many other articles, books, booklets and almost all (good) IT materials, you keep hearing the same over and over again, repeated almost like a mantra – “Find the abstraction and use it” – it’s good and all, but how you should go about it is almost always lacking in [...]

Modules and the Method Lookup Path


In the previous post “Organizing Your Code With The Help Of Modules” we created our very first outline of a module (though very basic) and mix it in a class via the include method (in this case we can refer to modules as mix-ins). If you haven’t noticed by now, the act of mixing in [...]

Organizing Your Code With The Help Of Modules

1 comment

We know about classes and how they are an Object defined to “huddle up” like minded or similarly goal oriented objects (namely methods) and we know about class hierarchies, the perils that it imposes on our code through the thing called classical inheritance and how namespacing matters because the names we choose for our objects [...]

Classical Inheritance In Object Oriented Programming

1 comment

If you’ve been eying the opportunity to become a computer programmer for some time now, or even if you’ve just started venturing out onto this great and noble journey, chances are that you’ve hit yourself with this term quite a few times whether in books, booklets or even documentation sites, Classical inheritance has always been [...]