Why do some sites/forums use bbcode or another formatting language when they could just allow filtered html?
There are a couple possible reasons:
- Security - Parsing BBCode and turning it into HTML can often be easier than trying to sanitize and secure the HTML. The security risk of missing a vulnerability can be high.
- Ease of Use - Some formatting languages, like Markdown, are less verbose than HTML. That said, Markdown is also less descriptive than HTML, so there is a trade-off.
When BBCode first came about, there weren't as many nice rich (WYSIWYG) editors as you see today. Early incarnations of these editors merely manipulated the plain text in the edit box that you were typing your post/reply into, adding BBCode as needed.
BBCode is easier for users to understand than HTML, and some power users would actually prefer to hammer out their messages without using toolbars or rich editors...
BBCode is more rigid than HTML, so it is easier to describe a simple markup syntax like BBCode than it is to try to educate a user on what HTML tags (and attributes) are allowed.