952 reputation
1013
bio website ffconsultancy.com
location Cambridge, United Kingdom
age
visits member for 4 years, 1 month
seen yesterday
Cofounder of Flying Frog Consultancy Ltd.

Jan
23
comment Disadvantages of scoped-based memory management
@user1703394: "Lets say I have an 'actor' object that by composition holds a 'priority queue' object that by composition holds a number of 'fifo' object and these fifo object holds an open file handle". There are two problems with your scenario. Firstly, you said you 100% do NOT mean deep object hierarchies and then you literally described a deep object hierarchy. Secondly, rather than presenting a problem you have presented a flawed design for a solution. What is the problem you are trying to solve? For example, I never store file handles in collections. Why would you?
Jan
22
comment Disadvantages of scoped-based memory management
@user1703394: "mitigate the transitive effects of using deep resources". You're repeating the same mistake. When you say "deep" what you really mean is "deep in an object hierarchy". The solution is to not use deep object hierarchies. This is exactly the kind of reason I stopped using object orientation extensively.
Jan
20
comment Disadvantages of scoped-based memory management
@user1703394: "The destructor in non-deterministic GC might be called immediately or two months from end of scope". The destructor is still called at the end of scope, just like C++. Look at F#, for example, where the IDisposable interface is called at the end of scope of any use binding.
Jan
15
comment Disadvantages of scoped-based memory management
"Further 'using' gets you a very limited set of use cases and ignores composition". If that were true then this "explosive" problem you keep mentioned should have bitten me at least once in the 30+ years I have been programming and, yet, I have never ever seen a single instance of it.
Jan
15
comment Disadvantages of scoped-based memory management
"How relevant is being 10x slower in a few rare use cases as opposed to being omnipresent in all use cases?". Firstly, that's a circular argument: shared_ptr is only rare in C++ because it is so slow. Secondly, that is an apples and oranges comparison (as the article I cited already showed) because shared_ptr is many times slower than a production GC. Thirdly, GCs are not omnipresent and are avoided in software like LMax and Rapid Addition's FIX engine.
Jan
15
comment Disadvantages of scoped-based memory management
"The article shows that by applying 'non deterministic GC' you will implicitly make 'being a resource' transitive to composition". GC has nothing to do with that. You can require every class to implement a destructor that is called at the end of scope whether you have a GC or not.
Jan
15
comment Disadvantages of scoped-based memory management
His concrete examples (RAM, open file handles, locks, threads) are quite telling. I'm hard pressed to recall the last time I had to write code that dealt directly with any of those. With RAM, the GC automates everything. With file handles I write code like File.ReadLines file |> Seq.length where the abstractions handle closing for me. Locks and threads I've replaced with .NET Task and F# MailboxProcessor. This whole "We exploded the amount of manual resource management" is just complete nonsense.
Jan
15
comment Disadvantages of scoped-based memory management
@user1703394: Firstly, the entire article is based around a strawman "GCed language" when, in fact, it has nothing whatsoever to do with garbage collection. Secondly, he blames garbage collection when, in fact, the faults lie with object oriented programming. Finally, his argument is 10 years too late. The vast majority of programmers already modernised to garbage collected languages precisely because they offer much higher productivity.
Jan
14
comment Disadvantages of scoped-based memory management
@supercat: "I would posit that correctness frequently requires that objects be notified when their services are no longer needed". You're assuming the existence of objects. I have only ever encountered the problem you mentioned in the context of event-based programming. I rarely use events but, when I do, I use a constant number of listeners.
Jan
13
comment Disadvantages of scoped-based memory management
@supercat: Right. I wouldn't say that happens "often". I've only come across it once in 30 years of programming.
Jan
13
comment Disadvantages of scoped-based memory management
If you say which bits I may be able to elaborate or cite articles.
Jan
13
answered Disadvantages of scoped-based memory management
Jan
13
comment Disadvantages of scoped-based memory management
-1 That's one of the worst articles I've ever read.
Jan
13
comment Disadvantages of scoped-based memory management
@supercat: "GC correctness often requires scoped resource management". Eh? Scope only exists in the source code and GC only exists at run-time (and is, therefore, completely oblivious to the existence of scope).
Dec
27
awarded  Yearling
Sep
24
awarded  Autobiographer
Jul
15
awarded  Nice Answer
Dec
27
awarded  Yearling
Nov
4
comment What are the biggest differences between F# and Scala?
@missingfaktor: "It is way larger than Scala". How big are the grammars?
Oct
30
comment Is modern C++ replacing C#? Is Microsoft pushing developers to adopt C++?
"Microsoft is pushing C++". Microsoft were pushing it when Steven Sinofsky (WinDiv) was in control but WinRT and Win8 both failed abysmally in the market place and Sinofsky left under a black cloud. Now only the VC++ guys are pushing C++ and that is just because they happen to be shipping an updated version. So I don't think it is reasonable to say "Microsoft is pushing C++" any more.