6 ms·
You know, I'm pretty sure you could build a PHP monolith in 2023 without a framework and it would do what it needed to do.
by bovermyer 3y ago
You know, I'm pretty sure you could build a PHP monolith in 2023 without a framework and it would do what it needed to do.
- tored 3y agoYes, I recently built a small PHP example project for educational purposes and I intentionally avoided all external dependencies for demonstrating how you would solve things without a framework or library. You can do almost everything you need with plain PHP without too much effort except a few exceptions that you shouldn't waste your time on, most of them are tooling however and not for the application itself, like unit testing, error tracking and logging, database migration, but for that you of course use libraries.
- asdfman123 3y agoBad coding is infinitely worse than a “bad” language. I don’t know how many of you are musicians, but many people are surprised to find that the tone quality of a guitar has way more to do with the person playing it than the way it was built.
- dmbche 3y agoSurprising! Will look into
- emodendroket 3y agoBad languages, more than anything else, frustrate your expectations and encourage developers to do things that are difficult to maintain. Sure, a great basketball player can dribble with gloves on his hands, but he’s making the task harder on himself, and anyone who’s less than great is less likely to be able to hold on to the ball at all in that case.
- gabereiser 3y agoA great player can make a Squire sound like a Studio Strat. Indeed. The type of strings make a difference too.
- bedobi 3y agoWhat do you mean "the type of strings"? In pretty much every programming language, String is one of the most fundamental types. There's no "different types of string". (yes, this is a joke, a bad one at that. badum tish)
- justinclift 3y agoMeh, "text" is where it's at. "varchar()" is so Oracle. :p
- selcuka 3y agoObviously you haven't seen the Substring [1] type of Swift. [1] https://developer.apple.com/documentation/swift/substring https://developer.apple.com/documentation/swift/substring
- gabereiser 3y agoBut this is a slice. So technically a []char?
- selcuka 3y agoNot really. It's only a reference to the original string, a start index, and an end index. It doesn't store a second (partial) copy of the string.
- agent281 3y agoIn some languages it's two or more of the fundamental types. Obviously you haven't been using the big brained languages like Rust, Haskell, or Elixir. (Also a bad joke.)
- sgtnoodle 3y agoWhen I worked at Google, they had their own string type in place of std::string for various reasons. Python has byte strings, Unicode strings, format strings, regular expression strings, and probably a few others! Rust has str and String, depending on ownership.
- emodendroket 3y agoKind of depends what you’re building.
- richardbarosky 3y agoCan confirm. judyrecords is built on a near framework-less monolith in PHP + 2 search servers. Searches complete within 100 milliseconds and SRPs return in less than 15 milliseconds on average. Runs a trimmed down version of CodeIgniter 2 (released in 2012) updated to run on PHP 8.2. Still got the CI 2 profiler. https://postimg.cc/TLbvvSzm https://postimg.cc/TLbvvSzm https://news.ycombinator.com/item?id=30481230 https://news.ycombinator.com/item?id=30481230
- Aeolun 3y agoI wonder how many people did their own CodeIgniter updates. I’ve also almost completely transformed the thing, but the base is still CodeIgniter.
- richardbarosky 3y agoCurious, if you don't mind sharing, what site/app!?
- pphysch 3y agoSure, but framework-less PHP incentivizes poor architecture (hey we can do everything in 1 file to KISS x 100 endpoints = microservice hell). Requires an expert and disciplined engineer to execute well.
- pbreit 3y agoNow that PHP has lost its massive deployment advantage, step up to Rails or Python.
- criley2 3y agoRails and python aren't a step up from PHP for webservers. Both are massive steps down in terms of real world performance. https://www.techempower.com/benchmarks/#section=data-r21 https://www.techempower.com/benchmarks/#section=data-r21 Personally if I was "stepping up" from PHP and wasn't going to use something powerful (or didn't need all that power) I'd be stepping up into javascript and nextjs and stuff like that.
- mycall 3y agoI hear about Python all the time. Rarely hear about Rails now. I think the world picked one over the other.
- berkle4455 3y agoBut PHP is blazing fast compared to either of those (hot code ready to accept traffic in all scenarios so we can ignore warm-up times)
- anditherobot 3y agoQuestions for every 100 dynamic websites. How many can truly outgrow PHP + sqlite + jquery ?
- Aeolun 3y agoPDO databases are pretty nice.
- viraptor 3y agoSure you could, but it would take a much longer time and you'd miss lots of functionality. How long would it take you to build user registration / verification / password recovery / 2fa / sso / profile editing / spam registration prevention / etc. ? How long would it take instead to include some Laravel module which does all of that? If you're building a service with some purpose, do you really want to spend days writing the first option instead?
- tored 3y agoHow many hours spent on battling Laravel to do what you want? How many hours spent on upgrading Laravel versions? Framework solves a general problem, but we try to solve a specific problem, thus it will always be a mismatch, frameworks usually solves that with a combination of magic and opaque abstraction layers. Frameworks works best for short running projects, long running projects tend to outgrow the framework. Prefer libraries over frameworks.
- viraptor 3y agoThat works for some things better then others. For example user management is hard to do as a library, because now you need to hook up all those actions / pass the data to them manually. Then make sure you handle all the headers correctly. Then handle the sessions/invalidation yourself. Potentially implement your custom authz as well because that's also happening throughout your app. There's still a lot of glue code that would be involved here - it may be worth trading it for the occasional Laravel upgrade.
- thezilch 3y ago100%; we do that (see profile).