Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
MonoXna and NotImplementedException
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jordan Justen  
View profile  
 More options May 31 2011, 6:42 pm
From: Jordan Justen <jljus...@gmail.com>
Date: Tue, 31 May 2011 15:42:38 -0700
Local: Tues, May 31 2011 6:42 pm
Subject: MonoXna and NotImplementedException
Is there a possible middle ground for NotImplementedException?

I'm wondering if we could call an internal static method rather than
immediately always throwing an exception.  It might be nice to mark
areas of code as partially implemented, and others as not started.

Also, perhaps it would be better to not generate the exception when
building in release mode?

I'm thinking of something like below.

Does anyone consider this a bad idea?

-Jordan

==

using System;
namespace Microsoft.Xna.Framework
{
    internal class MonoXnaNotImplemented
    {
        private static void MaybeThrow()
        {
#if (DEBUG || NUNITTESTS) && !IGNORE_NOT_IMPLEMENTED_EXCEPTION
            throw new NotImplementedException();
#endif
        }

        internal static void PartiallyComplete()
        {
            MaybeThrow();
        }

        internal static void NotStartedYet()
        {
            MaybeThrow();
        }
    }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lars Magnusson  
View profile  
 More options Jun 8 2011, 2:22 pm
From: Lars Magnusson <lav...@gmail.com>
Date: Wed, 8 Jun 2011 20:22:30 +0200
Local: Wed, Jun 8 2011 2:22 pm
Subject: Re: [monoxna] MonoXna and NotImplementedException
Hi Jordan

I'm unsure why you would want this. Is it primarily to have "a record"
of progress, or just to avoid the exceptions.

I personally like the exception, because it immediately lets me know
that this functionality has not been implemented yet. If this is the
case I usually implement the needed functionality before continuing on
what I was doing. It seems to me that to spend time to change all the
NotImplementedExceptions to call some static class is a waste of time.
This time would be better spent actually implementing the
functionality.

That being said, I don't object to the idea i.e. I wouldn't mess up
the code, and it could potentially provide an overview of the
progress, but this can easily be done with a simple search as well.

-lavima


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jordan Justen  
View profile  
 More options Jun 8 2011, 4:07 pm
From: Jordan Justen <jljus...@gmail.com>
Date: Wed, 8 Jun 2011 13:07:01 -0700
Local: Wed, Jun 8 2011 4:07 pm
Subject: Re: [monoxna] MonoXna and NotImplementedException

On Wed, Jun 8, 2011 at 11:22, Lars Magnusson <lav...@gmail.com> wrote:
> I'm unsure why you would want this. Is it primarily to have "a record"
> of progress, or just to avoid the exceptions.

In the case of PartiallyImplemented, I will give one example.  I've
seen some API's are called in a particular scenario, and they are "not
implemented" and therefore an exception is thrown.  Yet, I've
discovered that in the current scenario I am investigating, no action
is required to achieve some level of functionality.  So, I would like
to remove the exception in that case, but still mark that it as not
been fully implemented.

Regarding the NotStartedYet case, I think this should normally throw
an error with a debug build, but not throw one for a release build.
For a "release" build if we throw the error, then it gains no value
except perhaps introducing an exception when the code might actually
function fine.

> I personally like the exception, because it immediately lets me know
> that this functionality has not been implemented yet. If this is the
> case I usually implement the needed functionality before continuing on
> what I was doing. It seems to me that to spend time to change all the
> NotImplementedExceptions to call some static class is a waste of time.
> This time would be better spent actually implementing the
> functionality.

I agree.  I hope it would not be a significant diversion.  I'm just
trying to find a way for the libraries to be less likely to hit an
exception in particular build type scenarios.

-Jordan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »