3 ms·
Linus Torvalds agrees with you: > git actually has a simple design, with stable and reasonably well-documented data structures. In fact, I'm a huge proponent o
by beltsazar 5y ago
Linus Torvalds agrees with you:
> 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.
- masklinn 5y agoThis is also very much the norm for high-performance code, when you reach boundaries the code is often secondary to the data structure or memory layout.
- gnuvince 5y agoI agree with the importance of the memory layout of data structures, but I read the original article a bit differently from you and the person you are replying to. A common approach to programming is to model the problem, almost to anthropomorphize the components of a system. In this style of programming, the organization of data structures isn't about how to lay out bytes in memory, but about a role needed in the resolution of a problem. I almost think of it as having a bunch of little actors that we want to arrange in a certain way in a scene, shout `.action()`, and have the work be done. This is a style of programming that I was really into just a few years ago, but when I compared myself to other programmers that I really looked up too, I realized that they didn't engage in this type of programming theater. Their code _did_ have types, but it was to group data together, not to tell a story; it was very concrete and practical. And time and time again they produced better programs than I did, often in less time than me, and they avoided questions that would plague me for days (e.g., whose responsibility is it to do X?) So what I understood from the article is to avoid creating types upon types upon types to model the conceptual problem, and rather write code (which certainly includes data structures) that handles the data of the problem.
- skybrian 5y agoI think he’s talking about concrete data structures, though, not abstract types. I don’t think you would need generic types to write git?