Live data from Hacker News

What I love about Django

buttondown.com

71–80 of 120 posts

Re: What I love about Django

#71
post #9

Nice. I've been meaning to do my own Django post, on some other bits we take for granted - I should do it. People should be using Django, the best parts are so useful you don't notice them until you switch platforms and implement them badly. Every app that used a more narrow solution ultimately ends up implementing parts of Django badly. The best way to solve this from Djangos side would be to have official ways of:…

I'm sure there must be a way to just set up enough of the Django environment to mangle about at objects in your models in a program. It's something I find myself using the Django shell often enough to want to do from outside there.

Re: What I love about Django

#72

Django for Startup Founders: A better software architecture for SaaS startups and consumer apps: https://web.archive.org/web/20210624040717/https://alexkrupp... This article is very useful. I use DRF but not serializers and write validations by hand because it is too abstract for me. My views just call services and return the result.

Have you seen django-bolt? Might interest you, your setup sounds like it would benefit from it.

https://github.com/dj-bolt/django-bolt

Re: What I love about Django

#73

Earlier quoted context omitted.

Elixir and Phoenix.

You'd have written Instagram which was released in 2010 in Elixir which wasn't released to the public til 2012?

So Rails or some PHP framework. It was slightly too early to go full Node. Django was a little unusual too among the developers I knew. Java was still a thing but more for finance related projects.

Re: What I love about Django

#74
post #53

Earlier quoted context omitted.

It's not hate, it's not wanted to be associated with: see https://victorwynne.com/dhh/

I need to go look up the CEO of my refrigerator, dishwasher, couch, car, cell phone, TV, shirt and jeans, and oat milk to see if they said anything I disagree with on social media so I can boycott them.

Do they have prominent blogs that are good to read to keep up in the industry you work in?

Re: What I love about Django

#75

Earlier quoted context omitted.

> BEGS you to cause n+1 problems select_related, prefetch_related. n+1 problems be gone.

You misunderstand. And that is exactly the problem. We did do that and that's why our queries ended up being several lines long. But if you missed just one model? You openly walk a knife again. It's a mess and it only gets longer and longer. I ended the project with having some proper aggregates, only for that to be thrown out of the window by the guy after me.

> our queries ended up being several lines long

Which is... perfectly normal for non-trivial needs.

> I ended the project with having some proper aggregates, only for that to be thrown out of the window by the guy after me.

How is that a Django problem though ? Sounds like a skill issue on your successor.

I get what you say, there's plenty of debates about ActiveRecord vs. AnythingElse, but in the end this one has its use and obviously has served many of us just fine. Different strokes... you know the drill.

Re: What I love about Django

#76
post #11

Earlier quoted context omitted.

Why is that? What's wrong with Rails?

It's made by DHH.

Actually I didn't know he was a prick. I'm not sure he is either - I haven't checked. I just really really don't like Ruby or Rails.

Ruby is like someone mashed up python and perl whilst on cocaine one day.

Re: What I love about Django

#77
post #15

Earlier quoted context omitted.

The DHH hate is absolutely crazy on HN. I don't understand how people can be so out of touch.

It's not hate, it's not wanted to be associated with: see https://victorwynne.com/dhh/

I read the original post DHH links to. I don’t think it warrants the kind of hate he gets.

DHH has always been very outspoken in his opinions. That’s why he bashed Heroku so badly when he introduced Kamal. It’s what makes Rails such a clear minded framework.

In his political blog, he’s raising an issue that’s occupying all of western politics. And he’s very aggressive about it - just how he was very aggressive when he said “stop paying ridiculous amounts for stupid managed clouds”.

Instead of arguing where he’s wrong, people - including the blog post you cite - write “that’s hateful and racist” and refuse to engage beyond that. That is the very shut-up mentality he writes about.

It frustrates me so much to see this here on HN. HN is supposed to be a place to discuss, not blame others. This resistance to engage in a constructive discussion, even if the person with the differing opinion isn’t articulating them well, or has errors in their reasoning that upset you, is super harmful. It’s what gives all these far right parties their rise to power. They occupy the subjects then that their voters have on their mind, because everyone else doesn’t dare to talk about it.

We could have constructive discussions around such topics. But if we don’t, all that happens is that those who don’t feel heard - in this case rightfully so, because we chose not to hear them - will develop more and more extreme ideas.

Re: What I love about Django

#78
post #33

Earlier quoted context omitted.

I despise django-orm, doctrine is so much better. Like, who thought that using named arguments to do stuff was a proper way ??? `.filter(created_at__gte=XXXXX)` why? The rest of the framework is great but the ORM is definetly its weakest point.

I find those double underscore kwargs weird too, and would prefer to simply pass a lambda instead. What is your idea, what would you suggest?

In Doctrine the query builder can take objects that describe what you want to do [1], not the best but still way better to read and understand. There's also the DQL which is an SQL-like language that's pretty well integrated in phpstorm and is quite close to SQL [2]

[1] https://www.doctrine-project.org/projects/doctrine-collectio... (for collections but you can use them for queries too)

[2] https://www.doctrine-project.org/projects/doctrine-orm/en/3.... / https://www.doctrine-project.org/projects/doctrine-orm/en/3....

Re: What I love about Django

#79
post #33

Earlier quoted context omitted.

I despise django-orm, doctrine is so much better. Like, who thought that using named arguments to do stuff was a proper way ??? `.filter(created_at__gte=XXXXX)` why? The rest of the framework is great but the ORM is definetly its weakest point.

Having used Doctrine, hard disagree. Never again.

I've used django-orm at my previous job for 2 years and I never have liked it, the syntax is just not nice to read. I used Doctrine for 5 years (2 before last job and 3 since I got my current one) and it's just night and day. Declaring entity is just way cleaner, you can just skim through an EntityRepository / query and understand easily what it does

Re: What I love about Django

#80
Django while opinionated is very flexible too. unlike Rails.

that means you can mold it to fit your use case easily - don't like the ORM - you can plug SQLalchemy and use a different 'architecture'. + you can use multiple different databases if you think that's the right path. in Django there's no 'the rails way' - you choose your own path.

Django-admin by itself saves so much work specially If you're doing B2B stuff & you gotta onboard users.

I guess Django is not the best thing, but not the worst thing either. so a perfect middle ground.

Post reply on HN