by gregjor · 2y ago · 0 comments
Sockets: Don't use but if I did I wouldn't need a framework.
SPA: I don't write apps that way. Server-side, which is why we're talking specifically about PHP and Go.
Queue handler, scheduler: Can easily do in the database or with Redis.
Container: What? Do you mean something like Docker? That has nothing to do with the web app development language or framework.
Auth: OAuth2 and SAML not a big deal, but maybe worth introducing a dependency depending on requirements. Regular username/password/MFA auth easy to implement, certainly no framework needed for that.
Likewise with routing, "MVC" structure, etc. Frameworks can save some time beginning but eventually you have to debug them, or run into limitations to work around. And one day the framework gets updated and you have to deal with breaking changes.
you should always prefer a codebase optimized for the business, the purpose & the people who work on it everyday. if that requires more time to grasp it for newcomers, perfect. people make that weird argument all the time for going with a framework due to popularity & common ground. that’s so absurd. optimizing for onboarding time & quickest graspability, when that factor is usually irrelevant in most projects.
also, the best thing about modern PHP are the PSRs. They are not appreciated enough. Stick with them. Don’t be clever. Don’t use magic. Be explicit. Don’t don’t repeat yourself. Write code like your mom reads it. Et voilá, your homemade framework is gonna be just fine.
Especially compared to projects built around frameworks by devs who very rarely if ever look at the source code of the magic they use. debugging and fixing those issues took more of my lifetime than the hours i’ve put into updating my personal web app framework (latenight-php).
Also: Choosing which tire you want doesn’t equal reinventing it. And also: thank good people reinvented the wheel so many times… imagine EVs on rolling stones or wooden wheels.
Elitism is not welcome here. Are you a "semi-skilled" programmer if you are a web dev and don't know C++ and pointers? Are you a "semi-skilled" programmer if you are an embedded developer and don't know JavaScript?
> If you only know a framework
This makes the assumption that by knowing a framework, you will be unable to learn how to use the language at large. This is not necessarily true - a person who has learned Laravel will probably figure out CakePHP or CodeIgniter in a weekend. They just prefer Laravel for their jobs, and that's a legitimate choice. They've also made the decision that, even though Laravel makes breaking changes over time, the productivity boosts are greater than the downtime.
Which is also a legitimate choice when Laravel upgrades have been automated for years for $29. https://laravelshift.com/
Anyone who prefers Laravel or any other framework can use it. I wrote that neither PHP nor Go need a framework because they have everything necessary to implement web applications.
If you don't want to get laid off because everyone and their mother, and now LLMs, can copy-paste Laravel sample code for $15/hr (see Upwork, for example) improve your skills. If you want to have more opportunities in the programming job market expand beyond frameworks and learn the underlying languages and libraries.
You should absolutely learn the language, but reinventing the wheel on every project is not the way. And if you're not reinventing the wheel, then all you've done is create your own framework that only you know the ins and outs of. Sounds more like you're looking out for your own job security than anything.
SQL does support code reuse and building layers of abstractions. If you only use SQL through an ORM you won’t get to use things like CTEs and views and user-defined functions, because ORMs by definition deform the relational model and SQL to fit OOP.
In 40+ years programming SQL expertise has paid the bills and kept me employed more reliably than any other language or tool I have mastered.
No. First and foremost, SQL is for tablational databases. A relation and a table are similar, to be fair, but have some key differences:
- A relation is an unordered set of tuples. SQL opts for an ordered list of tuples (a table) instead.
- A relation has no concept of NULL. A table does.
- The implications of those differences also bring a whole bunch of other differences that further divide SQL from the relational model.
SQL's only association to relational databases is in its name, being originally SEQUEL which was a play on QUEL – a language actually for relational databases that was a direct adaptation of Alpha from Codd's original paper.
> The concept of composability doesn’t apply.
Of course it does. Why wouldn't it apply? Datalog, a declarative language for querying data, is in many ways similar to SQL and it supports composition just fine. Many of the compile-to-SQL languages also support composition just fine. SQL could be composable. It should be composable. It just, because it still desperately clings to its COBOL-era glory days, is too afraid to add support.
> In 40+ years programming SQL
40+ years of working with SQL and you are still this confused about it...?
SQL the language does not require or describe ordering in tables — that happens as a side-effect of the physical implementation. No one should rely on ordering of table rows.
> A relation has no concept of NULL. A table does.
Null values occur in relations as soon as you write outer joins. All modern RDBMSs also allow defining nullable columns in base tables, and SQL allows/supports NULLs in that context, but with a little work one can eliminate nullable columns in base tables (we’ve already left pure relational land talking about base tables). But you cannot eliminate nulls from query results if you use outer joins.
The shortcomings of SQL with respect to a pure relational model are well-known. For all practical purposes we have SQL. Almost everyone using a popular relational database engine — those that might have ORM support — uses SQL. The history of SQL and niche alternatives, while interesting, don’t have anything to do with using an ORM vs writing SQL.
I’m not confused about relational vs SQL. I just didn’t think the pedantry would add to the discussion.
Pointing out that SQL doesn’t implement the relational model correctly seems like pointing out that C++ doesn’t implement object oriented programming as Alan Kay defined it. True, but C++ got a lot of adoption and Smalltalk did not. Pointing out the OO shortcomings of C++ don’t help with using the language.
Programmers comfortable writing in PHP and Go with their comprehensive standard libraries can also work with frameworks if necessary, but those who can’t get stuck as Laravel developers, baffled by the much larger number of projects and existing code that doesn’t use their “correct tooling.”