Live data from Hacker News

Ask HN: Getting tired of complexity in web development

news.ycombinator.com

271–280 of 292 posts

Re: Ask HN: Getting tired of complexity in web development

#271

Earlier quoted context omitted.

> As someone who works in full stack development, what complexities are you talking about exactly? I just spin up a NextJS app with an express server if I need a backend as well. In a way, it's been easier than before where you'd have to set up Webpack and friends. Every time I read things like this I wonder if most people here are just building landing pages or side projects. I've literally always had need for valid…

> I've literally always had need for validations, background jobs, translations, authentication, authorization, migrations, orm/data libraries, CLI commands for maintenance tasks, Sure, I was simplifying to make a point, of course I use all of those. My main point however was that there are defined, standardized solutions for all of those. It's not like there's that much churn in authentication libraries for example,…

> there are defined, standardized solutions for all of those

Really? I have never seen two Next.js projects, open source or not, which use the same subset of libraries. Most don't even share the same "approach" to communication with the backend. Some use GraphQL, some other just API routes, other's proxy to another backend, other trpc, others firebase like solutions, etc... And none of them would qualify as "simple" to anyone else than the person that built it. Even more, no two single projects share the same structure or code organization.

> It's really not, because again, solutions are pretty standardized.

Tying together all of those solutions and guarantee you're not creating security holes in doing so, documenting it for others and making it robust and battle proven is complex for almost everyone, maybe not for you if you're top 1%, granted. I'd love to hear about those standard solutions you mention, because as I said above, those standard solutions are different for everyone. And I've seen tons of wasted time and effort in discussing what's the "standard solution" to use. From people discussing if they should do validations with yup or express-validator or joi to discussing if they prefer prisma or knex to entire weeks debating if migrating to GraphQL would be better.... tons of time and company money wasted.

Re: Ask HN: Getting tired of complexity in web development

#272

Earlier quoted context omitted.

You can add any interactivity you want to PHP (or any other server rendered html) using Alpine.js, Unpoly, HTMX, or any other kind of modern approach to frontend JavaScript. It is not anymore a dichotomy between ugly jQuery spaghetti or full SPA Next.js thing.

I did consider Alpine, the pro is that it is very light. The con is that the components don’t seem as complete as MUI and not free either. Also the repo activity of next/react/MUI is much higher than PHP/alpine. One thing you want to do is try to choose a stack with the best chance of not leaving you stranded in few years. Also a good set of components so I’m not stitching together random packages that may or may not…

> The con is that the components don’t seem as complete as MUI and not free either.

I think you're mixing different things here. Not liking Alpine because you don't like the components is like not liking React because you don't like some component library for it.

Alpine per se is a perfectly standalone library. I use it for my projects and I do not use their components library. Same I use React and don't use MUI either on some projects.

> Also the repo activity of next/react/MUI is much higher than PHP/alpine.

If the project is well maintained, widely used, documented and has no evident unsolved/ignored bugs... isn't this a feature? Why do we need things to constantly change?

> One thing you want to do is try to choose a stack with the best chance of not leaving you stranded in few years. Also a good set of components so I’m not stitching together random packages that may or may not be under active development.

I've worked for companies that, even using popular tools, ended up stranded. One of then with a Vue 2 project which they already "declared" they'd never move to Vue 3 because of all the third party dependencies and own code they had. Same at another job with Python 2/3. So choosing popular libraries, while safer, it's not always safe.

On the other hand, when you choose React (or any other "SPA" heavy tool) you will also need to decide on 10s of other libraries. From state management, to routing, maybe a meta-framework, a validation library, an ORM or data access library, some other for doing maybe background jobs, another for translations, another for graphql or your rest API, etc, etc, etc. Any of those can go unmaintained and cause big headaches.

I highly doubt anything such as Rails, Laravel or Django will go unmaintained and leave you stranded. Alpine.js doesn't look like it is going away any time soon as it is already pretty popular. Would love to say the same thing about Adonis, but I don't know many people using it yet, although I have big hopes for it. Unpoly, HTMX, etc... are more valuable by their ideas and ideology that by their implementation imho. They're small enough like to maintain it yourself or write your own implementation in a worst case scenario.

