If you have access to a pc that can play Terraria, then that is probably the best option for you. You can buy it either on Steam or GOG and the game is often on sale (1/2 price) several times a year. If you get the Steam version you will need Internet access, as Steam itself acts as a form of online DRM that checks that you are authorized to use it. You can play while offline but only for a limited time and you need to put Steam in offline mode. GOG doesn't have this limitation, but generally gets updated a bit later than the Steam version. Also for other games GOG have a slightly different library, with more older games. Newer games are either not released on GOG (there's exceptions), or are released later on.
If you wish to play on the go, then only the Mobile version (currently 1.4.0) or Switch (currently 1.3.5) are viable options. The older 3DS version (a mix based on older Mobile 1.2.x) won't get updated any further simply because the hardware can't handle it. It has already been maxed out. Unfortunately they weren't able to take it all the way to 1.2.4, so instead they picked pieces here and there. It also doesn't support dyes/paint because the graphics hardware in the 3DS is too limited. For that to work it needs to have something called
pixel shader. There's something similar in the 3DS, but it's not capable enough.
Wii U is in a slightly different boat, being slightly more capable than PS3/Xbox360. It might have been possible to push it a bit further using the old Terraria foundations developed by Engine. But that would have cost more than it was worth and caused delays in the development for newer consoles. Ultimately it wasn't worth it.
Now both the 3DS and the Wii U has been discontinued. Nintendo no longer supports them, so it doesn't make any sense to continue updating them. The Switch is the successor for both, as it can be used both as a handheld and stationary gaming device.