Programming what? Your typical program in a learning environment is a few KB probably through the first few years of schooling, same for learning databases, they aren't very large. If you wanted to do game or app development with assets and textures, that will depend on the size.
Here's the thing though, get 8GB and find out, you can always get more RAM.
The r5-2400G is a decent low/mid gaming platform. Some of the latest games might require some pretty minimal settings, but anything from a few years ago and light games from today will be fine.
RAM speed is important to APUs, so make sure to get a B350 board at least and get 2933 (3000) or 3200Mhz memory.