Monadical-SAS / monadical.com

🖥️ Custom Flask + Jinja2 static site generator and content powering Monadical.com
https://monadical.com
10 stars 4 forks source link

posts/why-use-orm #67

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Monadical Consulting | Why should you use an ORM (Object Relational Mapper)?

Budding web developers learning Model-View-Controller frameworks are taught that they should use an Object Relational Mapper (ORM) to interface with their databases. But the “why” is often brushed aside or omitted entirely, leaving a fledgling programmer with burning questions like ”What are ORMs, anyway?”

https://monadical.com/posts/why-use-orm.html

starchip commented 3 years ago

Your writing, whilst interesting, never seems to consider why you should NOT use an ORM. This is the dilemma - to which you propose a ridiculous flurry of nonsense from other languages and scripts to solve. We were solving this before even SQL arrived on the scene - let alone Python.

OOP and Relational Databases do not get on with each other - and they never will. Attempting to get one talking to the other means that your own mental picture of these two separate worlds is compromised beyond repair. OOP means HIDING data. RDBMS means showing your knickers.

If you want OOP - go Smalltalk and stop messing about with all the others. If you want RDBMS then go IBM DB/2 and stop messing around. NEVER touch nor allow in your shop, something as naive as SQL. If your language needs to jump through hoops to get to DB/2 then change your language. Do it now. Data is all, everything. Any barrier between you and data should be removed.

DB/2 will optimise your indexes for any question asked and speed up the ones you ask for more often. It will allow outward left joins sooner than look at you whilst Python is still trying to construct them. It has them ready 'cos someone asked for them 18 months back. That is what a 24-hour running database engine does. If you do not need those capabilities then shutup about them and go back to cataloguing your DVDs. You think that IBM used SQL when it took on the IT of the Olympic Games? Nahhh - it was Visual Basic and a couple of Access databases.

Smalltalk will spend the next decade telling you that they have amazing interfaces to Databases. Really? Why don't they write one?

pirate commented 3 years ago

Hah I couldn't write satire this good if I tried @starchip.

starchip commented 3 years ago

Thanks for your kind comment pirate. A little background here; I was the IT Director of a British Mortgage Company (now retired). I had around 40 IT staff and max 300 end-users. IBM shop. Three AS/400s. Everything written in RPG, CLP and REXX. I wrote my resignation letter in REXX but it just kept recursively annoying my Boss. BTW. not many people know that the AS/400 was an OOP box.

Apart fom being pissed off with learners pontificating upon issues that I personally spent sleepless nights trying to fix when they were still in nappies or not even on the planet, I am also very worried about what I would call the fracturing of professional software practices. Easy stuff like "KISS" and "FONDLE" – though nobody ever told me what "KISS" stood for.

If you want to screw up those practises then do so and have a reason for doing so.

We did. For example; when I worked for a software house (same as a hardware house but made out of sponge), we used to push out new releases of our Banking/Mortgages/Consumer Finance Applications on an almost monthly basis. Each new release would have to be certified by the Quality Assurance team. So we (programmers) always gave them a system that worked. Then they could test it and approve it. Then we sent out the one we had written.

You got some stories?

cmougin commented 3 years ago

thank you. you have a typo to fix: q7_choice1 = Choice(question7, "Digital Ocean") q7_choice2 = Choice(question7, "Hetzner") instead of: q7_choice1 = Choice(question2, "Digital Ocean") q7_choice2 = Choice(question2, "Hetzner") I think.