5 ms·
There is a quote by Linus Torvalds that is relevant here: "Bad programmers worry about the code. Good programmers worry about data structures and their relatio
by amelius 8y ago
There is a quote by Linus Torvalds that is relevant here:
"Bad programmers worry about the code. Good programmers worry about data structures and their relationships."
- bch 8y ago"Show me your flowchart and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won't usually need your flowcharts; they’ll be obvious." -- Fred Brooks, The Mythical Man Month (1975)
- andai 8y agoI looked up the full text of the book, but couldn't figure out what tables mean in this context.
- mpweiher 8y agoYep. And this is why our industry's decision to focus on essentially procedural abstractions for our interfaces is...problematic.
- jstimpfle 8y agoLet me offer a different interpretation: That's why it doesn't matter so much if you're doing code in a procedural or functional way. If your data structures are wrong, the code will be bad, period.
- hiker 8y agoExcept that functional programming completely eliminates (yet still allows) concern no. 1 in the mentioned order -- state > coupling > complexity > code. Not to mention the better expressive power for describing data structures with algebraic data types (just + and * for types really).
- jstimpfle 8y agoThat's just not true. Functional programming does not eliminate state. You can't do computation without state. What fp does differently is it pushes state around like a hot potato. In my eyes that is about as problematic as OO (where you cut state in a thousand pieces and cram it in dark corners and hope nobody will see it). If you make global arrays instead you will always have a wonderful idea of what your program's state is, and you can easily use and transform it with simple table iteration.
- hiker 8y ago> That's just not true. Functional programming does not eliminate state. And yet it says so in the first sentence in the Wikipedia page for functional programming https://en.wikipedia.org/wiki/Functional_programming https://en.wikipedia.org/wiki/Functional_programming >a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. But I'll take it that you don't have much functional programming experience. Of course one can still go with a big global array and keep updating it in-place. A good programmer can write Fortran (or C in that case) in any language.
- 8y ago
- amelius 8y agoYes, and sometimes I feel this also holds in a way for user manuals.
- tigershark 8y agoData structures and their relationship cannot express everything. SQL is not Turing complete if you don’t use CTE to introduce recursion. And I think that we all agree that SQL is perfect to work on data structures and their relationship.
- Erlich_Bachman 8y agoThe original comment is on a completely different level of analysis. I think that if you know about Linus Torvalds, that you will agree that he knows what SQL is and how it differs from a turing-complete language. The point being made is much deeper and philosophical, and makes a lot of sense in complex systems.
- johnny22 8y agodoes he know how SQL works?
- tigershark 8y agoI “know” who is Linus Torvalds since when I installed my first Linux distribution on my 386sx 25mhz when I was 14 or so in 1995/6. I think he is very smart but sometimes I disagree with him and with his harsh way of relating with the rest of the world. Now, after a useless appeal on authority, would you mind to explain what is wrong with my opinion about data structures and relationships? I don’t really think that you can do everything just with data structures and relationships. If you think the opposite than please explain how you can do everything with something not Turing complete.
- Erlich_Bachman 8y ago> I don’t really think that you can do everything just with data structures and relationships. No, you can't do everything with just data structures. Everyone knows this. 1st-year junior programmer knows this. It's obvious. The original question did not talk about this, you misunderstood the level of analysis it was aiming at. The fact that SQL is not turing complete is a meaningless truism here, because Linus obviously did not mean that we should all start using SQL instead of C. The point he is making is that data structures are of much bigger importance to get right in order for the program to be good. Not just fast or just maintainable, or just easy to understand. But all of those things and many others.
- jsharf 8y agoI think you're just misusing that quote... At the end of the day, for any given datastructure setup, an algorithm still needs to be implemented. There's many ways to slice that pie, and depending on how you do it, that can cause a lot of saved time or misery for the engineers you work with.
- deleted 8y ago[deleted]
- emmelaich 8y ago"Algorithms + Data Structures = Programs" is a classic book by Niklaus Wirth. It was one of the first to emphasis data structures in addition to code. There is a free pdf online[0] discussed on HN in 2010.[1] (from wikipedia) "The Turbo Pascal compiler written by Anders Hejlsberg was largely inspired by the "Tiny Pascal" compiler in Niklaus Wirth's book."[2] [0] http://www.ethoberon.ethz.ch/books.html http://www.ethoberon.ethz.ch/books.html [1] https://news.ycombinator.com/item?id=1921125 https://news.ycombinator.com/item?id=1921125 [2] https://en.wikipedia.org/wiki/Algorithms_%2B_Data_Structures_%3D_Programs https://en.wikipedia.org/wiki/Algorithms_%2B_Data_Structures...
- fourgoodboys 8y agoTo add a little of poetry, another quote: In fact, I'll take real toilet paper over standards any day, because at least that way I won't have splinters and ink up my arse. From linus rants: https://www.reddit.com/r/linusrants/comments/8ou2ah/in_fact_ill_take_real_toilet_paper_over_standards/ https://www.reddit.com/r/linusrants/comments/8ou2ah/in_fact_...