Re: Ask HN: Getting tired of complexity in web development

#273
post #267

Earlier quoted context omitted.

You have never used Rails, have you? From the top of my head, you'll also need libraries for: - Background jobs - Validation - Translations/i18n - CSRF and other common security considerations - Testing (and integration testing) tools - Logging - Email sending - File uploads (S3 storage, etc) - Websockets And then write the glue code to make all of this work seamlessly, document it for others to understand how you ma…

Well said. There are a million starter projects and examples each with a different mix of tools hooked up all in very different ways with tons of files and config. And lots of them with bugs or out of date. The problem with the JS world is they can never coagulate around one solution. Everyone has this insatiable desire to roll their own. Next only works because it leaves out a bunch of stuff. Instead of the examples…

I think a big part of this is because of the the popular teachers and bloggers/youtubers which are not more than undercover (and some not even undercover) marketers for companies or solutions promoting the use of their platforms.

So many "Look how easy it is to build a blog with Next.js/Remix/Nuxt.js/Whatever", and it is true. That's really easy and cool and has a really good DX and we all love it.

But in real life you need a ton more things to make things robust and secure. And when people start to patch together stuff to get, let's say, authorization or authentication, into their apps, is when things go wrong and you end up getting emails of "data breaches" from services you signed up to.

Had you used a battle proven full stack framework, 90% of the problems would have been solved in standard, well documented, secure and proven ways.

In the node ecosystem, the opportunities are right there. From what I've seen and tried, Adonis.js is the best thing that has happened in this regard. A real "full stack" framework following Laravel's ideas. It's opinionated, fully featured and well integrated as every feature works nicely with each other. And you're not handed over 40 decisions to make about the ORM, the templating system or how to do permissions. It's all there ready and documented. As with Laravel or Rails.

We just need to have people understand that there's a *very common* set of features every single non-trivial web application needs and that it makes no sense to rewrite it from scratch on every single project.

What scares me the most is all of those people saying that implementing all of this themselves or by tying together 10s of libraries every single time is easy. To me they just don't know what they're doing and what they're getting into.

Re: Ask HN: Getting tired of complexity in web development

#274
post #149

Earlier quoted context omitted.

This is very interesting. Where can I start and learn more about it?

This article is a really brief primer on this line of work. A lot of it is working with Python, JavaScript, APIs, and building custom solutions to get different COTS security tools and things like Jira to talk to each other. It may not be for everyone but I really enjoy it. https://www.cadosecurity.com/the-next-in-demand-job-title-se...

I find it very much interesting as well. Would you be available for an informal chat?

Re: Ask HN: Getting tired of complexity in web development

#275

Earlier quoted context omitted.

I did consider Alpine, the pro is that it is very light. The con is that the components don’t seem as complete as MUI and not free either. Also the repo activity of next/react/MUI is much higher than PHP/alpine. One thing you want to do is try to choose a stack with the best chance of not leaving you stranded in few years. Also a good set of components so I’m not stitching together random packages that may or may not…

> The con is that the components don’t seem as complete as MUI and not free either. I think you're mixing different things here. Not liking Alpine because you don't like the components is like not liking React because you don't like some component library for it. Alpine per se is a perfectly standalone library. I use it for my projects and I do not use their components library. Same I use React and don't use MUI eith…

I need well fleshed out components, and because of the size of the project and the lifetime of it - something that won’t have to be rewritten because the tech went stale next year.

Same with ORM and state management - sequelize and redux seem to be the most active and compatible with next.

I had the same experience being stranded with AngularJS. You never know what will be abandoned next, you can only make choices to help minimize that chance.

Re: Ask HN: Getting tired of complexity in web development

#276

Earlier quoted context omitted.

> Sessions are state Is database state? > php-fpm, opcache Nope > countless parameters Certainly not > "mysql_real_escape_string" vs "mysql_escape_string" There are only a handful of these, and you can learn about them with a simple google search.

> Is database state? Duh. I'm talking specifically about session_*. This data isn't magically stored in the air and if you use more than a single machine, you need to implement the SessionHandlerInterface with a solution like redis or memcached in a clustered setup. That's literally the same as using any other language, plus such map-reduce kv stores. Since you mention that I wouldn't need php-fpm and opcache, I assu…

