Guru on Rails

Every known fact in natural science was divined by the presentiment of somebody, before it was actually verified. - Ralph Waldo Emerson
Thu 13 Sep 2018

Best Practices OOD

I actually intended to add this post to old article about the same title. However, I don't want to make an article too long. Regarding to this principle, there are so many things to learn. Because ...

Thu 13 Sep 2018

Ruby on Rails

Hook methods is actually the convenient way to help us extend the behaviors of existing class at runtime. In rails there are many popular hook methods we often use such as "included, extended, inhe...

Thu 06 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...

Thu 06 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...

Thu 06 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

Best Practices Ruby on Rails

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. ...

Thu 23 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...

Thu 23 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...

Fri 17 Aug 2018

Best Practices OOD

I have to say that we tend to make the attributes of class become messy. Attributes are the characters to distinguish class from the others. These ones make them different. It’s like black people w...

Mon 10 Sep 2018

Best Practices

When we were Junior developer we didn't actually notice so much about exceptions in ruby. That is because we didn't develop library to contribute the community yet. If we used to create libraries o...

Thu 23 Aug 2018

Software Architecture Design Patterns

The topic today is again Object Oriented Design. We just have three words O-O-D though. Naming I’d like to say that OOD is not just about Inheritance. When we put some classes there and make them i...

Wed 15 Aug 2018

Software Architecture Ruby on Rails Design Patterns

Have you ever considered about using class inheritance or modules while coding? So, when do we decide to use inheritance instead of module? Coding design is just about arranging code in our applica...

Tue 07 Aug 2018

Performance

One of the performance matter we usually encounter is Enumerator. Today, I introduce you a kind of performance issue we ever faced about enumerator. That's Enumerator in ruby. The case is when we e...

Mon 06 Aug 2018

Design Patterns Ruby on Rails

What are the reasons for using Inheritance and Composition. Speaking of Inheritance, we refer to class, for Composition we refer to Module. We should know the main idea from this design. Why do we ...

Sat 30 Jun 2018

Automated testing

Ruby on Rails and automated testing are going together, hand in hand. As many language programming, Rails has it's own testing framework. It support automatically to create boilerplate test files.

Sat 30 Jun 2018

Development's ideas

Challenge: We do want to manage Status of model efficiently. Statuses will automatically changed whenever the data of model changed. However, we do want to define the condition for every status and the event allows statuses changed.

Tue 26 Jun 2018

Development's ideas

Challenges: We have to import a csv file. Sidekiq proceeds with this file in background. We need to show a message on the UI to let users know that the process is running. We use Javascript Interval to check job done at server.

Sat 30 Jun 2018

Development's ideas

Challenge: we need to build a function for searching including checkbox, plain text. There are many ways to do things. However, let's take a look on my idea.

Mon 18 Jun 2018

Software Architecture

Have you ever heard "Software Architecture"? So what is this? Software Architecture is simply Architecture of Software. There are many things in a software. Architects need to examine what is the importance and balance all of those things.