|
|
|
|
|
by dan-robertson
2784 days ago
|
|
One thing which I think might be useful for speaking code is to try to avoid needing a mental stack or going backwards as you go through code (at least for English speakers. Maybe other languages are different). For example consider reading aloud: x = some_function(something_else(y), z)
You first need to keep in mind “x =”, then “some_function”, then think about what something_else(y) means, remember about some_function, think about z, then remember it all goes into x.Now compare: something_else(y)
-> some_function(z)
:> x
Read forwards as “do something_else(y), now take it and do some_function to it, modified as z; now put it into x.” |
|
It's much easier for me to interpret JavaScript or PHP method chaining. I find myself struggling when I can't use an ORM.