News for hackers. Stuff that matters.
Re:We need to talk about parentheses by mkehrt on Monday February 12, 2024 @03:07PM (#39349729)
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.

There are no comments on this comment yet.