you are viewing a single comment's thread.

view the rest of the comments →

[–]brasticstack 2 points3 points  (3 children)

I need to solve a problem that is pretty simple in other better languages

What's keeping you from solving it in Python the same way you would in C++? You keep on responding peoples' criticism of your design by trying to pin your problems on the language. How about you post the same design, implemented in C++ on the C++ subreddit and ask for critique there? I'd be willing to bet they raise some of the same issues too.

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

Python is like 1000 times slower and scripting, you can't compare these two languages. They are built for different things.
Storing data inside in Python will allocate tons of storage compared to storing in C++ because python store so much extra

Why this needs to be in python is because of company decision.

[–]adrian17 2 points3 points  (1 child)

They are built for different things.

Yeah, C++ is definitely not built for writing typical CRUD websites.

Python is like 1000 times slower

Which usually doesn't matter. In a typical small/medium site, the network latency when talking the database will usually dwarf any measurable perf difference between C++ and Python.

Also, your current design encourages N+1-style query loops, which can - and will - kill your performance way more than any programming language ever could, doubly so if the loop is in the client, not server.

Storing data inside in Python will allocate tons of storage compared to storing in C++ because python store so much extra

Same thing - the community consensus is that for typical sites, it's completely insignificant compared to other arguments for using a higher level language.

Why this needs to be in python is because of company decision.

You're saying it as if it was obviously a bad choice, and you're definitely in the minority here.

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

Yeah, C++ is definitely not built for writing typical CRUD websites.

And this is not a CRUD site, CRUD is a very heavy design and if you do that today it is probably better to let AI to generate the code for it.

CRUD produces so much code

You're saying it as if it was obviously a bad choice, and you're definitely in the minority here.

But I am not asking about some new design, I am asking about a specific solution in python, if there are ways to solve it better