Live data from Hacker News

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

blog.jim-nielsen.com

141–150 of 247 posts

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

#141

Earlier quoted context omitted.

So don't run npm updates because sure then you have the security risks that you have some old code and that is five years old and hasn't been worked on for five years and you also have you missing out on new functions and optimizations. However if you have a five-year-old project that you handwritten everything by yourself you probably have a lot of security issues there too assuming that you are using complicated fu…

Yes run updates of course. The question is how much of a headache you want. You can: Use Next.js (frequently changing lots of transitive deps, suffers from Node ecosystem churn too) Roll your own framework OR (FANFARE....) Use simpler arguably more professional tools. That 10 year old .NET MVC site. Guess what. Still works. Still secure.

10 year old .NET is running on a Windows server that, I hope, you've done some security updates on. Having worked on most web facing stacks out there that might have been the worst one you could have picked as a "future proof" deployment, unless you're comparing them all as something you release once and then never touch again.

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

#142

Earlier quoted context omitted.

> they will make it interesting for themselves. Engineers love to solve problems. If there are no problems readily at hand, they will create some.

They're kind of like Border Collies that way, aren't they

I don't know. Do Border Collies like belly rubs?

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

#143
post #5

The problem isn't the tool or the dependency—it's the developer's temptation to over-engineer. We grab a framework because we lack the discipline to keep something simple. Is self-control in coding just a lost art now?

Not for me. But I am in the unique situation of sometimes having to spin up 12 projects a week only to come back to two of them 5 weeks later unpredictably.

This means I treat every project like a letter to my future self that needs to be 100% self explainatory and work even if the environment around the project changed. And this means as few moving parts as possible.

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

#146
post #11

Im pretty sure that most packages and frameworks break less than your own code…

I think the issue is API breakage. Does your 5 year old NextJS project still work after npm update? Probably not! What about your simple Go server or FastAPI server. Probably yes.

Seeing as how FastAPI is only six years old, not sure that works as a great example. One of those projects which has never released a 1.0, so not comforting on backwards compatibility.

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

#147
post #132

Earlier quoted context omitted.

> - Some homegrown “SQL helper” that saves you from writing SELECT *, but now makes it a puzzle to reconstruct a basic query in a database >- Bonus points if the half-baked data access layer is buried under layers of “magic” and is next to impossible to find. It’s really funny because you’re describing an ORM perfectly.

I don't know what kind of ORM you have used but I probably wouldn't like it either. My ORM does extremely much more than those "SQL helper" classes and it logs SQL nicely to the console or wherever I ask it to to log. And it is easy to find it, just search for @Entity.

They're making the tongue-in-cheek observation that those who don't use an ORM end up reinventing one, poorly.

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

#148

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…

People who avoid ORMs endup writing their own worse ORM*. ORMs are perfect if you know how and when to uses them. They encapsulate a lot of the mind numbing work that comes with raw sql such as writing inserts for a 50 column database.

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

#149
post #5

The problem isn't the tool or the dependency—it's the developer's temptation to over-engineer. We grab a framework because we lack the discipline to keep something simple. Is self-control in coding just a lost art now?

For me it's more like I bounce back and forth avoiding the pains from whatever the last project was using. Same with front-end frameworks vs vanilla JS etc.

For example, you work with ORMs and then you see all the problems with them as you maintain the project, so on your next app you create an app that is raw SQL. Then after maintaining that for awhile you start to see all the pitfalls of that approach and why people created ORMs in the first place. Then someone mentions the latest and greatest ORM that promises to be better this time and you use it, saving you from raw SQL you'd jumped to last time....ad infinitum.

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

#150

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.

You've never had to use .extra() ?

Django has SQL logging so you can see what your queries will do! It's wild.
Post reply on HN