Live data from Hacker News

How to make websites that will require lots of your time and energy

blog.jim-nielsen.com

121–130 of 247 posts

Re: How to make websites that will require lots of your time and energy

#121
post #53

Earlier quoted context omitted.

People in web development tend to allow dependencies to auto-update. It’s kind of a necessary evil in that the alternative is to do it only manually and then falling behind on security vulnerabilities updates and potentially getting hacked.

But by that argument, if you try to write all of the code doing the functions just by yourself and not bring in any dependencies, and that code is now five years old and you haven't touched it for five years, you might have some security vulnerabilities too. It's not like you are always writing better code than the open source projects are. Unless you are one of the best developers in the world, then sure, then that…

> and that code is now five years old and you haven't touched it for five years, you might have some security vulnerabilities too

Security vulnerabilities grow in unattended code then?

Or they were there from the second the code was written but with some luck someone noticed them and fixed them?

Old code isn't necessarily insecure just because it's old...

Re: How to make websites that will require lots of your time and energy

#122

Earlier quoted context omitted.

I always see this sentiment here but I just havent experienced any of it in 14 years with the Django ORM.

My life is this in django. Querysets have been passed around everywhere and we've grown to 50 teams. Now, faced with ever slower dev velocity due to intertwined logic, and reduced system performance with often wildly non performant data access patterns, we have spent two years trying to untangle our knot of data access, leading to a six month push requiring disruption to 80% of team's roadmaps to refactor to get the…

I believe your case is not specific to Django ORM in particular but to the inherent complexity of various teams working together on a single project.

For greenfield projects, you have a chance of splitting the codebase into packages with each one having its own model, migrations and repository, and if you want to cross these boundaries, make it an API, not a Django model. For existing projects this is hard to do most of the time though.

Re: How to make websites that will require lots of your time and energy

#123

Earlier quoted context omitted.

> Where's the engineering? not every problem has a technical solution.

These aren't "problems" with a "solution". These are software-level decisions that have both pros and cons.

well you've decided they're "software-level". this article title talks about "time and energy".

most of the time the real trade off is financial.

especially now with AI generated boilerplate and npm commands that shit out 10,000 lines of code at a keystroke.

Re: How to make websites that will require lots of your time and energy

#124

Earlier quoted context omitted.

Been there, done that. You implement just a header navigation change, now you're copy pasting across 12 different files. But wait, now you want to add an active state to your navigation links, and you're manually changing the `class="active"` in 12 different files... I could go on, it doesn't scale beyond triviality, albeit LLMs do help speeding up.

That is why you can include a header.html, nav.html, and footer.html if you so wish! There are many ways to do this. :P Depends on your use case.

If you don't go through two different ORMs - running on separate AWS VMs of course - and then to a third server that has the actual database, it's not professional.

Re: How to make websites that will require lots of your time and energy

#125

Earlier quoted context omitted.

These aren't "problems" with a "solution". These are software-level decisions that have both pros and cons.

well you've decided they're "software-level". this article title talks about "time and energy". most of the time the real trade off is financial. especially now with AI generated boilerplate and npm commands that shit out 10,000 lines of code at a keystroke.

I don't think the choice of metric matters to my point (I'm just calling it software-level because these are decisions you make while writing software). These decisions come with both pros and cons either way, which it sounds like you agree with.

Re: How to make websites that will require lots of your time and energy

#126

Always use ORMs and then spend the next year debugging N+1 queries, bloated joins, and mysterious performance issues that only show up in prod. Migrations randomly fail, schema changes are a nightmare, and your team forgets how SQL works. ORMs promise to abstract the database but end up being just another layer you have to fight when things go wrong.

I like Ecto's approach in Elixir. Bring SQL to the language to handle security, and then build opt-in solutions to real problems in app-land like schema structs and changesets. Underneath, everything is simple (e.g. queries are structs, remain composable), and at the driver layer it taks full advantage of the BEAM.

It's hard to find similarly mature and complete solutions. In the JS/TS world, I like where Drizzle is going, but there is an unavoidable baseline complexity level from the runtime and the type system (not to criticize type systems, but TS was not initially built with this level of sophistication in mind, and it shows in complexity, even if it is capable).

Re: How to make websites that will require lots of your time and energy

#127

On one hand I agree, one should approach issues as they come, but there's solutions that are hard to ignore such as the need for reusable fragments/components on different pages which already make a cry for dependencies. Even admitting one wants to go with bare bone web components authoring and maintaining them is expensive, requires lit or something. Thus, what's the solution? Some sort of templating? Again, you're…

> On one hand I agree, one should approach issues as they come, but there's solutions that are hard to ignore such as the need for reusable fragments/components on different pages which already make a cry for dependencies.

I side-stepped that completely, even on actual production web apps for clients, with this: https://github.com/lelanthran/ZjsComponent

Now, you may argue that that is a dependency, but it doesn't have any of its own, you can make a copy of it, serve it from your primary domain, and you're done.

Re: How to make websites that will require lots of your time and energy

#128

Always use ORMs and then spend the next year debugging N+1 queries, bloated joins, and mysterious performance issues that only show up in prod. Migrations randomly fail, schema changes are a nightmare, and your team forgets how SQL works. ORMs promise to abstract the database but end up being just another layer you have to fight when things go wrong.

People love to rant about ORMs. But as someone who writes both raw SQL and uses ORMs regularly, I treat a business project that doesn’t use an ORM as a bit of a red flag. Here’s what I often see in those setups (sometimes just one or two, but usually at least one): - SQL queries strung together with user-controllable variables — wide open to SQL injection. (Not even surprised anymore when form fields go straight into…

Sir, sqlc for example.

I know exactly what's going on, while getting some level of idiocy protection (talking about wrong column names, etc).

Re: How to make websites that will require lots of your time and energy

#129

Always use ORMs and then spend the next year debugging N+1 queries, bloated joins, and mysterious performance issues that only show up in prod. Migrations randomly fail, schema changes are a nightmare, and your team forgets how SQL works. ORMs promise to abstract the database but end up being just another layer you have to fight when things go wrong.

The reason why I dislike ORMs is that you always have to learn a custom DSL and live in documentation to remember stuff. I think AI has more context than my brain.

Sql does not really needs fixing. And something like sqlc provides a good middle ground between orms and pure sql.

Post reply on HN