Cocktail By Ingredient

Zachary Williams
2 min readFeb 26, 2021

Cheers! I just finished building my first application. It has a command line interface(CLI) and uses an application program interface(API) to search for a cocktail by ingredient(CBI), pull the specs, and print them on the screen for you to use for your enjoyment. My background as a bartender inspired this idea, and with the help of my classmates and cohort leads it came to fruition. As simple as that sounds the process was much more complicated.

Over the past three weeks I’ve been learning to code using Ruby. Mostly learning basic ruby fundamentals and about object oriented programing(OOP). OOP was inspired by biology and the functioning of cells. There are four pillars of OOP; encapsulation, abstraction, inheritance, and polymorphism. Encapsulation bundles data and methods together into the form of classes, much like an individual cell. Abstraction takes complex processes and hides them. This makes the interface simpler and reduces the impact of change. Inheritance allows objects to share properties and methods. This reduces redundant code and helps implement another Ruby philosophy, don’t repeat yourself(DRY). Polymorphism allows objects to take on multiple forms. This is much like a person can be a parent, an employee, a sibling, and a friend. OOP allows objects to work together, share properties, simplify complex processes, and reduce repetition.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response