Saturday, January 8, 2022

Rails related: Concerns, Module-method extraction Vs Class-based extraction, Concerning module

1) Single-use Modules are probably better off as Classes as per the below article.

 https://www.cloudbees.com/blog/when-to-be-concerned-about-concerns

By and large, maintainers tend to agree that smaller composable classes are the best way to isolate code and keep things clean.

....

....

I'm not saying that you need to go out and refactor all your single-use modules into classes. I am saying if you find yourself reaching to do a module-method extraction, stop. Consider what road you're starting down and these lessons I've shared. What would a class-based extraction look like instead?

2) https://blog.appsignal.com/2020/09/16/rails-concers-to-concern-or-not-to-concern.html 

3) https://api.rubyonrails.org/v5.0/classes/Module/Concerning.html

4) https://scoutapm.com/blog/rails-concerns - sort of consolidates content from the above articles

5) https://rails.devcamp.com/trails/dissecting-rails-5/campsites/data-management-rails/guides/how-to-use-concerns-rails-5

 

Friday, January 7, 2022

Ruby - differences between Proc and Lambda

 https://medium.com/rubycademy/procs-and-lambdas-46433b93080d

Is module_function really the same as extend self?

https://apidock.com/ruby/Module/module_function

https://medium.com/rubycademy/is-module-function-really-the-same-as-extend-self-ac1e96a1cda0

Rails related - Performance improvement

View performance: 

https://blog.appsignal.com/2020/01/22/rails-is-fast-optimize-your-view-performance.html 

ActiveRecord performance:

https://blog.appsignal.com/2021/02/24/troubleshooting-activerecord-performance.html

Building a Rails App With Multiple Subdomains

 https://blog.appsignal.com/2020/03/04/building-a-rails-app-with-multiple-subdomains.html

Building a Multi-Tenant Ruby-on-Rails app

 https://blog.appsignal.com/2020/12/02/building-a-multi-tenant-ruby-on-rails-app-with-subdomains.html

Rails - How to implement Routes for Many-to-Many

https://stackoverflow.com/questions/31258275/rails-4-how-to-implement-routes-for-a-many-to-many-relationship

https://edgeguides.rubyonrails.org/routing.html#routing-concerns

https://edgeapi.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Concerns.html#method-i-concern


Sunday, January 2, 2022

Draft Pull Requests

 https://software.rajivprab.com/2021/12/26/our-engineering-principles-and-best-practices/

Draft Pull-Requests

For each pull-request, first create a draft pull-request, demonstrating the proposed implementation at a high level. Use TODOs and placeholders to indicate which classes/methods you will be touching. Send it off for review and then immediately start working on the actual code and tests.

This mitigates the amount of wasted effort, if your reviewer then suggests a completely different way of implementing things. Once your reviewer approves the draft, link to it in your pull-request, to make sure everyone knows what was already discussed and agreed on.


CORS related

 https://nickolinger.com/blog/2021-08-04-you-dont-need-that-cors-request/

https://www.reddit.com/r/programming/comments/rurxhl/you_dont_need_that_cors_request/

Computer Networking Introduction - Ethernet and IP (Heavily Illustrated)

 https://iximiuz.com/en/posts/computer-networking-101/

Container Networking Is Simple!

https://iximiuz.com/en/posts/container-networking-is-simple/ 

Followers

Blog Archive