How to build apps pragmatically
alextoussaint.com
alextoussaint.com
Like Facebook, WordPress and MediaWiki? Bashing PHP is a popular pastime, but front-end performance and inclusion are not to be scoffed at. Especially not if your target audience has a different standard of living than that of a major European city.
Personally, I'm much more worried about optimizing heavily third-party dependent front-end code to perform well on old laptops and cheap phones than I am with scaling up and load balancing a server-rendered site.
Yes, exactly. Facebook, Wordpress, and even MediaWiki have had man-centuries put into them.
If you want a polished result in less time, you should consider a different approach than server-rendered PHP for everything.
Mocking inclusion and front-end performance is quite contradictory to "Use The Right Tool". There are several cases where server-side rendering has a place and there are several frameworks and approaches that help with the complexity, just like there are cases when client-side interactivity is a better choice and you can pick a framework that will help with performance and cross-browser issues - and complexity, which exists on the client side as well.
Also one can get over-eager with abstractions over things that are not real duplicates. They just happen to look similar at this moment in time.
In this category, I would also put premature automation before learning what it actually is you are automating among other things.
Or more generally: Don't try to be clever about something you don't (yet) understand.
The first thing I like to do is solve the problem, period. Without inventing anything, just simply write code to cover most cases. Then I'll start improving on it in small ways, cutting down on duplication and inventing abstractions; until I reach a tipping point where I can visualize a complete design, which results in a major refactoring.
It looks messy in comparison to so called best practices, but it's faster and the code that comes out of the process is clearly better.
DRY is hurting more than helping if you ask me; because it shames inexperienced developers into premature abstraction, causing plenty of pain and misery along the way.
I fell into the trap of premature abstraction yesterday: I spent an hour breaking down functionality to make it “easier” to implement different backends, only to realise that the “abstraction” was strongly coupled to the structure of the single backend I’d written.
Young me would have forged on regardless because “abstractions”. Old me threw it away.
i think i read that in POODR by sandi metz
Also quite like Fowler’s observation in Refactoring that (to paraphrase) abstractions are earned, not enforced.
https://en.wikipedia.org/wiki/Rule_of_three_(computer_progra...
Also, IMO, some old tools are not bad, even if they're out of fashion. I can write web application with Java Servlets and JSP like it's 2000 and it'll be fast and performant enough for many use-cases, not everyone have to use React. So if some tools are not that good, but you know them very well, may be it's worth to keep them around.
IMO, the criteria to use when evaluating a tool are 1) cost of building it yourself, 2) how well you know the tool, 3) how big the community is, and 4) how well the tool fits the job.
Yes, but that doesn't make them simultaneously good advice. The tension among these three is one of the trichotomies of technical leadership.
Laravel is far newer and more popular than Django and PHP is both newer and more popular for web dev than Python.
Why would the author insinuate Laravel (and presumably WP and the rest of PHP) will be dead by 2030? For that matter, is it pragmatic for a startup to worry at all about what the best choice ten years in the future will be?
I think the author meant that writing a complex server-rendered webapp in PHP would take very long, hyperbolically saying it would take until 2030.
So a watcher view is probably a view that returns an extremely short response. It's just telling you whether more data is available, or not.
They mention websockets as an alternative that's far more complex.
"These are views that tell you when a model changed last. Watcher Views are light enough so that you can continuously call them to know whether you should fetch recent data. They're far less complex than WebSockets and avoid the performance costs of continuously polling unchanged data from the API."
HN is going down in quality with trash like this.
I understand that as exactly what was written. Plain old PHP is the old thing here. It could be a PHP vs Laravel comparison instead of PHP vs Django as well.