Live data from Hacker News

Django and Postgres for the Busy Rails Developer

andyatkinson.com

121–127 of 127 posts

Re: Django and Postgres for the Busy Rails Developer

#121
post #94

Django is a framework made of several components: - ORM: bizarre and can't generate lots of common SQL you will want to generate. Weird joins via counting underscores. Horrible errors that don't make sense. Lots of builtin functions have never worked and they won't fix them. (ROUND has never worked!) - Template language: Slow and borderline unusable. are 50 pages of recursive nonsense tracebacks that doesn't tell you…

As someone that's inherited Flask projects that attempted to match Django levels of functionality, I couldn't disagree more.

"Level of functionality" what does that mean?

I've been at this a while: https://news.ycombinator.com/item?id=1490415

Re: Django and Postgres for the Busy Rails Developer

#122

Earlier quoted context omitted.

To each their own, nothing about the first syntax feels miserable to me, my IDE has got me fully supported on it. I don't dislike the SQL Alchemy one though it takes many more lines on my editor (no way I am going to inline all those nested dicts like that).

> no way I am going to inline all those nested dicts like that You would rather inline them into a single nested magical variable name instead?

Yeah, actually. What seems to be the problem with it? It's zero special characters, and is very easy to read.

Re: Django and Postgres for the Busy Rails Developer

#123

Earlier quoted context omitted.

> your domain objects and your persistence Hmm. Thinking over my career... Maybe I don't know what you mean by "domain objects", "separation", and "persistence", but when I think over the stuff I've worked on in my career, and the problems I've seen in codebases... Yeah, I think I'm with them on this - your domain objects and your persistence should pretty much be the same thing. There's gonna be a few exceptions (an…

Your business logic should not be tied your persistence, that's what I mean by it. By "domain objects" I don't mean that you need to embrace OOP, they could be simple structs without any associated logic. > PPS - N+1 queries are kinda trivial to resolve in most cases in Rails? There's core ORM functionality for it. The problem isn't that you can't fix N+1 queries in Rails, it's that it's incredibly easy to create the…

Ah! Then we're in agreement :)

And yes, Rails makes it easy to make "unthinking" mistakes - like, you should prep your ActiveRecord objects in the controller so they've got all their data for the view, but, because you don't have to...

Blessing and a curse. You can turn it on and pretty much immediately get started, but that doesn't mean you know what you're doing...

Re: Django and Postgres for the Busy Rails Developer

#124
post #94

Earlier quoted context omitted.

As someone that's inherited Flask projects that attempted to match Django levels of functionality, I couldn't disagree more.

"Level of functionality" what does that mean? I've been at this a while: https://news.ycombinator.com/item?id=1490415

> I've been at this a while

I'm not sure how much it adds to the discussion but so have I. Although I've taken a step back from doing web dev directly in the last few years, I have been a Django dev since about 2006.

But before we get into that kind of silly comparison let me put it another way.

There are plenty of people more experience than both of us, that hold Django in high-regard. I know developers tend to hold strong opinions about their tools and that's all fine - but you are rather hyperbolic about several matters that seem to be closer to personal preferences than they are absolute truths.

Re: Django and Postgres for the Busy Rails Developer

#125
post #114

Earlier quoted context omitted.

FYI, there’s a few projects out there for interoperability between Ruby and Python - stuff like putting one language in another. Also, Jupyter and Zeppelin notebooks allow for interoperability, although I don’t know how. (Oh, lastly, if there’s a JVM implementation of Python you could probably use alongside JRuby)

Any recommended ones? Like the parent, I have to reach for Python for AI / ML work and would love to use Rails as the web frontend instead of Django.

For that, I’d just use Rails, and the connect AI/ML tools over an api or (riskier) direct to the DB.

The stuff I looked at ages ago was for literally embedding Python code in Ruby code. I never used any of it either, so I don’t have any recommendations.

Edit: Actually, rather than have Python connect to the Rails DB, have Rails also connect to the Python DB (note that this can be on the same db server, etc). Rails can then handle all the “I’m a product” stuff (user accounts, etc) and then read the Python data for the rest. Would that work?

Re: Django and Postgres for the Busy Rails Developer

#126

Earlier quoted context omitted.

"Level of functionality" what does that mean? I've been at this a while: https://news.ycombinator.com/item?id=1490415

> I've been at this a while I'm not sure how much it adds to the discussion but so have I. Although I've taken a step back from doing web dev directly in the last few years, I have been a Django dev since about 2006. But before we get into that kind of silly comparison let me put it another way. There are plenty of people more experience than both of us, that hold Django in high-regard. I know developers tend to hold…

[deleted]

Re: Django and Postgres for the Busy Rails Developer

#127
post #89

I’ve spent a lot of time with Django, and not a lot of time with rails. For me, if I was doing minimalist CRUD and wanted to ship to mobile or a lot of users, I’d reach for Rails. Hotwire and Turbo seem great, and the ecosystem just seems better and more developed for customer facing stuff. Most of my work has been internal tooling with an emphasis on data analytics or geospatial. Having python libs run natively is a…

You can use Hotwire libs with Django - integrating stimulus into my django project wasn't any more complicated than integrating tailwindcss for example.

Do you like this over htmx? The thought of using Hotwire in Django frankly never occurred to me
Post reply on HN