Hacker News new | ask | show | jobs
by gamegoblin 1384 days ago
The magical thing is once shown examples of this in your code, or a comment saying as much, Copilot will adapt.

For example, I just gave Copilot:

    # The screen is inverted, so bigger y values are lower
    def lowest_point(points):
and it completed:

    # The screen is inverted, so bigger y values are lower
    def lowest_point(points):
        lowest = points[0]
        for point in points:
            if point.y > lowest.y:
                lowest = point
        return lowest
Even if you write some code that implies that bigger y is lower, Copilot will pick up on it.
1 comments

Notably, I think writing with copilot encourages you to write comments that provide necessary context.

Naturally, this makes it easier for other programmers to understand the code.