News for hackers. Stuff that matters.

Ask HN: Best web framework in 2018

I'm trying to choose right web framework for my startup. The problem is that I haven't followed last trends in web dev for a couple of years. Previously I used Python/Django for all of my web projects.

Initially I decided to choose Python/Django because I am familiar with that tech stack and I can be productive from first day. But I have some doubts because our web app will use heavily a lot of interactive stuff like a WebRTC, realtime whiteboard, chat messaging etc.

So, do I need to choose something like NodeJS based web frameworks or I can stay with Django using builtin Channels library?

If I need to choose NodeJS based solution, what kind of libraries do I need to use? Express, React, MongoDB, etc. Is there a some recommended ways of building such apps and do it have standard functionality with common cases like user authorization, session etc.

Maybe some another good alternatives here?

( 39 comments | 33 points | on HN )
Re:Ask HN: Best web framework in 2018 by CM30 on Thursday February 08, 2018 @10:42AM (#16332804)
I'm going to be a bit harsh here, but I think the answer is:

Whatever you're good at and can get a decent MVP out of the door with.

That might be Python and Django like you mentioned above, it might be NodeJS, or it might be anything from React to Angular to any other framework you can imagine.

Because at the end of the day, whatever you actually write the product or service in matters far less than what you actually do with it. Indeed, unless your audience are programmers and run your software themselves, your audience won't give a toss what your software was built in.

Pick whatever you want to write this thing it, but always remember that being early to market it usually a hell of a lot better than being late because you spent tons of time learning an all new framework for it.

Re:Ask HN: Best web framework in 2018 by protonimitate on Thursday February 08, 2018 @10:54AM (#16332941)
Agreed.

There will always be arguments around the "optimal solution", but the only solution that matters is the one that gets your product to market the quickest and with the least resistance.

If you know Python and Django, keep on keeping on.

Of course, there is always room to experiment and try new things for learning purposes.

Don't get lured in by the clickbait articles and twitter stack-of-the-month evangelists.

There are very few framework choices that are 'bad'. And I'm willing to bet that a dev that knows a 'bad' framework inside and out is more effective than someone who hops around to the current flavor of the month.

Re:Ask HN: Best web framework in 2018 by JonesDE on Thursday February 08, 2018 @11:00AM (#16332994)
There are many good frameworks out there that are a viable choice.

The main reason should be the people you want to hire and how you structure your team. Also, you need to consider if you need high performance or data science

Rails - good choice to start off. Fast to bootstrap a product. If you do not need high performance, you can get old with it otherwise, you will move.

Java Spring - a lot of people know Java

Python - framework is not the fastest and modern, but python is a good skill to have in your team if you need data science

.net mvc -- became an interesting choice.

Elixir Phoenix - smallest community but fun to work with and awesome performance (like .net or spring) will scale very well.

Go/Iris -- best performance and easy to learn. Is missing strong abstractions but an awesome community and libraries.

Javascript (express) - ever changing environment. Your developers can work on frontend and backend. It's an advantage to have just one language.

My favourites are Go and Elixir but in the end, I would decide on the people you will hire.

Re:Ask HN: Best web framework in 2018 by yunyu on Thursday February 08, 2018 @01:03PM (#16334116)
Iris has a lot of drama behind it, and the author seems to be slightly unstable (for lack of a better word). See https://www.reddit.com/r/golang/comments/57tmp1/why_you_shou...

I would recommend labstack/echo or go-gonic/gin as alternatives, chi if you're looking for something more minimal.

Re:Ask HN: Best web framework in 2018 by jaredcwhite on Thursday February 08, 2018 @12:16PM (#16333705)
I'm a Rails guy through and through, but I'll echo what many other commenters have said: stick with what you know. Trying out new frameworks, languagues, technology stacks, etc. is great for side projects. But if you're seriously trying to get a new startup product off the ground and to MVP status quickly, the last thing you need to worry about is the headache of dealing with all sorts of new technology puzzle pieces. At the end of the day, your users won't care if you coded the app in Ruby or Python or Javascript or Go. They'll care if the app is good and meets their needs.
Re:Ask HN: Best web framework in 2018 by skrowl on Thursday February 08, 2018 @10:44AM (#16332832)
Unpopular answer, but it's what we use here: Angular SPA front end + .NET backend

The "best" is what you can get the best product done the most efficiently, and what you're able to hire for. If a niche new thing comes out that might be 1% faster in synthetic tests, but you'd have to spend 4 months learning it as well as what you know now and there are no people near you to hire, it's not really the "best" for you.

Re:Ask HN: Best web framework in 2018 by sebst on Friday February 09, 2018 @04:53AM (#16339080)
There are really good web frameworks, both frontend and backend, out there. So, I would second the opinion that the best framework is the one you feel most productive with.

However, I'd like to highlight ASP.net Core + Angular + Visual Studio here. Microsoft appeasement towards Open Source and cross-platform made this a solid choice. As web apps grow steadily in complexity, a modern strongly typed language like C# (and TypeScript) might be helpful for architectural patterns. And, last but not least, the tooling around the Visual Studio product family is maybe best in class.

I am saying all this as someone who has not touched any Microsoft product for years.

Re:Ask HN: Best web framework in 2018 by jonnycoder on Thursday February 08, 2018 @12:16PM (#16333713)
To answer your NodeJS question, express is a popular framework for API development and many databases are supported, https://expressjs.com/en/guide/database-integration.html.

I use sailsJS in my day job which is built on top of expressJS, and it does everything you want out of the box for GET, POST, PUT and DELETE simply by adding a model file and configuring the MongoDB connection string. It also has standard functionality with it such as logging, session, authorization, BUT you have to spend time learning how it works with sailsJS. Therefore it is much easier to start at a lower level framework like express and add high quality functionality modules as you need it, such as expressJS and adding your favorite logging/apm module like New Relic.

I've done .NET, Python and now I'm doing Node at work. By far, Node is my favorite because it always just works. I develop on Windows 10 and deploy using Ubuntu 16 docker images. I use mssql node module and it has just worked in both OSs. The only cross platform issue, with Node, I've had was that file names are case sensitive in Linux but not Windows.

For UI development, that's another beast. I wrote an Angular 5 application recently but I don't like it. Vue and possibly React look simpler.

Re:Ask HN: Best web framework in 2018 by bnchrch on Thursday February 08, 2018 @08:00PM (#16337034)
Given the want for WebRTC, realtime, chat and messaging I would take a long hard look at Elixir/Phoenix. It is perfectly suited to those problem domains.

As a bonus it has a good community and is in my opinion a pleasure to work with. I've released a couple production projects using it and am currently building my third. Ive also found from my own experience and watching a new team pick it up that the learning curve is fairly small.

Re:Ask HN: Best web framework in 2018 by antoineMoPa on Thursday February 08, 2018 @03:11PM (#16335182)
I'd say rails because the nodejs + PHP codebases I've seen aged poorly, but the rails one are still clean. The problem with node is that things move too fast. What was beautiful in JS 4 years ago now looks like legacy mainframe fortran. Laravel (a popular php framework) is nice at one point in time, but even 0.x.0 migrations will break you application and force you to work for hours...
Re:Ask HN: Best web framework in 2018 by bnycum on Thursday February 08, 2018 @05:26PM (#16336154)
Maybe as a counterpoint to your Laravel statement. I started using Laravel on some work projects at 5.3 and have upgraded them up to this weeks release of 5.6 without major issues or time spent doing so. I don't know much about the versions before that though. Other than it's not your grandfather's PHP along the bad habits from the early 2000's. I personally think my Laravel code has been pretty clean and concise.
Re:Ask HN: Best web framework in 2018 by saluki on Saturday February 10, 2018 @09:45PM (#16350899)
y, going from Laravel 4.2 to 5.0 can take some work but the upgrades since then have been quick and painless.

I came from Rails to Laravel. It has a similar feel and in some ways is more fun to work with.

Part of that is the great community and lots of make your life easier features. Especially Laravel Forge and Envoyer. Forge makes spinning up servers easy and secure and deployments a breeze. Envoyer adds zero down time deployments.

These are both paid SaaS but they fund the development of the framework and provide way more value than the monthly cost.

Laracasts is also great for getting up to speed with Laravel.

Re:Ask HN: Best web framework in 2018 by thrownaway954 on Friday February 09, 2018 @09:16AM (#16340285)
"I'm trying to choose right web framework for my startup." "Previously I used Python/Django for all of my web projects"

Write your application in Python/Django. Your concern should be getting to market fast, not which tech should I choose.

Re:Ask HN: Best web framework in 2018 by sidcool on Thursday February 08, 2018 @12:16PM (#16333711)
Unpopular opinion, but Rails with server side rendered ERB templates are quite quick to get started with. The convention over configuration philosophy gives a lot of things out of the box.
Re:Ask HN: Best web framework in 2018 by thrownaway954 on Thursday February 08, 2018 @12:50PM (#16334000)
https://www.youtube.com/watch?v=SWEts0rlezA

if you haven't seen Sam Stephenson Turbolink talk from RailsConf 2016, you should give it a watch. What they did in a year with a small team is amazing.

Re:Ask HN: Best web framework in 2018 by thijsvandien on Friday February 09, 2018 @07:41PM (#16345091)
As others have pointed out already, there isn't really such a thing as a best framework. Many of the fundamental ideas are the same no matter what you choose, so the potential benefits of switching are meager.

Stick with what you know for the parts that don't absolutely require another solution; not all (parts of) pages will be so interactive. Then branch out a bit where needed, e.g. to handle socket connections well. Maybe not all of that needs to be handled by the same service?

If you move the semi-realtime stuff into a separate project, it will be a lot smaller in scope, hence less risky to experiment with. Regardless, I wouldn't stray too far. If you'll be writing Javascript anyway, NodeJS could still be fine, but don't needlessly bring in a third language. Do try Channels, but don't overlook other Python solutions. Tornado is a workhorse that doesn't get nearly enough credit in my opinion.

Re:Ask HN: Best web framework in 2018 by beders on Saturday February 10, 2018 @11:16PM (#16351149)
I'm pretty sure there's websocket (and related tech) support for your stack. I would explore this first.

If your startup is for consumers and you don't have a good estimate of your growth or you don't know how fast your app will need to scale, then make sure you can hire people who know quickly. Your hiring skill will be more important than your tech.

Also, if the complexity of your app is low or medium, consider your first implementation as a prototype that - given growth happens - can be replaced with a faster stack relatively simple.

If high concurrency is needed, you'll bump into frameworks focusing on async I/O. Java and C++ implementations are the leader here. (see techempower benchmarks for more information).

If you can commit to a datastore (and you rarely make a mistake by choosing PostgresQL), then replacing your prototype down the road is easier.

Re:Ask HN: Best web framework in 2018 by david90 on Friday February 09, 2018 @01:24AM (#16338319)
Go for backend as a service or serverless: e.g. ReactJs as front end + Skygear (https://skygear.io) as backend

Disclaimer: I work for skygear (it's a opensource project)

Re:Ask HN: Best web framework in 2018 by znq on Monday February 12, 2018 @09:16AM (#16358656)
Without wanting to spam, I just want to share our summary of our favorite web dev tools https://mobilejazz.com/blog/the-best-web-frontend-developmen...

(We're a 25 people remote company and have been in business for almost 10 years now, so we've a little bit of an idea of what we're talking about. Disclaimer though: one of the tools mentioned in this blog post -- Localname -- if one of our own)

Re:Ask HN: Best web framework in 2018 by dyeje on Thursday February 08, 2018 @11:50AM (#16333469)
Same answer as the many years before: Rails, Django, or .NET.

Anything else and you're making serious tradeoffs on mindshare, features, or something else.

Of those 3, I know Rails has good realtime support via ActionCable.

Re:Ask HN: Best web framework in 2018 by regulation_d on Thursday February 08, 2018 @02:42PM (#16334953)
I like Rails, but calling ActionCable good realtime support is being a bit generous, no?

I was under the impression that scaling ActionCable beyond 1k/users per server was pretty difficult.

Re:Ask HN: Best web framework in 2018 by brandoncordell on Friday February 09, 2018 @01:14AM (#16338280)
http://anycable.io is pretty easy to setup. You can run your rails app and have ActionCable run through Go or Erlang.
Re:Ask HN: Best web framework in 2018 by dyeje on Thursday February 08, 2018 @06:13PM (#16336417)
Well yes, it's Ruby / Rails. Of course it's not going to handle tremendous concurrency. I don't think that makes it bad.
Re:Ask HN: Best web framework in 2018 by lokarda on Thursday February 08, 2018 @10:46AM (#16332854)
There is no "best web framework" :) It depends on several factors: - your personnal preference - your domaine - your need - your budget - etc.

Personally, I love the combo Golang + Vue.js.

Re:Ask HN: Best web framework in 2018 by niwde on Saturday February 10, 2018 @09:54PM (#16350923)
Every programming language has its pros and cons. And many of them overlap.

A product’s success has nothing to do with which language or framework you choose. They are there to help you develop something that works as per your needs.

You mentioned your product deals with chat messaging. So I would suggest using something like NodeJS + SQL for the backend. NodeJS for its ability to handle high volume of events. SQL for managing the chat history of each person in a relational way.

My two cents worth :)

Re:Ask HN: Best web framework in 2018 by netgusto on Thursday February 08, 2018 @03:48PM (#16335461)
Symfony 3 (and recently 4) is a very effective, focused tool that gets out of your way and let you get the job done, once you understand and give in to dependency injection and single responsibility principle

https://symfony.com/

Killer feature: you can use every symfony component in your own app without the framework if you want (console, http router, service container, templating, etc.)

Re:Ask HN: Best web framework in 2018 by truesy on Thursday February 08, 2018 @07:31PM (#16336885)
Use any, really. If you want "best in 2018," in Node, my recommendation is Next ( https://github.com/zeit/next.js/ ) - it is extremely good if you want to kick something up fast, and get it out as an MVP. And can be extended upon to have a rich application, with a variety of other frameworks.
Re:Ask HN: Best web framework in 2018 by johnsonjo on Thursday February 08, 2018 @10:50AM (#16332880)
As far as front end libraries go, I learn quite a few of them in my free time, and I found Vue.js insanely simple to pick up. One of the things I like so much about it is the tooling can be incrementally adopted. If you don’t mind paying quite a bit for a membership I would recommend the 4 hour course on frontendmasters.com by Sarah Drasner. That’s how I learned.
Re:Ask HN: Best web framework in 2018 by dawhizkid on Thursday February 08, 2018 @10:44AM (#16332827)
I just launched a side project with react + react router + graphQL + rails (API only) backend.
Re:Ask HN: Best web framework in 2018 by amourgh on Friday February 09, 2018 @04:19AM (#16338939)
React/Redux +.NET CORE backend,Postgres for the DB is one of the best choices i use
Re:Ask HN: Best web framework in 2018 by sebst on Friday February 09, 2018 @04:58AM (#16339098)
I've always had the feeling that Angular is the better choice for .Net, since it's TypeScript by default and far more opinionated than React (as well as .net core mvc is an opinionated framework).

How is React superior to Angular in your use cases?

Re:Ask HN: Best web framework in 2018 by amourgh on Friday February 09, 2018 @06:47AM (#16339491)
It's what the team already used before.
Re:Ask HN: Best web framework in 2018 by kapv89 on Thursday February 08, 2018 @04:43PM (#16335846)
If you are planning to use node.js with PostgreSQL, I want to pitch in my ORM, tabel: http://tabel.fractaltech.in/
Re:Ask HN: Best web framework in 2018 by ConcernedCoder on Thursday February 08, 2018 @06:35PM (#16336551)
Just please not AngualarJS, not like this... please GOD not like this...
Re:Ask HN: Best web framework in 2018 by vasilakisfil on Thursday February 08, 2018 @10:17AM (#16332536)
you can just split backend from frontend and use in the frontend an all-in js framework like Ember, Angular etc or combination of different js front-end libs like react + redux + react-router.
Re:Ask HN: Best web framework in 2018 by adelarsq on Thursday February 08, 2018 @12:22PM (#16333752)
ELM
Re:Ask HN: Best web framework in 2018 by nwmcsween on Thursday February 08, 2018 @11:00AM (#16332993)
Hyperapp + graphql
Re:Ask HN: Best web framework in 2018 by adamiscool8 on Thursday February 08, 2018 @02:16PM (#16334711)
LAMP
Re:Ask HN: Best web framework in 2018 by riffic on Friday February 09, 2018 @12:41PM (#16342180)
is not a framework