session_* can be misused if developer is not careful be closing the session as soon as possible to avoid being open during the entire request (mostly a problem for the default file session storage).

Personally I store a token in in my own cookie and then read from whatever storage. No need to correctly implement SessionHandlerInterface (which can be tricky to get right)

Re: Ask HN: Getting tired of complexity in web development

#277

I feel your pain. My career happiness peaked around 2014 or 2015, when I was writing Rails monoliths. I felt like I could focus 100% of my energy on business logic since the framework was so opinionated and the stack was simple. Things went rapidly downhill after that, once microservices, SPAs, node.js, NoSQL, and serverless computing started becoming popular. Everything just felt like a step backward. Microservices…

>NoSQL, frankly, is utterly pointless, and I have no clue why it ever caught on. It caught on because "feature factory" startups used simple frameworks to make an MVP and didn't know shit about RDBMS administration, optimization, or schema planning so when it was schema migration time it was time for things to start breaking. With NoSQL (specifically the "document store" types) you could just keep throwing shit in th…

Sorry, but when I see "Web Scale" or "MongoDB" I can't help but recall https://www.youtube.com/watch?v=b2F-DItXtZs

Re: Ask HN: Getting tired of complexity in web development

#278

Earlier quoted context omitted.

> Is database state? Duh. I'm talking specifically about session_*. This data isn't magically stored in the air and if you use more than a single machine, you need to implement the SessionHandlerInterface with a solution like redis or memcached in a clustered setup. That's literally the same as using any other language, plus such map-reduce kv stores. Since you mention that I wouldn't need php-fpm and opcache, I assu…

> This data isn't magically stored in the air and if you use more than a single machine I'm curious, what do you think the OP meant when they said "stateless"? > I assume that you haven't worked at scale with php Oh I have actually! But I'm curious, how many sites do you think have a high enough scale to need php-fpm and opcache?

> I'm curious, what do you think the OP meant when they said "stateless"?

Any kind of user session where user information is stored for access across multiple pages. When you use $_SESSION and write a variable into it, the content is persisted on the server and the user gets a cookie with an ID which points to their session variables. This is state that needs to be shared across servers when want you scale out.

The opposite would be e.g. an jwt, where the state is stored in the token.

Re: Ask HN: Getting tired of complexity in web development

#279
post #207

Earlier quoted context omitted.

Thanks for the great post from a different perspective. I kind of agree with you. But the problem is that there are way too many options for a given task, and it's difficult to evaluate all and zero in on something. I need a small help from you. I am new to web development. After a lot of research, I have zeroed in next.js. I loved the overall design, api/workers integration, deployment using vercel. But struggling t…

We evaluated a dozen or so for work last year, and my two personal favorites were DatoCMS and GraphCMS (now called Hygraph). A bit more details in this thread here ( https://news.ycombinator.com/item?id=32993835 ), but basically DatoCMS had a great out of the box editor experience, while Hygraph had a slightly better/more flexible data model and GraphQL mutability. There are a LOT of options out there now though... y…

No post body was provided.

Re: Ask HN: Getting tired of complexity in web development

#280

Earlier quoted context omitted.

>Why does this happen? I wrote about a hypothesis here: https://medium.com/@scott.stevenson/how-to-finally-make-some... Most of us are scared by the ambiguity of actual creative work, so unless we are under the threat of deadline, we seek out "structured games" to play so that we can put off the anxiety of freeform work. These games are: (1) Tool Game: Researching and setting up tools (2) Learning Game: Books, podcas…

Based on this description, I should vary my playing of games. Anyway, I find the usage of the term "game" to be quite odd. Why not "strategy?" I'm not sure I agree with the overall point, but enjoy how you've operationalized/categorized behavior in this way. There is value in that.

I used the word game because game implies a sort of "formal structure" or "submission" to a set of rules and constraints. This kind of structure relieves us of the anxiety of choice. It's so powerful it can be euphoric, that's why people pay for others to dominate them . I think it's also why we get into drug habits and a lot of other vices that add structure to our lives.

It's fine in moderation but tackling ambiguity regularly makes magic happen.

Post reply on HN