Image for post
Image for post

Introduction

This is blog is enforced upon me because I wrote an earlier blog comparing class components and functional components in Reactjs. However, towards the end of that blog I wrote that the main differences in use case between the two are nonexistent due to the implementation of React Hooks. I did not want to write an entire blog within another blog explaining Hooks. Thus, this article is to expand my knowledge on React hooks and explain what they are and why should we use them.

What are React Hooks?

To further my knowledge of React Hooks, I did what any level-headed programmer would do, READ THE DOCS! (sorry for the text screaming but that’s how reading documentation was emphasized to me since it’s such an important concept). If you go to Reactjs’s site and look at the hooks overview, they do an amazing job explaining the concepts of Hooks and the very questions I have put in the title. …


Image for post
Image for post

When I first started learning about React Components, other than the obvious differences, I didn’t know exactly when to use a class component over a functional component. Thus, I figured I should learn more about the two and write about them! This article we will go over the pros and cons of each component, the syntax for each, and in which cases should utilize which component type.

Obvious differences

The obvious differences are in the syntax and hints are derived from their names in how they will be written. They both render JSX (which is React’s way of writing HTML and JavaScript), however for the class component you define a class that extends the React.Component library. Additionally, the class component utilizes a render() method. …


Image for post
Image for post

In this article, I concisely explain the notion of memory leaks in computer science and how by simply understanding memory leaks will help you code your application more efficiently. As many others, I often heard the term “memory leak” through my travels as a beginner programmer but I never fully understood what they are and what to do about them. Thus, this blog is aimed towards beginner programmers or programming students such as myself to increase knowledge on this subject.

What are Memory Leaks?

Firstly, what’s a memory leak? As programmers, we know that the code we write takes up memory. Anytime objects or variables are created memory space is required each time the program is executed. Essentially, a memory leak is when memory is allocated for something but is no longer needed and now occupying RAM needlessly. One way to think of this if you turn on the faucet and the water is running but when you are done with whatever you needed the water for, you simply turn it off. …


Image for post
Image for post

This article will briefly introduce and describe Functional Programming (FP) and Object-Oriented Programming (OOP). Moreover, this article will compare the two paradigms to see some differences between amongst one another. Hopefully, this article may help you recognize which programming approach you will want to lean towards.

Object-Oriented Programming (OOP)

For a quick definition let’s look to Techopedia’s definition on their site: “Object-oriented programming (OOP) is a software programming model constructed around objects. This model compartmentalizes data into objects (data fields) and describes object contents and behavior through the declaration of classes (methods).” (https://www.techopedia.com/definition/3235/object-oriented-programming-oop). In other words, OOP performs with the concept of “objects” containing data in the form of attributes. …


Image for post
Image for post

You may be considering a full authentication solution for your Ruby on Rails app. Well, what if I told you can create an entire MVC setup for user authentication by just installing a gem?


Image for post
Image for post

As you continue your journey as a beginner “rubyist” you will notice an increase in complexity in the coding challenges or “labs” you are approached with. That being said, in these early stages you’re probably just “printing” or “putsing” your code for testing or inspection purposes. This may be helpful and can work for now, however when the data gets more intricate those methods will lose effectiveness. Maybe, you’re just relying on the Test Driven Development (TDD) setup using the test results to help you understand your code and help you pass. That shouldn’t be the primary goal of your coding mindset nor is it practical down the road, as I’ve learned. So what’s the solution? …

Ashab Ahmed

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store