2 ms·
That's really strange. In my era I knew a lot of C programmers who specifically advocated this as a "better way to do objects" than C++. Even some who in a pi
by dnautics 6y ago
That's really strange. In my era I knew a lot of C programmers who specifically advocated this as a "better way to do objects" than C++. Even some who in a pinch implemented their own v-tables, freely admitting that occasionally copping an idea from C++ and turning into an explicit contract is a thing (though this was painful enough that you would rightfully do this rarely).
It's even more strange now, that we have distinctly non-OO languages that explicitly use the first-parameter-is-struct pattern, e.g:
struct definition: https://github.com/elixir-lang/elixir/blob/v1.10.4/lib/elixir/lib/calendar/date.ex#L54 https://github.com/elixir-lang/elixir/blob/v1.10.4/lib/elixi...
and functions: https://hexdocs.pm/elixir/Date.html#functions https://hexdocs.pm/elixir/Date.html#functions