Live data from Hacker News

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

blog.jim-nielsen.com

151–160 of 247 posts

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

#151

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.

ORM hate might as well be a free square on "HN web development blog post Bingo".

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

#152
post #47

I always get a kick out of the posts from the people in language communities who post "I'm new to , what framework should I use?" It's like asking "I'm new to driving, what brand of nitros should I be using" Nah dude, get your sea legs first

Depends on the context. I came from a ruby, nodejs, java, gawk background to Erlang (not elixir).

The first question I posed to the Erlang community was exactly that: what are the build tools, what are the unit testing frameworks and how is a project setup.

Not because I didn’t know what these tool/concepts did but because I wanted to know what is the state of the art in Erlang tooling.

I have my sea legs, including the wooden one, but just not yet in Erlang. Why Erlang? Because it’s completely different to everything else!

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

#153

I enjoyed the concept of "a complication step". Can't see the results of changes until my code has finished complicating.

Haha I’m not sure if the compilation/complication mixup was intentional, but it made me laugh :D

AI hallucinations again ;)

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

#154

Earlier quoted context omitted.

Basically they’re saying implicitly to be principled about adopting frameworks and other dependencies, evaluating whether they’re needed for one’s project before adopting them. It’s a pretty thought provoking post, even if it may be too subtle for some folks.

No need for the random snark? I mean, again, we're in extremely obvious territory here. Just doesn't seem appropriate for hacker news front-page (to me).

Hmm, was only mildly snarky in my opinion

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

#155

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.

You really want something that lets you write

  table=db.table("table1")
  table.insert({"col1": val1, "col2": val2})
at the very least, if you are really writing lots of INSERTs by hand I bet you are either not quoting properly or you are writing queries with 15 placeholders and someday you'll put one in the wrong place.

ORMs and related toolkits have come a long way since they were called the "Vietnam of Computer Science". I am a big fan of JooQ in Java

https://www.jooq.org/

and SQLAlchemy in Python

https://www.sqlalchemy.org/

Note both of these support both an object SQL mapper (usually with generated objects) that covers the case of my code sample above, and a DSL for SQL inside the host language which is delightful if you want to do code generation to make query builders and stuff like that. I work on a very complex search interface which builds out joins, subqueries, recursive CTEs, you name it, and the code is pretty easy to maintain.

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

#156

I don't see the value in posts like this. It's just a random list of things that can go wrong in software projects, with no discussion of trade-offs at all. Where's the engineering?

I see it like this: with every line of code I write, I make an assumption about the final outcome. Making that assumption means that other possible outcomes aren’t possible.

The more code, the more assumptions.

Until eventually a fixed and very fragile outcome is reached. The so-called first release. Everything is well balanced and based on assumptions I have made based on the information I have been given along the way.

Turns out though my first assumption was wrong.

Now the engineering comes in. Make it look like my first assumption wasn’t wrong, but it was falsely communicated to me. Blame others for my own failings. It called human engineering and it’s great fun.

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

#157

Earlier quoted context omitted.

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.

But did running Windows Update ever break the website?

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

#158

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.

Why can't one use ORM and then flag queries which are slow? This is trivial.

Inspect the actual SQL query generated, and if needed modify ORM code or write a SQL query from scratch.

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

#159

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.

Just in case:

Object-relational mapping (ORM) is a key concept in the field of Database Management Systems (DBMS), addressing the bridge between the object-oriented programming approach and relational databases. ORM is critical in data interaction simplification, code optimization, and smooth blending of applications and databases. The purpose of this article is to explain ORM, covering its basic principles, benefits, and importance in modern software development.

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

#160

Earlier quoted context omitted.

> Is self-control in coding just a lost art now? Yes; a lot of people don't code because they need to make something work, they code for the joy of it. When the software they need to write is boring or solved - like another CRUD app, front- or back-end - instead of picking the boring and easy to build and comprehend languages and frameworks, they will make it interesting for themselves. Learn a new language, framewor…

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

I thought it was "engineers aren't smart, they're just lazy so they always find the easiest way to fix something."
Post reply on HN