Both, I don't know all the code by memory.
Edit : I'm talking about smilies too, which I don't know them all.
about the "quote" "image" etc., it depends, but I usually first write the text, then select a portion of it, and finally click the button to "en-caps" the text with the quote/code/irl/img