Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Data structures are not the same thing as types. Data structures are bit patterns and references to other bit patterns (pointers or relationships). Types (as they are used in programming languages) place some constraints on those bit patterns, but can also encode many other language features.

Creating an elaborate type hierarchy with unnecessary abstractions is not what is meant by "worrying about data structures", and that tendency is one of the most common failure modes for otherwise smart engineers.



I think this is a subtle and important point. Types are a potential useful tool to restrain and and specify the schema of data structures. But concern for types is very different then concern for the data structures.


In OOP types and data structures have a much less visible border between them.


Exactally, which is why I think this is a subtle and important point.


Types are data structures that the language is aware of. This allows the tooling to do checks that they can't do on plain old data structures.


Data structures are algorithms at rest. They shuffle and move things each operation, but mostly sit still, like a turing machine that people only crank once in a while.

Types are the bits on disc.


Good catch.

Equating data structures to types is an over simplification that misses the core point.

I think the original call here is to simply think harder about the problem and avoid picking structures that'll burn you later.

For example, take Unix pipes, see how far they've traveled, how many domains, how many use cases. It's a brilliant way to visualize system building while respecting the constraints of minds and machines.

And it took Ken and others quite a while to realize something like pipes could make sense in Unix. It was not an insight easily obtained but required a bit of hustle and followup and obsession with finding the right building blocks for a system.


The same data structure can be assigned different types, that's what typedef operator in Pascal does.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: