AutoOpen attribute in F#

I think the main use for the AutoOpen attribute is when you want to make some let-bound values available when the user of your library opens a namespace. This is where the attribute is very useful, because I think libraries should generally export all definitions in namespaces, but for some purposes you need to export … Read more

In what order should headers be included? [closed]

In a header file you have to include ALL the headers to make it compilable. And don’t forget to use forward declarations instead of some headers. In a source file: corresponded header file necessary project headers 3rd party libraries headers standard libraries headers system headers In that order you will not miss any of your … Read more

C++ Header order [closed]

In a header file you have to include ALL the headers to make it compilable. And don’t forget to use forward declarations instead of some headers. In a source file: corresponded header file necessary project headers 3rd party libraries headers standard libraries headers system headers In that order you will not miss any of your … Read more

Haskell module naming conventions

Unless your program is really big, don’t organize the modules in a hierarchy. Why not? Because although computers are good at hierarchy, people aren’t. People are good at meaningful names. If you choose good names you can easily handle 150 modules in a flat name space. I felt like [a flat name space] lacked organization. … Read more

Xcode Workspace vs Nested Projects

I use workspaces when I want to combine projects while also maintaining project independence. An example where I use workspaces is series of tutorial projects that progress from very simple to more complex. Each project can function as a standalone project, but grouping them together in a workspace helps my organization of the overall project. … Read more

Should ‘using’ directives be inside or outside the namespace in C#?

There is actually a (subtle) difference between the two. Imagine you have the following code in File1.cs: // File1.cs using System; namespace Outer.Inner { class Foo { static void Bar() { double d = Math.PI; } } } Now imagine that someone adds another file (File2.cs) to the project that looks like this: // File2.cs … Read more

Domain Driven Design – how the layers should be organized?

Speaking in terms of more “classical” DDD, yes domain objects are typically not allowed anywhere outside of the domain. But it is not an absolute rule that domain objects are not used in the presentation layer. For example, Naked Objects represents a school of thought where domain objects are used directly. I myself adhere mostly … Read more