Modeling and simulation of photovoltaics helps to reduce development costs, design turnaround time and facilitates better techno-economic decisions. However, there is a current need to generate new theories, algorithms, applications and software in order to increase the contribution of solar energy to the global energy supply. For future advancements in the field of photovoltaics, robust techniques for PV modeling, simulation, visualisation and design are required to overcome the limitations of the current approaches. This study proposes the Code-Based Modeling (CBM) approach as a potent approach to facilitate the study of PV technologies. Experimental data were synthesised and used for coding and training of the code-based (CB) model; followed by a validation of the trained model using commercial PV modules. Results clearly show that the model can repeatedly and reliably predict the short circuit voltage, maximum power point, open circuit voltage with 0%, <2% and <10% deviations, respectively. Furthermore, instances of the applicability of the CBM approach in the study of the thermodynamics of PV, solar cell materials characterisation, PV systems design and power monitoring were presented. Above all, CBM approach accepts user-defined functions and therefore presents new opportunities for scientists and engineers to advance model-based investigations of the photovoltaics beyond the current state-of-the-art.