Live data from Hacker News

Build your own web framework

vercel.com

131–140 of 155 posts

Re: Build your own web framework

#131
post #5

This is a nice overview of modern front-end development but I'm constantly disappointed with what 'web framework' means in node-land. None of these things are strictly necessary when building a web app but authz/authn, user management, databases, server-side logic vs client-side logic, are pretty much always needed. When I see the phrase 'web framework' these are the things I am interested in seeing and they all seem…

I am still holding my breath for a Node framework that does everything Django does for me. Honestly, we are most of the way there but for three holdouts; 0 config auth, easily extensible admin, and migrations. User stuff isn't so bad with bcrypt but I'd really like to be able to type `framework create superuser` and `framework create user` instead of fiddling with user access and re-imaging user groups and permission…

This is exactly why I used RoR for a recent freelance project which required a fairly simple (but full featured, user accounts etc) backend despite being a JS developer for the last 15 years and not really having any Ruby experience. None of the Node options seemed to cover all the bases and/or inspire trust, and I didn’t feel much like piecing together a bunch of random modules for a small project.

Overall I guess it was a mixed experience, I missed the JS language (just because I know it well, Ruby has a lot more syntax) and Typescript but I liked having all the things like auth, migrations etc. which are not my speciality taken care of in a way that I could trust and easily Google thanks to it being so widely used.

I’m not 100% sure if I’d make the same choice again, the mental overhead of going to a language I don’t usually use to make changes is a downside as is the lack of type checking (though I believe there are better options in the Ruby world now), but on the other hand I could do the whole thing with very little code (relatively) and it was a good experience to see just how much work a well designed framework can save you.

I should add I did try Django but had my heart set on GraphQL (just because I wanted to try using it for real) and the options in the Python ecosystem didn’t scale well. Overall I liked Django’s ORM better and the Python language, but I felt like you got more out of the box with RoR, the ecosystem is higher quality, and I had to do fewer hacks to get stuff working. All depends on the scale of the project and how much code you want to write I guess.

Re: Build your own web framework

#132

