jeudi 19 mars 2015

How do I get into the habit of writing more modular code?


When given a programming assignment I always think of a single class that is in charge of everything. I don't know how to separate things how into their own classes, and, if I do, I always feel like they're unnecessary and revert back to the original code. I rarely use base classes and runtime polymorphism like virtual functions to create interfaces and hierarchies. I also don't use design patterns that could be very helpful but try to hard code everything myself. I feel like this is a very big weakness and I want to write code that is more modular but it's very hard for me to think of ways to do this. How can I teach myself to write modular code?





Aucun commentaire:

Enregistrer un commentaire