Better HN
topnewbestaskshowjobs
Log inSign up

wizpig64

4 karma · joined Dec 18, 2010 (15y ago) · 4 submissions

Submissions

comment 3y ago · link · parent

I was not expecting the last egg to look like that.

comment 4y ago · link · parent

I would love to have such a knob be mapped to speed up or slow down/rewind any video or podcast I'm watching or editing on the fly. Unfortunately no software would ever support this, someone would have had to standardized it 20 years ago first.

comment 8y ago · link · parent

It means they'll put a touch bar on it for selecting emojis

comment 8y ago · link · parent

This second example:

    [bar(x) for z in stuff if (x := foo(z))]
is not equivalent to:

    [bar(foo(z)) for z in stuff if foo(z)]
because here, foo(z) will be called twice. If foo is an expensive operation or performs some other magic in the background that you don't want to call a second time, := lets you express this behavior without having to break your expression out into a huge for-if-append code block:

    output = []
    for z in stuff:
        x = foo(z)
        if x:
            output.append(bar(x))
Of course, the above verbose language might end up being a better code in the end, because mashing together a bunch of terse code is often not very readable. But in real life, transforming a comprehension into a loop is just a bunch of work that gets in the way of me trying to complete a task.

When I'm developing out an idea and just want to see if the code works and passes my tests, I would rather have the option to insert behavior swiftly without having to reformat an entire block of code. Then when reviewing my code or deciding whether to make it reusable for something else, I can go back and clean things up.