Re:I’m a productive programmer with a memory of a fruit fly
by dotancohen on Monday September 19, 2022 @04:08PM
(#32903221)
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.
[ Parent
| on HN ]
Re:I’m a productive programmer with a memory of a fruit fly
by rlayton2 on Monday September 19, 2022 @08:14PM
(#32905942)
Similar 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.
Re:I’m a productive programmer with a memory of a fruit fly
by adolph on Monday September 19, 2022 @08:48PM
(#32906219)
I 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...
Re:I’m a productive programmer with a memory of a fruit fly
by andirk on Monday September 19, 2022 @11:52PM
(#32907470)
Here's to looking at you `get` and `set` decorators.
Re:I’m a productive programmer with a memory of a fruit fly
by ParetoOptimal on Monday September 19, 2022 @09:37PM
(#32906595)
Top down design is great.
Especially in Haskell where you can stub those functions as undefined and get type checking along the way.