Why is vectorization, faster in general, than loops?

Vectorization (as the term is normally used) refers to SIMD (single instruction, multiple data) operation. That means, in essence, that one instruction carries out the same operation on a number of operands in parallel. For example, to multiply a vector of size N by a scalar, let’s call M the number of operands that size … Read more

How should you build your database from source control?

Here are some some answers to your questions: Should both test and production environments be built from source control? YES Should both be built using automation – or should production by built by copying objects from a stable, finalized test environment? Automation for both. Do NOT copy data between the environments How do you deal … Read more

What does ‘foo’ really mean? [closed]

See: RFC 3092: Etymology of “Foo”, D. Eastlake 3rd et al. Quoting only the relevant definitions from that RFC for brevity: Used very generally as a sample name for absolutely anything, esp. programs and files (esp. scratch files). First on the standard list of metasyntactic variables used in syntax examples (bar, baz, qux, quux, corge, … Read more

When should I use Debug.Assert()?

In Debugging Microsoft .NET 2.0 Applications John Robbins has a big section on assertions. His main points are: Assert liberally. You can never have too many assertions. Assertions don’t replace exceptions. Exceptions cover the things your code demands; assertions cover the things it assumes. A well-written assertion can tell you not just what happened and … Read more

How to deal with constructor over-injection in .NET

You are correct: if you need to inject 13 dependencies into a class, it’s a pretty sure sign that you are violating the Single Responsibility Principle. Switching to Property Injection will not help, as it will not decrease the number of dependencies – it will only imply that those dependencies are optional instead of mandatory. … Read more