TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Mixing DOM and PHP objects for fun & profit

23 pointsby kouiskasover 14 years ago

6 comments

hackernewzover 14 years ago
Sounds like really bad coding taken to another level. At some point in your program you will know which thumbnails are needed for the page. Instead of structuring that logic and commenting it well, perhaps even turning it into a sub-system or library, you pepper the templates with database calls. And then, you waste more CPU time by scanning the full HTML output of a page multiple times.<p>This is like AJAX all on the server side. All the hassle of async processing with none of the benefits.
评论 #2177246 未加载
yinrunningover 14 years ago
Wow. This is a really ugly workaround for a problem that began when you started using MVC. I would assume that any savings in db calls is completely wasted in processing overhead. Even more was wasted just coming up with this rigmarole. More reasons why MVC is bad juju.
评论 #2178937 未加载
tlackover 14 years ago
I wish the examples here were more concrete. This could be a powerful mechanism, beyond the usual tiresome MVC.
评论 #2177050 未加载
评论 #2176428 未加载
adnamover 14 years ago
"Datex"? Scary. Not sure I agree that the example given at the beginning of the article is a big problem (why not just make the model apis more fine-grained?), and also not sure what this has to do with MVC specifically.
mildweedover 14 years ago
Do you have any stats on the CPU/memory usage difference using this approach? Obviously your database/memcache calls are optimized, but I'm curious what the overall effect is.
评论 #2176823 未加载
amccloudover 14 years ago
So... lazy loading database queries and including partial templates?