Comment

Comment by munificent

> From my perspective, Go added methods primarily so that you can use them in combination with interfaces.

They also give you a limited form of overloading. Without methods or overloading, you end up in the situation that C and Scheme are in where every operation on a data structure has to redundantly have the data structure in its name like:

    list_clear(my_list);
    queue_clear(my_queue);
    map_clear(my_map);
parent munificent 2 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton