News for hackers. Stuff that matters.
Re:Ask HN: What would be your stack if you are building an M... by ultrasounder on Thursday January 26, 2023 @11:04AM (#34533502)
Definitely old schools. I am building a MVP right now(kinda building my parachute while jumping off the plane)and I went with Django. And here is why. 1. Very vibrant community of devs and time-tested open-source libraries.If you want a multi-tenancy there is a library for that. IF you want stripe integration there is one for that. If you want "fully built out" services, then we have a plethora of free and paid templates. There are folks here(HN User rlawson)who have built many side projects using Django that they have monitized. if that monetization is your goal, then time is money and Django is your friend. 2. Very easy to deploy. This is a Major major requirement for someone like me(dabbling in webdev). Even after the demise of Heroku hobby dynos, there are things like Railway.app which lets you git deploy app, try it out and then scale it if you want. 3. Lastly, Javascript not necessary- I am a "hobby python dev". I don't have the inclination nor the time to learn yet another Javascript framework. I have an idea, know a bit of Python and I want to iterate it on my idea fast and get to the customer ASAP. Meaning, I can deploy a MVP without having to dabble with JS while jumping through all the different web pack configurations. A big win for me. So, "boring stack" definitely.
Re:Ask HN: What would be your stack if you are building an M... by nicbou on Thursday January 26, 2023 @11:36AM (#34533990)
Agreed, although I'd really like to throw in type safety, because the lack of it made my life needlessly complicated. Is this feasible with Python?
Re:Ask HN: What would be your stack if you are building an M... by mattficke on Thursday January 26, 2023 @11:49AM (#34534266)
It’s not enforced at runtime, but otherwise I feel like typing is in a pretty good place in Python right now. If you’re diligent about using Pyright or MyPy as linters it makes life a lot easier.
Re:Ask HN: What would be your stack if you are building an M... by bm-rf on Thursday January 26, 2023 @11:56AM (#34534408)
Type hints in python also work great with vscode (and probably other IDEs) as it can offer better autocomplete suggestions for things like function parameters.
Re:Ask HN: What would be your stack if you are building an M... by gmassman on Thursday January 26, 2023 @01:39PM (#34536486)
Type hints in Python are nice, by pale in comparison to truly typed languages. If you want to feel like your language’s type system significantly improves your development experience and the safety of your code, don’t pick Python.
Re:Ask HN: What would be your stack if you are building an M... by nicbou on Friday January 27, 2023 @01:35AM (#34543277)
What would be a nice contender for someone who is otherwise happy with Python? I love that I can use it for darn near anything.
Re:Ask HN: What would be your stack if you are building an M... by FlyingSnake on Thursday January 26, 2023 @11:19AM (#34533731)
It’s funny that only in our industry “time tested”/“battle tested” is called old school and frowned upon. No wonder we see software bloat everywhere.
Re:Ask HN: What would be your stack if you are building an M... by brookst on Thursday January 26, 2023 @11:32AM (#34533927)
Eh, I think experimental physicists and medical imaging also lean towards newer tech.
Re:Ask HN: What would be your stack if you are building an M... by randomh3r0 on Thursday January 26, 2023 @12:11PM (#34534694)
Eh.. you'd be surprised. Medical Imaging isn't as radical as you may think it is (I spent 7 years doing projects for the exploitation of medical images).
Re:Ask HN: What would be your stack if you are building an M... by brookst on Thursday January 26, 2023 @12:20PM (#34534868)
I’ve had the pleasure of annual echo cardiograms my whole life, and moved around a lot, and at least my experience has been visible hardware/software/imagine improvements almost annually.

In any event I wasn’t saying all medical imaging is state of the art, I was saying it is another field where people prefer newer tech.

Re:Ask HN: What would be your stack if you are building an M... by randomh3r0 on Thursday January 26, 2023 @01:17PM (#34536074)
Absolutely fair. The vendors have gotten much much better tech "in the room" as it were - CT's are lightning fast anymore, US is clearer and can do more on-the-fly analysis than ever before (e.g. highlighting bloodflow dynamically and capturing tons of data in microseconds), etc. Every modality has grown tremendously so my comment wasn't nearly fair enough in acknowledging that.

Downstream is getting better with items such as AI advancements and more sophisticated mechanisms to transfer data between systems both on-prem and cloud-based, however utilization of all of this tend to be stifled a ton by the standard issue of tech moving faster than policy. My frustration/disgruntlement is due to this issue more than anything.

Thanks for the insight and the reminder that my bubble of experience isn't the world - seriously.

Re:Ask HN: What would be your stack if you are building an M... by incompleteCode on Thursday January 26, 2023 @12:18PM (#34534814)
Anecdotal, but a co-worker’s parent works at NHIS and I’ve heard they’ve adopted Kubernetes.
Re:Ask HN: What would be your stack if you are building an M... by marcosdumay on Thursday January 26, 2023 @12:43PM (#34535357)
No area of health work tends towards new tech. It's disallowed by regulation.
Re:Ask HN: What would be your stack if you are building an M... by ZephyrBlu on Thursday January 26, 2023 @06:29PM (#34540338)
JS frameworks are also battle tested. "old school" is not necessarily a bonus because the common paradigms have shifted.

Using Django with React is not as easy as a full-stack framework like Next.js. Modern tech stacks are now generally moving towards either full-stack JS frameworks like Next.js, Remix, Astro, etc and/or serverless with things like railway.app, fly.io, Cloudflare Workers, Deno Deploy, Supabase, neon.tech, etc.

Many features of "old school" frameworks are becoming redundant or are being replaced by options with better DX.

Re:Ask HN: What would be your stack if you are building an M... by FlyingSnake on Friday January 27, 2023 @06:21AM (#34544854)
I do not want to start a flamewar, but most of the things you mentioned Next.js, Remix, Astro, fly.io etc are not even 6 years old. Django is running production ready code since about 2006 and has more shelf life. I was not downvoting JS but in terms of longevity and robustness, Django has that going for it.
Re:Ask HN: What would be your stack if you are building an M... by iwebdevfromhome on Thursday January 26, 2023 @12:25PM (#34534966)
one thing I'd like to see in Django is something similar to InertiaJS [1], just being able to use VueJS for the view layer is amazing and passing data from the backend to the frontend without having to build complex api systems is a godsend. Maybe I haven't done enough research but is there something similar in Django world ?

[1] https://inertiajs.com/

Re:Ask HN: What would be your stack if you are building an M... by kolanos on Thursday January 26, 2023 @12:36PM (#34535213)
Still a bit raw on the edges, but IDOM [0] looks interesting and has a Django integration [1].

[0]: https://idom-docs.herokuapp.com/docs/index.html [1]: https://github.com/idom-team/django-idom

Re:Ask HN: What would be your stack if you are building an M... by iwebdevfromhome on Thursday January 26, 2023 @12:40PM (#34535291)
interesting, is this something similar to htmx ?
Re:Ask HN: What would be your stack if you are building an M... by ebalit on Friday January 27, 2023 @11:23AM (#34547770)
Reactivated [1] looks similar in spirit, but using React on the frontend. I haven't tested it yet but the idea is very interesting.

[1] https://www.reactivated.io/

Re:Ask HN: What would be your stack if you are building an M... by c17r on Tuesday January 31, 2023 @09:05PM (#34605378)
Re:Ask HN: What would be your stack if you are building an M... by pookha on Thursday January 26, 2023 @12:36PM (#34535219)
Don't take this the wrong way python-guy, but there hasn't been a yet-another-javascript framework for like 10 years. You've got react. And if you liked Angular back in the day you've got svelte. Both are fabulous. I myself get brainfreeze and pain when I work with python (spaces) so I could never touch python unless it's a 35 line CNN ML script.
Re:Ask HN: What would be your stack if you are building an M... by readonthegoapp on Thursday January 26, 2023 @12:48PM (#34535480)
Is there a multitenancy package?

Is it this one?

https://djangopackages.org/grids/g/multi-tenancy/

I know there is a paid one.

Re:Ask HN: What would be your stack if you are building an M... by ultrasounder on Thursday January 26, 2023 @01:11PM (#34535956)
Yes this is the one. Or one could also use the https://django-tenant-schemas.readthedocs.io/en/latest/. I don’t want to plug any paid options for obvious reasons but they are posted here regularly
Re:Ask HN: What would be your stack if you are building an M... by clint on Thursday January 26, 2023 @12:48PM (#34535484)
For context I'm someone who spent nearly 20 years doing almost exclusively python dev, attended the first DjangoCon in 2008, ran the Django community blog during its formation heyday back in the mid 2000's and built tons of Django modules, apps, sites etc, have commits on the Project from way-back, tech edited Django books, etc...

Did rails for a short while in 2010-2012 and absolutely hated it then spent 2012-2020 doing mostly Python/Flask dev for huge fintech companies on AWS.

I now use Javascript/React/Nextjs on Firebase/Google Cloud. So much less hassle, tons more libraries and what seems like an exponentially larger ecosystem. There's still weird shit with transpiling typescript to javascript etc... but overall I enjoy JS dev much more these days.

Re:Ask HN: What would be your stack if you are building an M... by squidsoup on Thursday January 26, 2023 @01:40PM (#34536501)
As a long time python dev, I’m now not certain why I would use python for a web app, over typescript on Next, other than familiarity. Sharing types between the server and client, and only having to manage _one_ software ecosystem is great.
Re:Ask HN: What would be your stack if you are building an M... by davepeck on Thursday January 26, 2023 @02:03PM (#34536952)
Spitballing some potential reasons:

1. The data layer, if you want a high-quality ORM and migrations

SQLAlchemy + Alembic (or Django ORM + its built-in migrations) are battle-tested systems that I trust will scale to large teams and not break my data.

If you're more of the persuasion to write raw SQL, or to just use a SQL query builder, Python is less of a draw these days (although SQLAlchemy's query builder is quite nice and can be used independent of its ORM).

2. Ties to the data science + machine learning universe

If your back-end intersects with these in ways that are not cleanly separable into services, Python might be a good (or the only) option. Even if you can cleanly separate, you're effectively committed to managing Python on the back-end.

3. Familiarity

To your point: there's nothing wrong about optimizing for creature comforts and/or velocity from just having done it before.

---

I agree that using a single language provides an advantage at the API boundary. Curiously, my experience is that most modern javascript frameworks (like NextJS) don't have a lot to say about how to structure this in practice. Maybe that's fine, but I'd love to see some opinions emerge in the ecosystem.

Amongst other things, I typically want to:

- Share types (typescript `interface`s, etc.) between the front-end and back-end (while avoiding accidentally bundling back-end code into the front)

- Have run-time types (via `zod`, `io-ts`, whatever) for (at minimum) API request structures so I can validate my inputs

- Have a story about how API validation failures are shipped back to the client (and how the client exposes them to the users, e.g. error messages when filling out form fields)

- Differentiate between API types and my underlying data model (the `User` in my database is somewhat to very different from the `APIUser` I ship to my client)

In the python universe, Django, Flask, and FastAPI all have well developed opinions about run-time types, validation failures, and API types vs. data models.

Re:Ask HN: What would be your stack if you are building an M... by vonseel on Thursday January 26, 2023 @04:51PM (#34539384)
On 1 - I've worked at startups using Django ORM and banking companies using MSSQL stored procs. I don't understand why anyone would ever go the stored proc/raw SQL way unless they absolutely needed the performance. And if you do need the performance, you can always dip down to that level from whatever ORM you are using.

Most of the queries I've done using Django can be optimized at the application code level to be fast and efficient without even touching SQL. There were a few instances at the two Django shops I've worked where we optimized one or two queries by writing raw SQL, but the number of times I've seen that in a codebase can be counted on one hand.

The SQL/stored proc method, on the other hand, doesn't come with any way to do migrations or version your database by default (AFAIK). So now you have to write migration code and come up with some kind of versioning system by hand.

Wish I had more experience with SQLAlchemy/Alembic. I've tried using it on little things here and there but since I've always known Django, that's what I usually go with.

Re:Ask HN: What would be your stack if you are building an M... by speakfreely on Thursday January 26, 2023 @03:03PM (#34537931)
What to you use for ORM/database migrations with Next.js apps?
Re:Ask HN: What would be your stack if you are building an M... by alexalx666 on Thursday January 26, 2023 @01:28PM (#34536279)
Be aware that firebase or aws are only good until you have actual traffic. So in many cases you just loose time you spent understanding their managed infra. I would advice to go with Linode. As a bonus you get to lean new techs that are not tied to crazy managed pricing :)
Re:Ask HN: What would be your stack if you are building an M... by afgrant on Thursday January 26, 2023 @06:03PM (#34540129)
I would be interested in hearing of any instance where Firebase costs created financial hardship.
Re:Ask HN: What would be your stack if you are building an M... by moneywoes on Friday January 27, 2023 @09:19PM (#34554438)
Any tutorials for handling next js and a private server ( like linode)
Re:Ask HN: What would be your stack if you are building an M... by uncommonGeo on Saturday January 28, 2023 @09:00AM (#34557597)
If the traffic to your app is generating a significant Firebase bill then you have probably moved from MVP to successful app territory. Would you rather start managing more infra or focus on keep building features that add value to the app?
Re:Ask HN: What would be your stack if you are building an M... by christiangenco on Thursday January 26, 2023 @12:55PM (#34535609)
I had a similar journey but with Rails and ended up in a similar place.

React+Nextjs on Firebase makes the deployment and scaling steps so much easier than on Rails. I'm very conscious of the platform risk of depending so much on Firebase but gosh darn it they've spoiled me.

Re:Ask HN: What would be your stack if you are building an M... by hooverd on Thursday January 26, 2023 @01:08PM (#34535891)
The one thing that Django is missing is the ability to attach a User object to a session without a full-fledged RDBMS. I wish it was structured like the Session object which you can in your own backends for.
Re:Ask HN: What would be your stack if you are building an M... by jsmeaton on Thursday January 26, 2023 @05:27PM (#34539781)
This is unlikely to ever happen though since so much is tied to it like the permissions system and the admin. The ORM itself is central. I wouldn’t use Django unless your project depends on an RDBMS.
Re:Ask HN: What would be your stack if you are building an M... by 0cf8612b2e1e on Thursday January 26, 2023 @07:29PM (#34540894)
Even if not using a database, I will always reach for Django over a Flask or FastAPI. Yes, there is more boilerplate when just offering a few memory views, but there is so much ecosystem built around the tooling that the expense is worth it. Just making a form or sending an email from Flask requires a third party library which will never receive the level of maintenance as first-party Django. As an example, the often recommended (still mentioned on the Flask Mega-Tutorial) Flask-Mail package last had a commit in 2014.
Re:Ask HN: What would be your stack if you are building an M... by jsmeaton on Friday February 03, 2023 @02:35AM (#34638239)
Fair. I'd probably reach for it too if I had any kind of frontend required, even if that were just HTML and forms. For server-only applications I'd probably go with FastAPI these days and I'm actually looking forward to an all-in-one framework that encompasses FastAPI as the core.
Re:Ask HN: What would be your stack if you are building an M... by agumonkey on Thursday January 26, 2023 @01:39PM (#34536495)
do you still use builtin views/templates ?
Re:Ask HN: What would be your stack if you are building an M... by ultrasounder on Thursday January 26, 2023 @02:01PM (#34536925)
Yes! Trying to keep it as simple as possible! Might try this whole HTML over the wire after I have made some dough. Not now tho. My customers don’t give a damn about my stack
Re:Ask HN: What would be your stack if you are building an M... by cushychicken on Thursday January 26, 2023 @02:05PM (#34536995)
Did a big migration from Flask to Django for my main side project for all of these reasons earlier this year.

I love Django. It's criminally underrated.

Side project if anyone's interested in peeping it: https://www.fpgajobs.com

Re:Ask HN: What would be your stack if you are building an M... by ultrasounder on Thursday January 26, 2023 @02:30PM (#34537437)
Fellow EE here and love what you do! Loved your post on scraping.Btw, I thought you used Flask. Looks like I was wrong.
Re:Ask HN: What would be your stack if you are building an M... by cushychicken on Thursday January 26, 2023 @04:17PM (#34538963)
Thanks for the kind words. It’s probably time for me to revise that a bit, or write another one. I’ve learned a lot more yet since I wrote that.

I used to use Flask, but I changed over to Django at the end of 2022. Super happy I did. It wasn’t painless, but the benefits have been totally worth it.

Re:Ask HN: What would be your stack if you are building an M... by heavyheavy on Thursday January 26, 2023 @06:58PM (#34540616)
What were the benefits switching over to Django from Flask?
Re:Ask HN: What would be your stack if you are building an M... by cushychicken on Friday January 27, 2023 @02:26AM (#34543550)
Batteries included admin console with easily configurable model views.

Built in migrations. Can’t possibly overstate how much this has helped ease deployment. Most of the live debug and prod edits I had to do on the older app were due to db migrations not being shipped with the app.

A baked in ORM with lots of backend optimizations like pagination that keep your queries fast, plus convenience functions for model creation and retrieval (long live get_or_create)

There was a learning curve to all of this, and the complexity of all this in the tutorial scared me away at first, but having seen how the other half lives with Flask, where there are no guardrails for anything, I really appreciate having a framework that solves these kinds of challenges for me.

Re:Ask HN: What would be your stack if you are building an M... by heavyheavy on Tuesday January 31, 2023 @06:48PM (#34604107)
Interesting, appreciate the reply. Wouldn't hurt to add it to the repertoire.
Re:Ask HN: What would be your stack if you are building an M... by cushychicken on Friday January 27, 2023 @09:48AM (#34546622)
One more big benefit: you can figure out how to do almost anything with Django with the right combination of Google and Stack Overflow searches. Not so for Flask.

Ok, well, maybe there are some answers, but it’s always like “Install, configure, and integrate this third party plugin”. Ain’t nobody who’s side-hustlin’ got time for that.

Re:Ask HN: What would be your stack if you are building an M... by thettiguy on Friday January 27, 2023 @03:53PM (#34551703)
I’d imagine many are curious like me … are you making any money on this? I have a similar Niche job site I’m thinking of
Re:Ask HN: What would be your stack if you are building an M... by cushychicken on Friday January 27, 2023 @09:34PM (#34554522)
I make a little bit - enough that the site pays for its own hosting and the few third party services I use, with enough that I can take my partner out for a nice dinner a few times a year. I have some repeat customers, too, so it’s working well enough that we get repeat business. Probably would do a bit better if I was more dedicated / interested in doing outbound sales.

I’ve gotten a handful of people hired through the site, though, and the thank you notes from them have definitely been the greatest reward. :)

Re:Ask HN: What would be your stack if you are building an M... by noveltyaccount on Thursday January 26, 2023 @03:23PM (#34538230)
IMO for early stage startups, proven tech is almost always a better bet than the hot new thing. Your goal is to capture market share quickly, not wrangle beta tech into place.