Web Development

There are some things that we just need to do to finish something fast. It’s inefficient but we can get back to later on. One of those examples is retrieving the fields you need from the database.

# Optimized way to get data 
SELECT first_name, last_name FROM users;
# Non-optimized way to get data
SELECT * FROM users;

In React, there some instances that we need to pass in props from one component to another and we are just too tired to do it right now. Here is a cool way.

Best way / Optimized

const { first_name, last_name, address } = this.props;
<ChildComponent
  first_name={first_name}
  last_name={last_name}
  address={address}
/>

Cool way / Non-optimized

<ChildComponent
 {...this.props}
/>

Remember that this isn’t the optimized thing to do

Screen shot 2017 11 15 at 8.54.00 am