Hacker News new | ask | show | jobs
by RcouF1uZ4gsC 2555 days ago
>OK, OK. I get it. The functions that operate on the data structure are not specified by the data structure but the existence of the data structure implies that some operations must exist.

This reminds me of Linus's quote:

"

I'd also like to point out that unlike every single horror I've ever witnessed when looking closer at SCM products, git actually has a simple design, with stable and reasonably well-documented data structures. In fact, I'm a huge proponent of designing your code around the data, rather than the other way around, and I think it's one of the reasons git has been fairly successful ().

() I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships.

"

https://lwn.net/Articles/193245/

2 comments

I may need to reread it, but wasn't one of the key arguments in Parnas' "On the Criteria To Be Used in Decomposing Systems into Modules" that by modeling around data we fall into the trap of writing code that's "temporally" dependent?
I think the author makes a good argument about how data structures and objects/classes are different.

I'm one of those people who designs the data first and then the code. But when you design the code, you shouldn't be making it a one-to-one mapping with the data.

When you design your classes, they should be the best representation for the programmer to use and not necessarily just identical to storage format.

As well, the most convenient structure for the user of your classes is most likely not the best format for storage.