Readit News logoReadit News
emptyroads commented on Man wearing metallic necklace dies after being sucked into MRI machine   bbc.com/news/articles/cx2... · Posted by u/brudgers
csours · a month ago
Google Street view of the facility:

https://maps.app.goo.gl/6ssyJfjVn1fUGaG2A

emptyroads · a month ago
I was wondering "why would the street view be relevant?"

Turns out, it's pretty relevant to the situation - especially how the unauthorized access was possible.

This wasn't your typical hospital MRI. This is basically your local tanning salon that somehow acquired an MRI machine.

emptyroads commented on Why I believe Rails is still relevant in 2019   devbrett.com/2019/03/why-... · Posted by u/mottiden
nathan_long · 6 years ago
I know how to preload associations, but I don't know how to globally disable lazy loading of associations. Do you know a way?
emptyroads · 6 years ago
Hmmm, I don't want to assume too much (because of course everyone's project needs are different), but that just sounds like a terrible idea. I guess there are solutions like goldiloader (I've never tried it), but 99% of the time I'd rather not load associated records unless I use them. When I need to load/use them along with many parent records, it seems pretty obvious that I'll want to include those associations (eagerly loaded) in my AR query to avoid N+1 queries as you mentioned. Then again, maybe I've just spent too long taking those assumptions for granted where newer devs might not.

EDIT: After looking more into your claim that "N+1 queries aren't possible with Ecto", I think I have a better idea for what you might mean. Perhaps you don't want everything eager loaded, but you want an exception to be raised if you try to access an associated record that hasn't been preloaded. I suppose that's a fair point (probably good practice if having any N+1 queries will be a major problem in your project, or if subpar performance really is your biggest threat), and no, I don't know of a way to do that in AR.

Deleted Comment

emptyroads commented on Why I believe Rails is still relevant in 2019   devbrett.com/2019/03/why-... · Posted by u/mottiden
nathan_long · 6 years ago
I spent a couple of years dreaming of getting paid to work in Ruby and Rails and about 7 years doing so. There are many things I loved about Ruby, and Rails brought a ton of good ideas to web development, as this post describes (though I don't agree with all the highlights).

I've since moved to using Elixir and Phoenix, and then even more recently, done some consulting on a Rails project. So the contrasts are on my mind.

My perspective now is that the advantages Ruby/Rails have over Elixir/Phoenix (community size and number of libraries) are circumstantial, and the advantages Elixir/Phoenix have (fault tolerance, concurrency, speed, less requirement for external tools) are inherent in the VM.

Yes, speed of development and maintainability matter. And yes, you can write good or bad code in any language. But if Rails taught us anything, it's that defaults matter. And the default pattern in Rails is to use ActiveRecord and rely heavily on model callbacks, which can get confusing quickly. ActiveRecord also has no way to turn off lazy loading as far I know, and chasing down N+1 queries to improve performance is something I spent far too many hours doing.

My productivity also wasn't helped by the long test run times of Rails applications, or by wasting time trying to optimize view rendering on a heavily-used page.

All of those are either non-issues for me now or at least greatly reduced - Phoenix view rendering is crazy fast, N+1 queries aren't possible with Ecto and it doesn't have callbacks, Elixir test suites are highly concurrent and generally fast (though driving a headless browser is still rather slow).

Performance and concurrency do impact productivity. And I find that "functions in modules" is a great way to structure code and makes it easy to refactor. So does being able to run the entire test suite faster than I can get distracted.

The best ideas of Rails, in my opinion, are present in Phoenix - things like structural conventions, English-like naming, and database migrations. But many of the pain points are missing.

Phoenix and Elixir aren't the One True Way™, aren't the best for every conceivable software problem, etc. And surely they'll be superseded. But in my opinion, Rails already has been.

emptyroads · 6 years ago
I agree with a lot of what you've described, but 7 years of working in Rails and you never figured out how to turn off lazy loading in ActiveRecord?
emptyroads commented on Pingfs: A filesystem where data is stored as ICMP Echo packets (2016)   github.com/yarrick/pingfs... · Posted by u/signa11
techdragon · 8 years ago
Sounds like your looking for something like MangoDb https://github.com/dcramer/mangodb

Note: joke assumes parent poster was somewhat humorous

emptyroads · 8 years ago
nsafs might be another good choice: https://github.com/freedomtools/nsafs
emptyroads commented on Machine Learning and Ketosis   github.com/arielf/weight-... · Posted by u/ddv
emptyroads · 9 years ago
I'm pretty sure this is just an example of a "placebo diet"[1] at work.

[1] http://www.placebodiet.org/

u/emptyroads

KarmaCake day50August 13, 2016View Original