On Saturday, 28 April 2012 at 23:25:10 UTC, foobar wrote:
On Saturday, 28 April 2012 at 20:43:38 UTC, Timon Gehr wrote:
On 04/28/2012 09:58 PM, foobar wrote:
* version - this does not belong in a programming language. Git
is a much better solution.


So you'd maintain a git branch for every OS if there is some small part that is OS-dependent? I don't think that is a better approach at all.

It is far better than having a pile of #ifdef styled spaghetti code. I'd expect to have all the OS specific code encapsulated separately anyway, not spread around the code base. Which is the current recommended way of using versions anyway. The inevitable conclusion would be to either use a version management system like git or have separate implementation modules for platform specific code and use the build tool to implement the logic of select the modules to include in the build.

Aren't both of those just side effects of bad design? Most #ifdef calls were to overcome limits in the language that probably overloading would have resolved. I haven't done large projects code beyond my own, and the one or two I've seen were actually done in java.

All Architecture and OS specific code should be hopefully done in just one file; That way ugly or special purpose code could be limited to one spot. Not only that but the rest of the code should be clean and you can build another architecture or system with minimal work. Course there will be cases where a lot of work would be needed, or in other cases no work at all.

Reply via email to