Guru on Rails

A day a problem solved, a year we become the Pro

Wed 05 Sep 2018

Performance

I encountered this issue yesterday. It's hard to find the cause because of callbacks. We create objects and we use them somewhere in the scope. We created callbacks for models before but when we us...


Wed 05 Sep 2018

Uncategorized

Background jobs? In fact, in my point of view almost language programmings have background jobs, especially for web application. They appear to solve the problem of processes which run in long time...


Wed 05 Sep 2018

Uncategorized

Imagine that you want to investigate to use a ruby gem or a javascript library as fast as possible. How can we do that?  We usually tend to think of things complicatedly. We exaggerate the problems...


Tue 04 Sep 2018

OOD

Last article I introduced S.O.L.I.D in coding. I found that I didn't really dive deep in each principle as I thought. Programming is not about the chain of theories. We need to seek for the situati...


Wed 29 Aug 2018

Ruby on Rails Best Practices

In fact, Ruby on Rails (ROR) does help us a lot. It makes our code shorter. It's close to the natural language. The syntaxes are pretty nice. I can't agree more about these things. However, as a Ru...


Wed 29 Aug 2018

Ruby on Rails

Let's have a look on how to implement singleton methods in Ruby. will = 'Will Nguyen' def will.hello puts "#{self} says hello" end If we have many methods need to be implemented. class << wil...


Thu 23 Aug 2018

OOD

I wrote a bunch of articles about higher level of Object Oriented Design. But I think it's necessary to know the basic. Thus, that is the reason we have this article. Let's go through some points. ...


Wed 22 Aug 2018

OOD

S - Single Responsibility Whenever we create a class or method or even variable, we create each one with only one responsibility. If we create "sing" method, we can't implement "dance" behavior ins...


Tue 21 Aug 2018

OOD

When we look at the reality or a situation in real world, what do we see? Now I’m sitting at a coffeeshop in Vietnam and look around. I’m seeing people who are talking to each other. I’m seeing the...


Mon 20 Aug 2018

Design Patterns

1. Separating out the things that change from those that stay the same. Obviously, we do it to avoid the tight coupled code, get it easy to make changes with less cost. At first time when we put d...