- Your team mates shouldn’t have to read the PRD to get context about code they are reviewing. Name methods, variables, files in a way that gives more clarity to what it’s doing.
- Focus on reducing request times. This can be done by moving non critical tasks to background jobs.
- Related to this: Show something is being done to the customer ASAP while you do the main work in the background.
- It’s good to challenge product teams requirements in the ideation phase as product folks don’t always think about (or may not be aware of) performance while deciding on upcoming features. Developers should call out things that could lead to poor performance.
- While coding, avoid loops/iterating thru all to do calculations. Related: careful loading all records from DB. Example: to check if atleast 10 records exists, use User.first(10).size instead of User.count
- If you have to update a lot of users manually, try doing it in real time instead of a rake task. Trigger the update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ShopifyWrapper | |
class Download | |
attr_reader :response, :error_message | |
def initialize(response, error_message) | |
@response = response | |
@error_message = error_message | |
end | |
def self.all_products(options={}) | |
ShopifyWrapper.activate_session(options[:shop].shopify_domain, options[:shop].shopify_token) | |
begin |