Hacker News new | past | comments | ask | show | jobs | submit | ziml77's comments login

It's been a meme for longer than that. The joke to bait people 20 years ago was "Why do they call it an Xbox 360? Because when you see it you turn 360 degrees and walk away"

You give them a hand saw because power tools are far easier to inflict serious injuries with. But if you're teaching a kid who's old enough, there's no reason to start on a hand saw if you have the power tools available.

You don't give a noob a table saw because he'll never understand why a hand saw is useful. He'll never appreciate that more often than not, the hand saw will easier and quicker.

But hey, what do I know. Im the kind of guy who gets to play with TMA and seriously considers purchasing hydrazine for work. What do I know?


It's probably best to act like more complex things are just syntax at the start. Leave the fact that something like range is just a normal function that returns a generator for later on.

Like if range was used like this:

    for i in range 1 to 100:
        pass
No one is going to ask how that works internally, so I don't think it's necessary to treat range(1, 100) any differently. For this usage it makes no difference if it's a generator, a list (excepting performance on large ranges), or if the local variable is incremented directly like a C-style for loop.

They admit it's contrived, but this isn't very convincing

    func printSum(a, b string) error {
        x, err := strconv.Atoi(a)
        if err != nil {
            return fmt.Errorf("invalid integer: %q", a)
        }
        y, err := strconv.Atoi(b)
        if err != nil {
            return fmt.Errorf("invalid integer: %q", b)
        }
        fmt.Println("result:", x + y)
        return nil
    }
It's not adding anything that the Atoi function couldn't have reported. That's a perfect case for blindly passing an error up the stack.

It does, it says which one of the two integers was incorrect

Why can't Atoi report that?

I think Atoi actually does say that, but it's just a toy example. Most often functions outside the standard library don't contain the arguments in their error values

Just for the data sharing feature alone it's worth using. It's so damn easy to onboard and maintain data sources when they have a Snowflake share. You don't have to worry each day about loading processes randomly failing and you don't have to write any custom logic to hit APIs and properly flatten and merge responses into the database.

It's not great on a smooth scrolling input device either. You need to carefully scroll to not leave it halfway through a transition. And there's no next/previous buttons available to step through properly. Best you can do is click the little bubbles in order.

Awww no! Keep using them proudly! Don't let AI ruin the awesomeness that is the em-dash :)

I bought a TP Link router to run in AP mode for WiFi 7. It has none of those antennae sticking out. It does have a little grid of LEDs on the front that I have set to the UwU face option though...


What's public here?


The JIT can optimize this. I know for sure if there's no captures in the lambda it won't allocate. It's likely also smart enough to recognize when a function parameter doesn't have its lifetime extended past the caller's, which is a case where it would also be possible to not allocate.


To add on that, you can define your lambdas as static to make sure you're not capturing anything by mistake.

Something like dates.Where(static x => x.Date > DateTime.Now)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: