1,040 reputation
1013
bio website ffconsultancy.com
location Cambridge, United Kingdom
age
visits member for 4 years, 5 months
seen May 13 at 13:37
Cofounder of Flying Frog Consultancy Ltd.

Mar
21
comment Is garbage collection necessary?
+1 No idea why you got downvoted.
Mar
21
comment Is garbage collection necessary?
@Sulthan: "GC based on reference counting is inefficient only if you have only strong references". The JVM and CLR do not use reference counting precisely because that is not true.
Mar
21
comment Is garbage collection necessary?
@Caleb: "ARC is not garbage collection because ARC doesn't use a garbage collector". Reference counting is regarded as a form of garbage collection in the literature. See gchandbook.org
Mar
16
answered Why is an anemic domain model considered bad in C#/OOP, but very important in F#/FP?
Mar
1
comment Why don't mobile platforms support generational garbage collection?
+1: I agree completely.
Feb
20
comment Why are reference-counting smart pointers so popular?
"Reference counting can be explained in a few minutes, and implemented in an hour or two. Garbage collectors, especially ones with decent performance, are extremely complex and not many people understand them." Here is another counter example: stackoverflow.com/a/11118079/13924
Feb
20
comment Why are reference-counting smart pointers so popular?
"With reference counting, you are guaranteed that your object will be freed the instant the last reference to it goes away". That is a common misconception. flyingfrogblog.blogspot.co.uk/2013/10/…
Feb
20
comment Why are reference-counting smart pointers so popular?
"Garbage collectors can be quite intrusive (e.g. making your program freeze up at unpredictable times while a garbage collection cycle processes) and quite memory-intensive (e.g. your process's memory footprint unnecessarily grows to many megabytes before garbage-collection finally kicks in)". Garbage collectors can be real time and your latter observation is not applicable to most garbage collectors. For example, OCaml is an obvious counter example.
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