Depends on the break. One of the most significant improvements in fracture treatment is the improvements made in the intramedullary nail. These are nails that are driven through the middle of long bones to stabilize fractures. Compared to casting, they generally reduce the time to recovery, improve union likelihood, reduce time to early ambulation and PT. Even after initial re-union and healing, they share some of the load while the bone fully heals, reducing the risk of re-injury to that bone.
They aren't entirely risk free. There can be infection. Pain from the nail itself or the screws used to lock it in place at either end. Etc. Sometimes a second surgery is required to remove the nail for pain.
Not all fractures can be treated identically. Relatively minor breaks will have relatively minor improvement in outcome from rodding. If you hear an athlete is considering surgery vs casting, that's a good sign that the break is relatively minor. With major breaks, there isn't anything to consider, it has to be surgically fixed.
Simple fractures like this, can be treated with casting or surgery. Many athletes will opt for surgery so they can begin PT ASAP and minimize the muscle wasting that we see with casting.
Devastating fractures like this obviously require surgery
Here is a picture of a fracture fixed with locking intramedullary nail. You can see how this acts as an "internal cast," supporting the break and allowing for earlier PT
There have also been improvements in the plating systems for fracture fixation. The long and short of it is, we have improved techniques to the point that it makes more sense to surgically address these fractures. It generally reduces recovery time and improves outcomes.