I've started a text file on my computer called "programming_lessons.txt". I'm thinking I'll write down insights I have about programming throughout the day, and go back and reread it now and then to remind myself of what I've learned
(
Read more... )
Comments 6
Writing these down seems really healthy -- I'm feeling inspired to try to be more self-monitoring with my programming habits. I feel like I'm often not very conscious about how I go about working. I'm getting better about thinking about what I'm doing, but maybe not how I'm doing it. Yet.
Reply
Reply
also, 4 and 5, I say: don't treat unit tests like code!
I'm suspicious of moving a test into a function.
Reply
Reply
Nonmember nonfriend functions improve capsulation by minimizing dependencies: The body of the function cannot come to depend on the nonpublic members of the class. They also break apart monolithic classes to liberate separable functionality, further reducing coupling. They improve genericity, because it's hard to write templates that don't know whether or not an operation is a member for a given type.
Granted, it does help that by convention in C++, free functions in the same namespace as a class that they operate on are normally considered part of that class's interface due to argument dependent name lookup.
Reply
- do [thing]
- assert that object has/lacks validity/completeness/whatever
. Creating AssertHasWhatever() and AssertLacksWhatever() is a win in those cases.Reply
Leave a comment