News for hackers. Stuff that matters.
Re:Django 3.1 by kumarvvr on Tuesday August 04, 2020 @05:37AM (#24048257)
OT Question : When choosing a stack for creating sites, would you choose Django over ASP.NET Core or PHP?

If so, why?

Re:Django 3.1 by moksly on Tuesday August 04, 2020 @08:13AM (#24049157)
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.

Re:Django 3.1 by kumarvvr on Tuesday August 04, 2020 @09:11AM (#24049581)
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.

Re:Django 3.1 by mixmastamyk on Tuesday August 04, 2020 @02:13PM (#24052823)
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.
Re:Django 3.1 by pyrophane on Tuesday August 04, 2020 @10:22AM (#24050257)
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.

Re:Django 3.1 by tarkin2 on Tuesday August 04, 2020 @07:05AM (#24048717)
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.

Re:Django 3.1 by nicoburns on Tuesday August 04, 2020 @08:39AM (#24049318)
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).
Re:Django 3.1 by mrweasel on Tuesday August 04, 2020 @10:52AM (#24050558)
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.

Re:Django 3.1 by ttsda on Tuesday August 04, 2020 @06:06AM (#24048403)
Speed of development. Django dev is really rapid.
Re:Django 3.1 by justinmeiners on Tuesday August 04, 2020 @12:16PM (#24051421)
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.

Re:Django 3.1 by rs999gti on Tuesday August 04, 2020 @10:01AM (#24050018)
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?

Re:Django 3.1 by pyrophane on Tuesday August 04, 2020 @10:49AM (#24050533)
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.
Re:Django 3.1 by kumarvvr on Tuesday August 04, 2020 @10:08AM (#24050099)
Once you have an app deployed, it takes a life of its own. Absolutely, the whole stack matters a lot.
Re:Django 3.1 by rs999gti on Tuesday August 04, 2020 @10:35AM (#24050390)
So the backend language of the CMS does matter, because we'll eventually have to modify it to fit business needs?
Re:Django 3.1 by anentropic on Tuesday August 04, 2020 @10:27AM (#24050303)
Python
Re:Django 3.1 by favadi on Tuesday August 04, 2020 @05:51AM (#24048322)
You only know python.
Re:Django 3.1 by kumarvvr on Tuesday August 04, 2020 @05:56AM (#24048355)
I am good with Python and C#
Re:Django 3.1 by jpgvm on Tuesday August 04, 2020 @06:15AM (#24048447)
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.

Re:Django 3.1 by turing_complete on Tuesday August 04, 2020 @07:05AM (#24048715)
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.
Re:Django 3.1 by nicoburns on Tuesday August 04, 2020 @08:51AM (#24049404)
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.

Re:Django 3.1 by true_religion on Tuesday August 04, 2020 @10:24AM (#24050275)
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.

Re:Django 3.1 by icey on Tuesday August 04, 2020 @01:00PM (#24051997)
It’s no longer true (at least the performance bits), especially with the upcoming release of .NET 5.
Re:Django 3.1 by snypox on Tuesday August 04, 2020 @06:52AM (#24048641)
Don’t understand why you got downvoted. I work in a Python shop and 100% agree with you.
Re:Django 3.1 by acdha on Tuesday August 04, 2020 @07:04AM (#24048705)
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.

Re:Django 3.1 by nix23 on Tuesday August 04, 2020 @07:03AM (#24048701)
Because he say's a hammer is far better then a screwdriver, and Metal is far superior to wood.
Re:Django 3.1 by jpgvm on Tuesday August 04, 2020 @07:33AM (#24048877)
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.

Re:Django 3.1 by acdha on Tuesday August 04, 2020 @08:20AM (#24049191)
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.

Re:Django 3.1 by nix23 on Tuesday August 04, 2020 @07:02AM (#24048694)
>C# is a better language by far and the .NET runtime is a better runtime by far.

Big nono!!

Re:Django 3.1 by jpgvm on Tuesday August 04, 2020 @07:22AM (#24048819)
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.

Re:Django 3.1 by nix23 on Tuesday August 04, 2020 @07:33AM (#24048876)
>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....