Re:Why learning Haskell/Python makes you a worse programmer ...
by lmm on Friday April 15, 2016 @10:36AM
(#11504630)
There's no reason that should use any more memory than an explicit loop. Maybe the particular implementation in C# does, but that's an implementation problem, not a language problem.
Re:Why learning Haskell/Python makes you a worse programmer ...
by d--b on Friday April 15, 2016 @10:55AM
(#11504793)
That's my point: the language cleanliness may obfuscate dirty implementation details, and a good developer should know what these are.
Another example, when you do this:
SuperLargeList.Where(x => x.Blah).ToArray()
There is no way for the compiler to know whether the output array will have a small size or a large size, and so it will choose one or the other assumption (dynamic vs fixed allocation). The language chooses for you how it implements things, and this is all fine as long as you know about it, and as long as you can do something about it in the case when you need to optimize.
Re:Why learning Haskell/Python makes you a worse programmer ...
by lmm on Friday April 15, 2016 @10:58AM
(#11504822)
> That's my point: the language cleanliness may obfuscate dirty implementation details, and a good developer should know what these are.
So what, we should write everything as CPU microops? A good developer should be capable of looking at that level, sure, but it shouldn't be the default; most of the time the computer is better at judging these questions than the developer.
Before linq, people would just loop, and the array would not have to be allocated dynamically.
All I am saying is "more abstraction may lead to performace issue, and people should be aware of it"