News for hackers. Stuff that matters.
Re:Things I Was Wrong About: Types by throwaway894345 on Sunday September 27, 2020 @01:37PM (#24608441)
I don’t know if this is pedagogically useful, but I think of types as shapes, variables (including struct fields and function parameters) as a shaped hole, and values as a shaped thing that can fit (or not fit) into those holes. Kind of like the children’s toy. You don’t want to pass a circle in to a function that needs a square shaped thing, and the type system helps make sure you don’t do that by accident.

There are no comments on this comment yet.