Earlier quoted context omitted.
ORMs only make easy things slightly easier. Complex queries are not expressable in ORMs, so you need SQL queries (usually as strings, in external files or generated with a tool like jOOQ/LINQ). I think just doing all with SQL is easier to understand and maintain. I see no benefit of ORM considering the small benefits vs cost of learning. And your code become hugely dependent on them.
Agree 85%. 10% relates to cases where you want dynamically- generated queries, which is why Phrebar has facilities to help with this. No off-the-shelf ORM that I've ever used has done anything but get in the way. Another 5% disagreement over whether they even make easy things easy. They often require some contortion of your application code in order to work at all, like annotations or inheritance on value objects tha…
PHP is the new JavaScript?
81–88 of 88 posts
Re: PHP is the new JavaScript?
#82Laravel + Vue is a popular and straight forward framework pairing. With all the shade in these comments, there's almost no suggestion for alternatives.
Ktor + jOOQ + Elm + OpenAPIv3 generators for generating a type-safe Elm client and Kotlin DTOs for the serverside. IHP (Haskell) w/ HTMX. Elm + Lamdera; for small games (super low boilerplate). Hasura (Postgres + authorization exposed as GraphQL w/ generated schema) + Elm + GraphQL generator for generating a type-safe Elm client. Rust + Yew w/ Actix or Axum on the backend. Rust + Dioxus. The thing I propose is: use s…
Re: PHP is the new JavaScript?
#83Earlier quoted context omitted.
Ktor + jOOQ + Elm + OpenAPIv3 generators for generating a type-safe Elm client and Kotlin DTOs for the serverside. IHP (Haskell) w/ HTMX. Elm + Lamdera; for small games (super low boilerplate). Hasura (Postgres + authorization exposed as GraphQL w/ generated schema) + Elm + GraphQL generator for generating a type-safe Elm client. Rust + Yew w/ Actix or Axum on the backend. Rust + Dioxus. The thing I propose is: use s…
I like Haskell + htmx (HOWL stack).
Re: PHP is the new JavaScript?
#84JS has done the impossible: It made me kinda appreciate PHP. I still despise PHP for its many design (it wasn't actually designed, it just happened) failures, but I've yet to see an application running on a single server with PHP, Apache and MariaDB run slower than "modern" JS slop that needs half a cluster to run the dozens of random object DBs and caches JS devs insist on using prematurely where the application tak…
I had some modern "AI"-frontend that slowed my browser down to a crawl because i wanted to click a button. Vanilla Typescript and a bundler is enough overhead for me, most dynamic comes from fetched xml - i don't need a framework for that.
Typescript makes a lot of fun because it forces you to use clean interfaces and think about your design decisions - you cannot "write down" code like in PHP and i think that's great, but for a backend i will still resort to a database / shell env with php and some transformations and call it a day. It starts in 50ms and my TS-bundle is 500KB. That's ok i guess. The functionality is on par with modern pages hurling megabytes of code in my browser and taking ages and lots of promises to respond.
No wonder they all need kubernetes ....
I tried to befriend frontend-frameworks like React but the moment i saw i had to use hacks just to handle empty arrays i stopped reading and resort to write my own stuff for the frontend use case.
Re: PHP is the new JavaScript?
#85Earlier quoted context omitted.
I like Haskell + htmx (HOWL stack).
But what Haskell libs you use on the back-end?
You could use something like Yesod or even IHP (and that's batteries included). There is Servant, Spock, Scotty for lighter weight than those. There's also the newer hastl (haven't tried it). Yet if you are using htmx, you probably want to keep things simple. On the one hand, there is simplicity from having a framework already together for you. On the other hand you can get that simplicity from only having the dependencies that you actually want for your needs.
You need something to handle:
- server connection (everything is built on top of wai and warp). There's servant and scotty for lightweight layers on top of wai (which uses simple HTTP requests and responses)
- database persistence (for postgres - Persistent/Esqueleto, postgres-simple, hasql, Opaleye, etc.; for sqlite there is sqlite-simple)
- html templates (optional, but it does make writing html more convenient. blaze, lucid2)
- auth (server-session, client-session, or roll your own. Of course, stuff like Yesod gives you all of this out of the box)
- sessions (most people roll their own Session module. The reason is that it tends to be dependent on your database and other decisions you have made for routing, connections, etc.)
- routing (libs like Servant and Yesod come with routing out of the box. Of course, you could just route with strings, but why are you using Haskell if you don't want type-safe routes? There's also stuff like web-inv-routes that give you type-safe, composable routes.)
Ultimately, I think the best way to go down the bespoke path is to know what functionalities a web server/web app needs to have as far as categories like the above and then to build it up one piece at a time (maybe with side exploratory proof of concept mini-projects). If you don't have time for that, I'd just use one of the frameworks so you can ship.
Re: PHP is the new JavaScript?
#86Re: PHP is the new JavaScript?
#87Earlier quoted context omitted.
But what Haskell libs you use on the back-end?
That's a personal decision. You could use something like Yesod or even IHP (and that's batteries included). There is Servant, Spock, Scotty for lighter weight than those. There's also the newer hastl (haven't tried it). Yet if you are using htmx, you probably want to keep things simple. On the one hand, there is simplicity from having a framework already together for you. On the other hand you can get that simplicity…
But I was literally asking --and curious to the answer to-- what "you" (would) pick.
Re: PHP is the new JavaScript?
#88Earlier quoted context omitted.
Phpstan == TypeScript
A terrible typescript