Your muscles use up muscle glycogen to do work, after a workout, your muscle glycogen will be used and ideally you would want to replenish these glycogen stores from carbohydrates for quicker recovery. Your body will feel hungry to replenish glycogen.
If your workout frequency is high, it'll be wise to replenish your muscle glycogen after gym. If you're consuming sufficient calories throughout the day/week, it shouldn't be that big of a deal if you're not an elite athlete lol.
Why not just simply workout before dinner?
If you eat a full meal right before gym, most of your energy/blood will be directed to your stomach to digest the food, leading to sub-par performance.