34 ms·
I do the same thing. I then replace the comment with a method name that describes exactly what the comment described, e.g. _getLowestFooIdFromBarCollection(). I
by dotancohen 4y ago
I do the same thing. I then replace the comment with a method name that describes exactly what the comment described, e.g. _getLowestFooIdFromBarCollection(). I then implement the code inside this private method.
- rlayton2 4y agoSimilar to my strategy. Write the code as if I had all these magic functions that did steps: def write_report(): db = connect_to_database() data = get_data(db) summary = summarise_data(data) save_report(summary) After this, do the same for each of these functions.
- adolph 4y agoI do pseudo code sometimes too. I notice that your functions/methods/whatever are verbs that are assigned to nouns. It reminds me of: Verbs in Javaland are responsible for all the work, but as they are held in contempt by all, no Verb is ever permitted to wander about freely. If a Verb is to be seen in public at all, it must be escorted at all times by a Noun. http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom...
- andirk 4y agoHere's to looking at you `get` and `set` decorators.
- ParetoOptimal 4y agoTop down design is great. Especially in Haskell where you can stub those functions as undefined and get type checking along the way.