Well, that's one way of doing it...

You're part of the C# language design team thinking about the next version of C# (ie the version after VS 2005). You get the following email:

When I'm writing code, I often come across a situation where my code throws an exception because another component called with a null parameter. I'd like a way to prevent that from happening.

What are the pros and cons of such a feature? What are the ramifications of adding it to the language? What would have to change? What is your recommendation? Exactly what would such a feature look like?

A discussion over on Eric Gunnerson's weblog.

I suppose this is one way of doing language design. You are welcome to comment on the specific issue, or on this cutting edge language design technique ("just blog it, silly")...

Just to get the juices flowing, I should point out that this is a type system issue.

Should we have a language design department for general discussions about language design?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Just one tool from the box

You are welcome to comment on the specific issue, or on this cutting edge language design technique ("just blog it, silly")...

I believe the former was addressed on LtU multiple times. And even in a context of C#. Of course, new ideas are always possible.

On the latter: having members of your PL community to blog about upcoming features is probably beneficial, as it shows you who your users are and what are their immediate problems. I certainly would not recommend to overly rely on this data, as first, it represents just part of the community, and second, users tend to produce very low-level complaints. All in all, while maintaining link with your users is very important, you should not let them drive your decisions.

Continued here. P.S In case

Continued here.

P.S

In case anyone didn't notice, my original message was tongue in cheek.

Builtin "Maybe" types

The Nice programming language uses the syntax "?Type" to indicate that the pointer could be null. The semantics are supposed to be like Haskell's "Maybe" except the compiler eliminates some of the tedious work.

There's no support for multi-level option types (ex: "??Object"), however, because of implementation issues (they target the JVM and would like to be relatively interoperable with Java code).

Maybe runtime

In Erlang we use runtime Maybe types in the same style as Haskell/ML. This is good for catching bugs, but it would probably be inconvenient without pattern-matching syntax.