6 ms·
this is way to low level for every programmer to know. While there probably is some use for this, the average java/python/ruby/node.js programmer will never nee
by thecatspaw 11y ago
this is way to low level for every programmer to know. While there probably is some use for this, the average java/python/ruby/node.js programmer will never need this information.
When working with embedded systems this information is more usefull, but very few programmers actually do work in that industry compared to others, e.g. web
- SilasX 11y agoExactly. As the saying goes, whenever I hear "what every programmer needs to know about ...", I unsafety my Browning.
- JustSomeNobody 11y agoWrong. Every programmer should know this stuff. You may not be directly manipulating memory in python, but you should know enough about memory (and other scarce resources) to know when you need to optimize your application. How are you going to know when you need to use __slots__ in python? Should java programmers just blindly throw -Xms<size> when they think they need it? How should they justify that? We have GB and GB of memory in our computers today, but all of the "I don't have to worry about memory constraints" have snowballed. The application we run today are nowhere near as efficient as they could be otherwise.
- peterwwillis 11y ago> the average java/python/ruby/node.js programmer will never need this information That's what every kid in school ever says about a subject they don't care about. They're usually proven wrong. Just in the first few pages you'll find this gem: This leakage is why a DRAM cell must be constantly refreshed. For most DRAM chips these days this refresh must happen every 64ms. During the refresh cycle no access to the memory is possible. For some workloads this overhead might stall up to 50% of the memory accesses (see [highperfdram]). You don't think a Java, Python, Ruby, or Node programmer might need to know this at some juncture? Having a deep understanding of how things work helps you visualize everything going on and see potential problems before they happen. This kind of deep thinking is helpful in all kinds of activities.
- SilasX 11y ago"Would benefit, eventually, at some point when butting up against resource limitations if they're advanced and do this for a while and no one's around to point this out of them on code review" != "everyone needs to know"
- bgilroy26 11y agoI think there's a big difference between "read once" and "know". When some people say a fact is "known" they mean strictly that you are able to recall that fact in toto. That is probably overkill for a Web programmer. After you read something once you don't strictly know it. However if you run into a related problem down the road, you have a good chance that you can remember enough of what you read once to put a Google query together and find the original article. After thinking about it a little more, what they probably mean is that while most programmers will forget most of what they read here (because they don't use it day-to-day) it is reliable information that will help shape their intuition about how memory works. That is probably what they mean about every programmer and this article. Every programmer ought to read and test their intuition about how memory works against the content in this article. If they are surprised by something they read, they have the chance to adjust their intuition so that it is closer to the truth.
- peterwwillis 11y agoI think I get what you're saying here. You don't "need" to know this to write code. Which is true - heck, you don't "need" to know how a tcp/ip connection works, or how disk storage works. But one day you might. When you put fuel in your car and you turn the ignition and step on the gas, the wheels move. So all you need to know is where the fuel goes and how to turn the ignition and where the gas pedal is. But one day, I guarantee you, the wheels will stop moving. When your boss storms up to your desk and says "Why aren't the god damn wheels moving?! We're losing ad revenue every minute!!", I hope Code Review Guy is around to tell you how fuel injectors work.
- yongjik 11y agoYou know, I have a really hard time imagining a situation where your boss storms up to your desk and says "Why aren't the goddamn wheels moving? We're losing ad revenue every minute!!" and you reply "Aww goddamn, I forgot to account for DRAM refresh cycle." There's knowing how fuel injectors work, and there's knowing how copper crystal in the wire admits an energy band for free electrons.
- andreiw 11y agoI agree. Don't read it and tell everyone else not to. Keep the competition low for the rest of us ;-).
- elihu 11y agoI agree with you to a degree. I think there are more systems programmers and people who work on performance-sensitive applications than you're implying, but I also think that there's really no such thing as a generic programmer anymore; everyone's specialized into their own domain and programmers from different domains have trouble understanding each other's needs, or understanding why the things they find essentially important are largely ignored by programmers in different domains. We all have a finite number of things that we can be experts in, so we tend to focus on the things that are right in front of us.
- mathgladiator 11y agoI would argue that java programmers need to know this since it is even more important with a garbage collected language. Java wastes so much that the Northbridge is basically saturated with GC traffic. Sticking to a few disciplined principles can make java performance competitive.