Hacker News new | past | comments | ask | show | jobs | submit login

OT Question : When choosing a stack for creating sites, would you choose Django over ASP.NET Core or PHP?

If so, why?




I work in a C# shop that has added Python to our development, because it runs a long side the poweshell scripts our operations guys build in the managed azure services.

I think Django is just a good package. It’s really productive and the ORM is better and easier to use than entity. The real winner for me is it’s stability though. In the time we’ve gone from classic ASP to web-forms to MVC to modern MVC to .net Core and now soon the new .Net version. Django has remained relatively stable and relatively easy to upgrade.

And make no mistake, we absolutely still operate web-forms applications that will likely never get rewritten in something else.

At the end of the day, tech stacks aren’t really that important though.


Curiously, while Django has not changed much, Asp.net has evolved. The new endpoint routing system is very flexible. The DI system is good and templating is excellent.

Additionally, it has amalgameted into a hybrid framework, where adding a high performance API to an existing MVC app has become trivial.

Not to mention, the excellent language and support for tech like gRPC. On the whole, Asp.net core looks poised to evolve and adapt to changing tech landscape.

I do agree that the stability of Django has made it extremely easy to get an MVP off the ground, especially for a seasoned developer.

I have used both and somehow, the strong typing in C# puts enough constraints on me to reason about my web app as a proper app.

In Django and flask, I would often settle into thinking everything in terms of pieces of data, moreso because of the dynamic nature of Python.


If the team/project is huge typing has benefits. If not, python type hints are generally good enough. In the end using MS tooling means their needs come first and so that is to be avoided.


The Django Admin is Django's "killer app." If a significant portion of your application is a back-office CRUD admin interface, Django is perhaps the most productive way to build something like that without writing a bunch of forms or using something even more out-of-the-box {like a Drupal). If you become proficient with Django you can build custom CRUD admins very quickly.

For other use cases, there are better frameworks out there.


PHP on its own was more of a templating system plus arbitrary code when I used it. Django and ASP.NET have ORMs and templating systems.

Lots of people love ORMs although I’ve found complex queries slow with a hefty object model system, to the point where I’d rather write parameterised sql queries than work with a ORM optimization strategy.

The templating system is nice although these days I mostly use javascript talking to json endpoints, with nearly zero need for a templating system.

Honestly when your need is: “javascript talks to endpoint and endpoint talks to database” I don’t see a greater need than python, nodejs, golang or whatever language you prefer plus a couple of libraries. Most server frameworks add more stuff you probably don’t need, unless you can’t work without an integrated ORM.


PHP has Laravel which is very competitive with Django (and Rails), and IMO quite a bit ahead of ASP.NET in terms of what it provides (although ASP.NET is far ahead of both in terms of performance).


We actually had to make that choice 10 years ago. .NET was out because we didn’t want to deal with Windows server, but that’s no longer an issue. Now I think I would skip ASP.NET because everything is confusing as all hell. You don’t know which .NET supports which feature, or even what you’re suppose to be running. It’s the fastest of the three and Visual Studio is still an awesome IDE.

We dropped PHP due to the lack of any really good frameworks, but now we have Laravel. PHP is still a solid choice and it’s fast.

In the end we went with Django because we liked Python and Django is really well documented and easy to learn.


Speed of development. Django dev is really rapid.


For larger loads and computational complexity dotnet core is going to perform better and be safer.

For simpler sites Laravel vs Django probably just comes down to which ecosystem you are most familiar with.


Does the backend language of a CMS matter?

We are a .NET shop, we'd love to use Django, Drupal, etc. But does that also mean we need a dedicated Python resource to support these CMS'?

Or could we use these CMS' out of the box?

Or would we just be better off with a .NET CMS like Umbraco or Orchid?


If you use a CMS to build something of any complexity, you will almost inevitably wind up writing some custom code for it. In that case, I think the most important thing, much more important than what language the developers chose, is how extensible and well-documented it actually is.


Once you have an app deployed, it takes a life of its own. Absolutely, the whole stack matters a lot.


So the backend language of the CMS does matter, because we'll eventually have to modify it to fit business needs?


Python


You only know python.


I am good with Python and C#


Then ASP.NET is probably the superior choice. C# is a better language by far and the .NET runtime is a better runtime by far.

It only ever makes sense to use Python for data-science one-offs and munging if you have competency in Java/C#/etc. It's not a language well suited to application development.


I work mostly in Python and I like it. However, C# is a great, and for some reason underrated, language that is certainly better along a number of dimension.


I didn't downvote, but IMO it's only half true: C# and the runtime really are excellent. But the C# library ecosystem is much smaller than the Java, JavaScript, PHP, and Python ecosystems (and even Go/Rust for a lot of things), and there are even quite a few commercial (paid for) libraries! This may not matter for a particular project, but for me it's significant enough to not make C# a universal recommendation.

Hopefully it changes now that C# is open source, but for now it's quite a big downside.


Also, historically C# ran terribly on Linux, or had a bunch of gotchas when it came to interfacing with the rest of the MS ecosystem.

I don’t know if that is still true today.


It’s no longer true (at least the performance bits), especially with the upcoming release of .NET 5.


Don’t understand why you got downvoted. I work in a Python shop and 100% agree with you.


Look at the number of sweeping absolutes presenting their opinion as a global truth, with no supporting evidence presented.

Threads which start like that rarely end up contributing anything of value or convincing anyone who didn’t already agree with the author.


Because he say's a hammer is far better then a screwdriver, and Metal is far superior to wood.


Yeah I think my mistake is posting a response to a question about which language to use in a Python thread and not suggesting Python.

I work with Python every day and have for years and it's strengths and weaknesses are readily apparent to me but not to everyone apparently.


Try rewriting your comment like an engineering discussion than an opinion piece: share that experience with specific details about things which worked better or worse, using enough detail for anyone else to be able to decide whether your environment is enough like their own to be applicable.

Since this is a Django thread, that could be covering things about, say, why you prefer .Net forms or trade offs from various ORMs.

I think C# is a quite respectable language so you could cover, say, why its typing is more productive than something like mypy or how package management compares.


>C# is a better language by far and the .NET runtime is a better runtime by far.

Big nono!!


I don't see how this is controversial...

C# is a powerful language that is highly expressive, has a great type system, excellent compiler and great IDE, excellent async support, fast HTTP stack in standard library, blessed application development framework and object relational mapper, etc. Basically everything you could ask for in an ecosystem for developing a long-lived web application.

Python is a scripting language which is great for one-offs and has great data-science libraries but lacks static typing, poor IDE experience, slow runtime performance, poor portability because of it's reliance on FFI, poor long-term application maintenance track record, no blessed frameworks, competing and incompatible async solutions, etc.

Tbh I don't think there is much contest. Yes you can write a bunch of Python quickly that will do something but if you already know C# which is much better suited for the task it's clearly a better choice.


>Tbh I don't think there is much contest.

Maybe but you should always ask for what, that's the main-point. Sometimes Java or even Javascript/Node is the best stack. Many many point's play into a decision for a web-stack, maybe he wants that "quickly", maybe he works in a C# shop and so on....




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: