News for hackers. Stuff that matters.
Re:Understand Go pointers by danielvf on Wednesday April 26, 2017 @09:11AM (#14202618)
Actually you don't need to know about numbered memory cells for most modern languages that aren't C, C++, or assembly.

It's a good thing. Most of the time for most of the people, it's better to work closer to your problem domain than to the CPU.

Re:Understand Go pointers by dualogy on Wednesday April 26, 2017 @09:25AM (#14202718)
> It's a good thing. Most of the time for most of the people, it's better to work closer to your problem

Having a rough understanding of what memory is at a very rough high-level grasp ("numbered byte-size cells" isn't very in-depth after all) doesn't preclude one from working "closer to one's problem domain", likewise lacking such grasp doesn't bring one any closer to one's problem domain.. what am I missing?

Re:Understand Go pointers by danielvf on Wednesday April 26, 2017 @09:51AM (#14202898)
It's not that such an understanding precludes a person from working close to the problem domain, it's just that that knowledge is not necessary most of the time.

In the book, "Mythical Man Month", Fred Brooks talks about the two kinds of complexity in solving problems with computers. There's the "essential complexity" that's there because the problem you are solving is actually complex, and then there's the "accidental complexity" that's not actually required to solve the problem, but to make the computer happy.

Let's compare C arrays and Python/C# Lists. For my pretend problem, I need an ordered, index-able set of things.

With the C array, I need to know how big to make it before I create it. I need to allocate the memory that is used before I use it, and I must deallocate that memory when I'm done with it. I might underflow or overflow the array and allow Eastern European hackers control over my server and data. Even if I checking for overflows and underflows in all the proper places, I also have to add code to every one of those places handle each possible error.

Whereas in C# and Python, I just make a new list and stick things into it. When it goes out of scope, it disappears automatically.

Python and C# move me closer to the actual problem being solved by removing this "Accidental Complexity". When complexity removing is done well, it also removes the requirement for the programmer to know about numbered cells of memory, because numbered cells of memory is "Accidental Complexity" for the problem domain.

Now when I know how the computer is actually working, it does bring benefits. Today, in fact, I'm writing C code for an embedded ARM chip. Knowledge of memory numbers is a little required here. But for most software developers, knowing how memory works is not a requirement for working software. Even memory-as-a-numbered-set-of-cells is still just a huge abstraction from how the memory is actually being handled by the hardware.

Re:Understand Go pointers by emmelaich on Wednesday April 26, 2017 @07:31PM (#14207949)
> With the C array, I need to know how big to make it before I create it ..

But that is essential complexity when you need to reason carefully about memory use.

Re:Understand Go pointers by aninhumer on Wednesday April 26, 2017 @09:39AM (#14202802)
The parent just said that it's a good thing that these languages don't require an understanding of memory, not that such an understanding is not valuable.

If you need to understand memory to use a language, then it's not abstracting well enough.

Re:Understand Go pointers by nottorp on Wednesday April 26, 2017 @09:15AM (#14202654)
Yeah, that's why we have chat programs taking 5-10% of the CPU when idle and in the background. The developers worked "closer to the problem domain".
Re:Understand Go pointers by 0xelectron on Wednesday April 26, 2017 @09:25AM (#14202717)
Is it their fault that we still haven't been able to find an elegant solution to this problem?
Re:Understand Go pointers by TeMPOraL on Wednesday April 26, 2017 @09:54AM (#14202927)
There are many elegant solutions; they're not JavaScript on Electron.