Theo Blog

"You have to do the best with what God gave you." - Mrs. Gump

Dependency Injection

Nestjs

“Dependency injection In software engineering, dependency injection is a programming technique in which an object or function receives other objects or functions that it requires, as opposed to ...

Race Condition

Ruby on Rails

“Race condition A race condition or race hazard is the condition of an electronics, software, or other system where the system’s substantive behavior is dependent on the sequence or timing of ot...

Ruby - Blocks

Ruby on Rails

“Blocks” What are blocks? Blocks are enclosed in a do / end statement or between brackets {}, and they can have multiple arguments. The argument names are defined between two pipe character...

Manage package.json

Javascript

What is package.json package.json is a file that manages information about the current project and the dependencies of modules installed through the package manager (npm, yarn). It is usually loca...

Duck typing

Design pattern

Duck typing “If it walks like a duck and it quacks like a duck, then it must be a duck” What? Duck typing is a type of dynamic typing, and a set of variables and methods of an object determi...

Exception handling

Ruby on Rails

Why exception handling? Even if software engineers write codes perfectly, there are usually unexpected cases that they can not fully cover in many edge cases. we often say never trust users. we...

Why type assertion is bad in Typescript?

Typescript

Overview One of TypeScript’s primary design principles is that “Statically identify constructs that are likely to be errors.” While TypeScript provides type safety, it also gives us the abili...

How to work with Javascript Clipboard API

Javascript

Overview Clipboard API I have got a feature request that users can copy a web URL address by clicking a button. this way, users simply can copy and paste any given text. How? 1. document.exe...

Class eval vs Instance eval in Ruby Meta programming

Ruby on Rails

Overview Class eval and Instance eval sometimes confuse me so I want to make an article to understand them better. The confusing part was their naming. they create exactly opposite things to what ...

Unit test and test double

Ruby on Rails with Rspec

Fail first, I am not afraid of failing. I am saying this in my real life. For example: Before starting to say anything about testing, I can’t forget to say about Uncle bob because I have lea...