I'm currently learning the kanji by typing a word using romaji into my IME (google translate in my case), seeing what the first option is, and checking if that word has the same meaning as what I was trying to type in. Talk about "write only code"!
I'm not sure if it's a good or bad way to learn. Depends on whether I want to be able to write kanji by hand at some stage, and how much Japanese I want to learn, I guess.