2 ms·
You should be able to read a function from top to bottom and it should show you the whole procedure at a given level of abstraction. Hiding the details is the
by mkehrt 3y ago
You should be able to read a function from top to bottom and it should show you the whole procedure at a given level of abstraction. Hiding the details is the heart of what programming is.
I always try to write code like
fn foo() {
let foo = do_first_thing();
let bar = do_second_thing();
do_third_thing(foo, bar);
}
whenever possible. Then you can see the abstract overview of what the code does at a glance, but you can drill down into the details if you need to.