One thing I realized as a programmer is that, we try to avoid repetition in our code, but we repetitively go to the same website to check the exact same syntax many many times. Let’s take a quiz:

Say you are building a restaurant app backend with rails. What is the correct syntax to claim a restaurant has many customers through orders.

A: has_many :Orders
has_many :Customer through :Orders
B: has_many: orders
has_many: customers, through: orders
C: has_many :orders
has_many :customers, through :orders

Which one do you think is the correct answer?

3
2
1

If you say C, congratulations! You are, the closest! Yes, none is correct. The correct answer is:

has_many :orders

has_many :customers, through: :orders

If you are super detail oriented and figured out none of the top 3 were correct, well, you still need this note because you will forget.

The goal of this note is that, if you are a full stack developer who uses rails and react very often, you will not need to go to the same 10 websites a thousand times to check for the same syntax, you only need to visit this blog 1000 times.

#rails #full-stack #react

Programming Note on Rails Backend and React Frontend With Example
2.45 GEEK