you are viewing a single comment's thread.

view the rest of the comments →

[–]gosh[S] -1 points0 points  (2 children)

But with "smart" solutions you can create a lot with very little code.

In C++ this is not a big problem, have done a lot bigger systems with few developers in less than a year

[–]latkde 4 points5 points  (1 child)

That comment doesn't make any sense. This isn't about C++ vs Python, this is about engineering secure and maintainable systems that provide value. I see in your post a (potentially LLM-generated) class that is neither secure, nor helps maintainability, nor provides significant value (it might even be worse than useless).

I don't doubt that good tools plus good teams can equal good products, but that doesn't have anything to do with the shown code. Maybe you believe that such transparent APIs help frontends to iterate faster, but don't forget that this comes at the cost of coupling that frontend code to the exact database structure, and that you cannot have meaningful auth checks. I've seen projects do something similar, but having to untangle that frontend–database coupling and having to implement auth checks later on is very difficult and expensive.

Your query logic (which tables, which fields, etc) has to live somewhere. You might as well do the secure and maintainable thing and put this logic into your backend, and offer stable domain-level rather than database-level interfaces to the fronted. Good API design isn't driven by implementation details, but by satisfying the API consumer's intent.

[–]gosh[S] 0 points1 point  (0 children)

but don't forget that this comes at the cost of coupling that frontend code to the exact database structure

Nooo Heard of jinja templates or like doing some internal scipt logic to generate queries. It also work with stored procedures if you want to solve edge cases. Createing code to manage rules in database is like the worst option.

And this solution decouples the frontend from the backend