AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Object-Oriented Programming - Is Reflection Required?
If you write a program and you rely too much on reflection, you will be rejected by a code reviewer. If you use structs and access field with reflections, it's the same as using maps. You cannot create a priori data types for every possible combination. In object-oriented programming, what you need to do is to create another struct or if you do static typing,. While if it's used to map, you can, in a map,You can rename fields. It's just two-line functions to rename a field in a map.