By slayerment on
I was working on my site the other day messing around with comments when I came across a revelation:
Why aren't comments treated as a node type?
It seems to me like it'd make perfect sense. I mean, Drupal is node based and any type of content should be treated as a node. However, comments are not treated as nodes, and as a result I think it creates problems. I really can't think of any advantages to using comments instead of nodes, but I can think of many reasons to use nodes as the standard way to comment. It would be much easier to theme, and it would be much more modular with other node based features.
It seems to make great sense to me.
What do you guys think?
Comments
I think there has been much
I think there has been much interest in this possibility, but it might be a substantial performance hit. Right now, as I understand it, all the comments for a node are serialized into a single object that can be retrieved from the database in a single query.
---
Work: BioRAFT
That's what I understand, too.
There is a lot of processing and queries that go into rendering a node. If you had a page with hundreds of comments - which is not uncommon, you could run into issues.
But it does seem to be a perennial issue around here.
Michael Samuelson
Idaho Commission for Libraries
mlsamuelson
That sort of makes sense. I
That sort of makes sense. I would imagine most of the performance issues that are being referred to are derived from using the node_load function to load in all the data for a single node which could create lots of performance issues. But what if there was something say comment_load that only loaded the necessary data for that node. If you had a function pulling the exact same data as the comment module that used the node table instead of the comment table it seems to me like it would be treated the exact same.
Any thoughts?
yes, but you'd still have
yes, but you'd still have lots more potential queries. And why make the comment a node if you're going to neuter it by not running the full node load?
---
Work: BioRAFT
There's one major thing
There's one major thing stopping comments being stored as nodes: lack of someone submitting a patch for it! :)
Discussion
You can find a discussion on the same topic here.