[Mono-dev] Please, share your .Net1.1 and 2.0 support and #if directives experience
Rodrigo B. de Oliveira
rodrigobamboo at gmail.com
Fri Feb 10 11:37:16 EST 2006
On 2/10/06, Francisco Figueiredo Jr. <fxjrlists at yahoo.com.br> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Hi all,
> Npgsql developers are going to start adding 2.0 functionality and
> interfaces to Npgsql.
> We discussed about it and we decided to have another directory in Npgsql
> cvs tree to hold the new Npgsql2 source code.
> I'd like to hear from you what are your experience with usage of #if in
> the source code.
We've been using #if directives with success for some time now for the
db4o code base. The main benefit is that the code is always where you
expect it to be.
For complex scenarios we use a mix of partial classes and #if
directives, for instance:
... // code for all platforms goes here
partial class Baz
// Net 2 specific code here
I would recommend against using #if directives inside a method body,
it's much better to have two versions of the method using 'Extract
Method' as appropriate to share functionality.
PS: E aê, Chicão??!!! :)
More information about the Mono-devel-list