This research focuses on a comprehensive comparative analysis of shear strength prediction in slab–column connections, integrating machine learning, design codes, and finite element analysis (FEA). The existing empirical models lack the influencing parameters that decrease their prediction accuracy. In this paper, current design codes of American Concrete Institute 318-19 (ACI 318-19) and Eurocode 2 (EC2), as well as innovative approaches like the compressive force path method and machine learning models are employed to predict the punching shear strength using a comprehensive database of 610 samples. The database consists of seven key parameters including slab depth (ds), column dimension (cs), shear span ratio (av/d), yield strength of longitudinal steel (fy), longitudinal reinforcement ratio (ρl), ultimate load-carrying capacity (Vu), and concrete compressive strength (fc). Compared with the design codes and other machine learning models, the particle swarm optimization-based feedforward neural network (PSOFNN) performed the best predictions. PSOFNN predicted the punching shear of flat slab with maximum accuracy with R2 value of 99.37% and least MSE and MAE values of 0.0275% and 1.214%, respectively. The findings of the study are validated through FEA of slabs to confirm experimental results and machine learning predictions that showed excellent agreement with PSOFNN predictions. The research also provides insight into the application of metaheuristic models along with ANN, revealing that not all metaheuristic models can outperform ANN as usually perceived. The study also highlights superior predictive capabilities of EC2 over ACI 318-19 for punching shear values.