Forums and chatrooms have different purposes, and although forums are seen as more "persistent", the chatroom at Discord is fully searchable, as you pointed out.
It's not really the plan to have Discord replace the forum. But if you intend to discuss code, ask for help and you are in a hurry - or would prefer real time replies instead - use Discord.
If you intend to discuss code and expect more detailed replies, the forum should suit it better.
If it's off-topic discussion, it's not for the forum at all. In that case, it's Discord. 😉
It's not unlikely that we will bring forum topics for live chats at Discord, and also that Discord discussions will end up getting their own dedicated forum thread.
It's all for community interaction after all, so one may suit (or please) each one better.