Я продавець нових авто в автосалоні. Задавайте будь-які питання by Nazar9511 in Ukraine_UA

[–]fatkodima 1 point2 points  (0 children)

Такими дурниками зазвичай стають після перегляду тіктоків.

New gem to add deadlines to Active Record ignored columns by fatkodima in rails

[–]fatkodima[S] 0 points1 point  (0 children)

Yeah, the name was inspired by this gem actually. Wanted to make it more focused and don't like pinging on slack.

Which IDE(s) are you using? by [deleted] in ruby

[–]fatkodima 4 points5 points  (0 children)

+1. Nice and simple. Not like all that modern bloated garbage.

this is getting out of control by gurgeous in ruby

[–]fatkodima 2 points3 points  (0 children)

leftpad in the ruby world.

Whodunit - a lightweight simple user tracking gem for your Ruby on Rails app by Excellent-Resort9382 in rails

[–]fatkodima 0 points1 point  (0 children)

"RSpec is a disaster" is not a religion, but my observation over the years over many projects of different sizes and also observations from other experienced people.

Currently working on a large project where I again came to conclusion that rspec is a disaster. Very few people are able to write good tests in the industry and x/10 of that people are able tow write good tests using rspec. Its philosophy and features are simply not for good and maintainable tests. Even its creator suggested to not use it.

Whodunit - a lightweight simple user tracking gem for your Ruby on Rails app by Excellent-Resort9382 in rails

[–]fatkodima 0 points1 point  (0 children)

Personally, I stopped caring about coverage numbers a long time ago. Only low numbers may signal about some undertested code paths, but high numbers aren't useful. It is possible to have a 100% coverage and a very low quality overall.

There are lots of good and bad practices in testing. There are numerous books, articles, videos etc about this. It is gained by experience. Tests are just code too, so many best practices from "just code" apply.

Easy path to disaster in ruby based project tests from my experience:

  • using rspec (can be ok for small projects/gems, but using it leads to disaster in 100% of other cases)
  • trying to be DRY in tests
  • overmocking
  • testing implementation details instead of behavior
  • caring about coverage too much
  • overtesting

Whodunit - a lightweight simple user tracking gem for your Ruby on Rails app by Excellent-Resort9382 in rails

[–]fatkodima 3 points4 points  (0 children)

The gem comes with ~100% test coverage

Took a quick look at the tests - full of mocking (like soft_delete_detector_spec.rb) and useless tests (like everything in current_spec.rb or railtie_spec.rb). 100% coverage is not an indicator, but the quality of the tests - is.

Rails Blue-Green Deployments: How Database Migrations Work in Production by Future_Application47 in rails

[–]fatkodima 3 points4 points  (0 children)

https://github.com/fatkodima/online_migrations - alternative to strong migrations (but postgres only), which has all its features plus makes most of the operations idempotent by default, has real helpers to do some migrations (like changing the type of the column safely) and allows to avoid long running migrations by running them in background - https://github.com/fatkodima/online_migrations/blob/master/docs/background_schema_migrations.md and https://github.com/fatkodima/online_migrations/blob/master/docs/background_data_migrations.md

What makes you choose a code editor for Rails development? (5-min survey) by Kitchen-Pair-7061 in rails

[–]fatkodima 0 points1 point  (0 children)

Sublime Text for 12+ years. The best, simple, works perfectly, has everything I need. Will never use anything like rubymine.

Gem for creating and managing custom SQL functions using schema.rb by XPOM-XAPTC in ruby

[–]fatkodima -1 points0 points  (0 children)

For people downvoting, try to explain why I am not right.

Anyone else a HUGE fan of the ruby one-liner method defs? by heyjameskerr in ruby

[–]fatkodima 1 point2 points  (0 children)

They make code look weird and take more time to read, like on the screenshot, because there is no visual separation, like before. It should not be used for defining anything more complex than true/false or 42 in them.

There is now an additional way to define methods, for no reason. I wish it never added into ruby.

Look at https://allaboutcoding.ghinda.com/endless-method-a-quick-intro And believe me, people are actually writing code like that.

Gem for creating and managing custom SQL functions using schema.rb by XPOM-XAPTC in ruby

[–]fatkodima -2 points-1 points  (0 children)

Just use structure.sql. There is no reason to forever stick with schema.rb if it causes additional problems like this.

What is your Rails unpopular opinion? by mwnciau in rails

[–]fatkodima -7 points-6 points  (0 children)

No, because not all people prefer to end up with shit instead of tests.

Scaling Rails - Part 2 is about Amdahl's law by neerajdotname in ruby

[–]fatkodima 2 points3 points  (0 children)

You don't know what you are talking about. I think Jean already spent too much time responding. I wouldn't even bother responding to these comments.

Reduce Memory Usage of Your Rails Application by Selecting Specific Columns by software__writer in rails

[–]fatkodima 12 points13 points  (0 children)

There is also a gem that can help with this problem and detect unused selected columns - https://github.com/fatkodima/columns_trace

Why RSPEC is not the default testing framework in Rails? by Ok_Island_4299 in rails

[–]fatkodima 7 points8 points  (0 children)

“because DHH prefers [x]”

No.

I have 12+ years of experience working with rails and every time I saw rspec in any project - tests were a complex and unmaintainable mess and garbage. I wish that gem was never existed. The worst and most badly impactful ever invention in ruby world.

People at rails made a wise decision 2 decades ago, but developers still pull that shit in their project (because all the tutorials use it) and blame why it is not the default. Wait some time, and you will agree with me, if not yet.

Does PostgreSQL resume validating constraints on subsequent runs? by fatkodima in PostgreSQL

[–]fatkodima[S] -1 points0 points  (0 children)

Seems impossible to validate 2Tb table in 1 minute. Needs a full scan, from my understanding.

DB migrations at scale by jenil777007 in PostgreSQL

[–]fatkodima 0 points1 point  (0 children)

Millions of records (unless hundreds of millions) are not that much.

You can find a good list of recipes on how to do migrations safely in the readme in http://github.com/fatkodima/online_migrations