"Creating a product that works" may be the main goal. But it is just as useful as “creating a piece of music that is just rocks” for the aspiring composer. The main question is “ how to create a product that works”, which is largely related to skills.
Programming is such a wide field that you cannot just select a few "fundamental laws" that you can focus on. There may be 1,000 or 10,000 separate considerations, each of which is important in a particular context, from a certain point of view. The only way to learn the skill is to work, write code (this also includes errors), read other people's code, read (often conflicting) opinions and ideas from books and the Internet, etc. Do it regularly for 10-20 years and you will get well.
For example, is it possible to use a singleton approach to make a compromise between initial complexity (using statable singlets is a bit easier than link wrapping) versus future malleability (you may find that you "painted yourself" in the corner "later). Some people are dogmatic about avoiding globals (“singleton is evil”), and although this may be a good empirical opinion in general, globals and singlets have their own application. For example, the Java System class is a global singleton.
source share