Comment

Comment by mr_mitm

Why not just do something like this then? This:

    myfunction(data) {
        # do one thing to the data
        ...

        # now do another
        ...
    }
becomes that:

    myfunction(data) {
        do_one_thing_to_the_data(data)
        now_do_another(data)
    }

    do_one_thing_to_the_data(data) {
        ...
    }

    now_do_another(data) {
        ...
    }
Still linear, easier to get an overview, and you can write more modular tests.
parent mr_mitm 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton