Skip to main content
Tweeted twitter.com/StackProgrammer/status/750102895652208640
deleted 34 characters in body
Source Link
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

Moved here from StackOverflow.

Today, an interesting discussion with a colleague. We're going to create a wrapper for WCF's channels, that will handle the Close(), Abort() and Dispose() correctly. This wrapper is to be used instead.

A coworker argued that this was like creating a domain specific language. He opposed the idea, saying it would impose a certain way of working on every software developer that he considered intrinsically wrong. He'd rather overload the 'using' keyword. (Now, AFAIK, this is not possible in C#)

So, does it? Does creating a set of classes and using them strictly instead of classes from other libraries (i.e. forbidding use of Channel) make a DSL?

Edit: When does 'code' become a DSL? I always understood a DSL as a new language with its own grammar, keywords, parser, tokenizer, etc.. Is the term becoming more vague with use?

class ChannelWrapper : IDisposable
{
    void Dispose(bool disposing)
    {
        ...
        try {
            channel.Close();
        }
        catch (CommunicationException) {
            channel.Abort();
        }
        catch (TimeoutException) {
            channel.Abort();
        }
    }
}

Moved here from StackOverflow.

Today, an interesting discussion with a colleague. We're going to create a wrapper for WCF's channels, that will handle the Close(), Abort() and Dispose() correctly. This wrapper is to be used instead.

A coworker argued that this was like creating a domain specific language. He opposed the idea, saying it would impose a certain way of working on every software developer that he considered intrinsically wrong. He'd rather overload the 'using' keyword. (Now, AFAIK, this is not possible in C#)

So, does it? Does creating a set of classes and using them strictly instead of classes from other libraries (i.e. forbidding use of Channel) make a DSL?

Edit: When does 'code' become a DSL? I always understood a DSL as a new language with its own grammar, keywords, parser, tokenizer, etc.. Is the term becoming more vague with use?

class ChannelWrapper : IDisposable
{
    void Dispose(bool disposing)
    {
        ...
        try {
            channel.Close();
        }
        catch (CommunicationException) {
            channel.Abort();
        }
        catch (TimeoutException) {
            channel.Abort();
        }
    }
}

Today, an interesting discussion with a colleague. We're going to create a wrapper for WCF's channels, that will handle the Close(), Abort() and Dispose() correctly. This wrapper is to be used instead.

A coworker argued that this was like creating a domain specific language. He opposed the idea, saying it would impose a certain way of working on every software developer that he considered intrinsically wrong. He'd rather overload the 'using' keyword. (Now, AFAIK, this is not possible in C#)

So, does it? Does creating a set of classes and using them strictly instead of classes from other libraries (i.e. forbidding use of Channel) make a DSL?

When does 'code' become a DSL? I always understood a DSL as a new language with its own grammar, keywords, parser, tokenizer, etc.. Is the term becoming more vague with use?

class ChannelWrapper : IDisposable
{
    void Dispose(bool disposing)
    {
        ...
        try {
            channel.Close();
        }
        catch (CommunicationException) {
            channel.Abort();
        }
        catch (TimeoutException) {
            channel.Abort();
        }
    }
}
Source Link
Diana
  • 151
  • 3

When is code considered a domain specific language

Moved here from StackOverflow.

Today, an interesting discussion with a colleague. We're going to create a wrapper for WCF's channels, that will handle the Close(), Abort() and Dispose() correctly. This wrapper is to be used instead.

A coworker argued that this was like creating a domain specific language. He opposed the idea, saying it would impose a certain way of working on every software developer that he considered intrinsically wrong. He'd rather overload the 'using' keyword. (Now, AFAIK, this is not possible in C#)

So, does it? Does creating a set of classes and using them strictly instead of classes from other libraries (i.e. forbidding use of Channel) make a DSL?

Edit: When does 'code' become a DSL? I always understood a DSL as a new language with its own grammar, keywords, parser, tokenizer, etc.. Is the term becoming more vague with use?

class ChannelWrapper : IDisposable
{
    void Dispose(bool disposing)
    {
        ...
        try {
            channel.Close();
        }
        catch (CommunicationException) {
            channel.Abort();
        }
        catch (TimeoutException) {
            channel.Abort();
        }
    }
}