On Fri, May 16, 2014 at 11:45 AM, Craig Peterson <cr...@scootersoftware.com>wrote:
> 1) I want to use the OmniThreadLibrary. Setting up objects and thread > descendents is fine in moderation, but it's too much of a hassle when > you just want a quick parallel for loop. > Anonymous functions are bad for unit testing. Why? Because they do exist only at the place of the call and depends on the state of at the time the call. And thus they cannot be tested separately without the caller. I'd assume the parallel execution is definitely needed since the actions you're separating are time consuming. They're time consuming, because they might be complex. Having an ability to test a complex code separately (outside the execution environment/application) is a big benefit. Yet again - the re-usage of the code. What if you switch from OmniThreadLibrary to OpenMP (or whatever other threading library) that doesn't provide support for anonymous functions. What if you'd need to write a separate application, that doesn't have the requirement to use threads. Using the regular code (in procedures or methods) reduces the number of changes you'd need to do. I've mentioned it before OmniThreadLibrary doesn't require you to use anonymous functions. thanks, Dmitry
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal