5 ms·
I bumped into an old friend recently and he and his wife work at a real estate company. They were raving about this new system they are a couple of years into
by xd 4y ago
I bumped into an old friend recently and he and his wife work at a real estate company. They were raving about this new system they are a couple of years into the development of and how it's built on this great "Kubernetes" system.. they asked what I develop my products with and I almost felt embarrassed to say PHP and a couple of servers in two locations for redundancy that run Archlinux with a LAMP (LNMP? I guess with NGINX/MariaDB these days) stack .. same thing I've used for 20 years now (I was one of the first AL volunteers). When I asked what language their system is developed in they said Kubernetes, of course.
Anyway, it kind of reminds me of the days when everyone was developing a PHP Framework .. I've never used one and if I was to apply for a PHP job I'd be unlikely to succeed as I'm very specialised in getting shit done.
- yrgulation 4y agoThing is if you understand php you dont really need a framework. Sure composer packages are a must to avoid rewriting whats out there, but a framework not so much. When i conducted interviews i was shocked at how many php devs had no clue about what an sql injection is, they almost all answered “the framework does it for you” and it was such a basic thing.
- xd 4y agoOh god ORM's, pointless waste of time and just an excuse not to learn SQL.. almost as bad as the #1 PHP fallacy; Smarty (which is still a thing).
- yrgulation 4y agoBut “what if we switch to a different database engine”? Yet i’ve never seen that happen! Edit: wait smarty still a thing!?
- xd 4y agoI used Postgres when I first started out in ~2002 but it was slow, really slow, I switched to MySQL and it was fast and the customers happy. The MyISAM table engine was shit hot(fast) but it took me years to get my head around constraints and then indexes etc to actually get a basic level of competence and realise MyISAM was a bunch of trade off's for performance. Anyway I loved PG and still do romanise it.. what if I stayed.. what could have been.. but it didn't get the job done, for me. Edit: oh yeah Smarty is still a thing and so is PHPClasses.org whilst I think about it.. I've nothing against PHPClasses apart from it tries to pass itself off as something other than it is.. an amateur coders exchange.
- bottlepalm 4y agoThis point of view is a fallacy itself. ORMs are about productivity and maintainability. Some of us write enterprise applications where ORMs are a godsend. They're not a replacement for being knowledgeable in SQL whatsoever.
- xd 4y agoIt's just my opinion based on 20+ years of developing data management solutions across thousands of customers.. any framework employs a set of beliefs and that creates a box you are constrained to think in, hell SQL is one of them boxes. You say "They're not a replacement for being knowledgeable in SQL whatsoever." .. so what are they then? Edit: I once spent/wasted almost 2 years of my life trying to develop the ultimate ORM. In the end I replaced it for a simple directory structure of API end points where every .php file does a specific job with good old SQL queries in there.
- bottlepalm 4y agoNot sure if you've used Entity Framework, but you can do compos (with logic) amazing complex queries with relatively little code in a way that is statically typed and super easy to maintain. I'm talking about pulling heavily structured data from the database without having to pull from flat tables and structure it yourself server side. Also working with databases with thousands of tables and relationships, hundreds of developers, weekly database schema updates, etc.. We still use raw SQL, stored procedures, jobs, profiling to understand current db hotspots, etc.. ORMs have their time and place just as everything else.
- yrgulation 4y agoBut you can already write amazingly complex queries in sql, and structure them as objects directly using pdo. If there are hundreds of developers working against the same codebase then that codebase is too large. If you need to query hundreds of tables in one go you need to consider denormalisation or using a document storage.
- 4y ago
- samhuk 4y agoI will be bias here as I made my own ORM (for typescript and postgre, no less), but I have to hard disagree. As other comments have pointed out, ORMs are about productivity, getting persistence done quickly. Also what you just said is widely applicable - by your thinking, all programming languages are "a waste of time" and an excuse to not learn how to write binary files/machine code by hand? Also, it doesn't have to be black and white - ORM or no ORM. No one is forcing you to choose between using an ORM for all of your persistence or not using an ORM for anything. It is continuous - you can use ORMs for a *proportion" of persistence logic. Few more points, but I think the drift is caught.
- yrgulation 4y ago“ Also, it doesn't have to be black and white - ORM or no ORM The sad state of the php world is that there is no other option but to use it. If something is on fashion then it _must_ be adopted. Writing your own is considered insanity and so is taking a different path than the mass, regardless of for good reason or not.
- Too 4y agoI ask this question a lot too, and yeah it’s shocking to see how many that believe things like magic quotes or some other unknown layer solve everything. Magic quotes is of course very different from an ORM doing the application-specific encoding. It’s just very worrying when people don’t know which layer of the stack sanitizes for them. For those of you young enough to not have witnessed php. Magic quotes used to be a popular configuration option that would sanitize all GET and POST inputs to make it safe to use in sql. Needless to say, it didn’t work and instead corrupts user data that is not intended to go through sql.