(2022-02-19) Jeffries Strawberries11 The Power Of Intention

Ron Jeffries: Strawberries 11: The Power of Intention.

Express Intention

*Instead of coding these things out longhand, first: Express our intention:

function createScene()
    Scene = craft.scene()
    createDaydreamingAdventurer()
    createWanderingKnight()
end

Wow, we’re nearly done! We just have to write a couple of functions.

Failing That: Extract Intention

Sometimes, especially when I’m following something I found on the web, or copying and pasting, I wind up creating code that does one thing after another all in a row

This works but won’t be easy to read. Make it express the intention, after the fact, by extracting functions or methods, one at a time

TL:DR: Go Faster With Intention


Edited:    |       |    Search Twitter for discussion