Do we ever think we'll collapse all of the complexity layers for programming on the web? Coming from other languages, I'm finding that the agreed-upon web standards make development super hard (we have to collectively build these towers of babel on top of them, since we can't fix the underlying stuff) I guess WASM maybe is one possible solution here

> Do we ever think we'll collapse all of the complexity layers for programming on the web?

Yes, and this is what Vercel has been doing with Next.js. Used to be that I'd had to manually maintain a bunch of different tools to get them to work together, and then if I wanted to add, say, automatic image compression, I'd have to figure out how to connect that to everything else.

Nowadays, I just let Next.js handle it. I don't even have to think about (and remember, for every new project) what optimisations would be good ideas, as they'll do it for me.

Re: Build your own web framework

#133
post #112

What a sad state “modern” web dev is in. I’m glad that I’m living in a much faster and simpler world, but I fear, for end users and developers alike, that it is an ever shrinking one. I really can’t understand the appeal of what, to my eyes, amount to endless layers of needless complexity. I wish articles such as this one were more common: https://alexcabal.com/posts/standard-ebooks-and-classic-web-... This is the we…

I've spent the previous month working with React for the first time and I find myself longing for the simpler days. There's absolutely no reason why it was needed for this project, much less for it needing to be a SPA. The codebase is bloated, the dev environment is slow and unwieldy (even on my M1 Max) and just doing simple things takes longer. The only small saving grace is we're using TypeScript. If we're ever in…

Have you tried Astro. Lets you get back to basic html, css and it’s not a SPA but an old school MPA. Lets you use react or similar for any interactive component but without SPA complexity. Worth a look but always depends on what your needs are.

Re: Build your own web framework

#134

Earlier quoted context omitted.

I always feel bad when I see novice programmers herded toward frameworks like Flask and Express for uncomplicated API cases, you can take your pick of mature C#, Rust, Java and C++ API frameworks that serve ~7,000,000 responses per second compared to Express' and Flask's ~123,000 and ~15,000 respectively.

This is a gross generalization. And I'm not sure where you are picking up those values from as well or their accuracy, for Flask is ~15,000 on uWsgi or Gunicorn? or the default werkzeug dev server? How you deploy matters very much I'm sure you'd understand. However, Ultimately development teams make do with the skillset they have and saved development time is saved money. Who cares of the toolset, Most programmers fo…

I don't think it's fair to call it a gross overgeneralization; good software engineering is being able to evaluate and select the right tool(s) for the job than try to bastardize their fave lang into everything.

The numbers were from skimming TechEmpower's benchmarks. I don't have a horse in the race as I don't do (much) web dev but I found the disparity amusing even if the reality isn't quite so bleak due to, as you mentioned, many other factors before you even hit the application itself.

Ultimately I agree with you, I'd rather see someone use a framework they're comfortable with if it makes their life easier - but I won't lie to them and pretend it's optimal.

Re: Build your own web framework

#135

Earlier quoted context omitted.

I always feel bad when I see novice programmers herded toward frameworks like Flask and Express for uncomplicated API cases, you can take your pick of mature C#, Rust, Java and C++ API frameworks that serve ~7,000,000 responses per second compared to Express' and Flask's ~123,000 and ~15,000 respectively.

How about Go? How fast would it be?

I've never used it but I presume fast enough given its use in networking stacks like Traefik.

Re: Build your own web framework

#136

Earlier quoted context omitted.

I always feel bad when I see novice programmers herded toward frameworks like Flask and Express for uncomplicated API cases, you can take your pick of mature C#, Rust, Java and C++ API frameworks that serve ~7,000,000 responses per second compared to Express' and Flask's ~123,000 and ~15,000 respectively.

Which would you recommend?

The best one is the one that fits your use case and ecosystem :')

Re: Build your own web framework

#137
post #57

Earlier quoted context omitted.

It's because almost no one uses React the way it was created, but ultimately depends on what you mean by Web Framework. I don't think react includes enough to be a web framework. It's a library to make components for web pages. Notably, Facebook's chat window. Later, one people decides that it's a good idea to have one giant component mounted at `body` or `div` directly underneath the body that would hold everything…

I think the problem is that react is larger than several frameworks but provide 1/10 of the functionality. If react were preact it would feel smaller and people who care about performance would embed it without thinking too much

I have seen it said as "React is neither a library nor a web framework, but a view framework"

Re: Build your own web framework

#138

Earlier quoted context omitted.

I always feel bad when I see novice programmers herded toward frameworks like Flask and Express for uncomplicated API cases, you can take your pick of mature C#, Rust, Java and C++ API frameworks that serve ~7,000,000 responses per second compared to Express' and Flask's ~123,000 and ~15,000 respectively.

How about Go? How fast would it be?

Go is my language of choice, not just for performance (it probably won't beat C) but because the simplicity of the process.

One code base, one language, cross compilation, native binaries, static linking.

Re: Build your own web framework

#139
post #81

Earlier quoted context omitted.

With modern hardware it is very easy to serve millions of daily users from a single machine with simple software. No one bothers because everyone loves their fast-as-a-snail framework in their favorite slow scripting language and they need massive infrastructure to scale it to serve less than 1k concurrent users. Programmers have no one to blame but themselves.

Speak for yourself. Tools these days are much more ergonomic, not to mention faster than ever before. I host a website on DigitalOcean with 0.5 GB RAM and 1 vCPU that can support millions of requests and runs with just a git push. Try doing that in the 90s.

We did and do. Also, git push works with PHP as well. So does rsync. Just put some files on a server with whichever protocol you choose. Easy peasy.

Re: Build your own web framework

#140
post #12

Earlier quoted context omitted.

The only framework of that scale and quality I’ve found in node-land is Adonis [0]. It’s why I chose Adonis 5 for my latest product—it needed to be built in JS or TypeScript but I wanted the “batteries included” feel of Laravel or Rails. [0]: https://adonisjs.com/

Unfortunately they just directly copy laravel line by line when I had last seen it. It doesn't use the strengths of JavaScript as much.

Laravel is awesome, and "laravel in js" sounds good.

Perhaps you can point out issues or improvements which could be possible by leveraging these strengths if javascript?

Post reply on HN