View mode: basic / threaded / horizontal-split · Log in · Help
March 26, 2004
Re: Um. "Error: Access Violation", no other information, doesn't even ask if I want to debug it, etc.
Russ Lewis wrote:

> C wrote:
>
>> I usually get this error when forgetting to 'new' something.  But i 
>> feel your pain, this single oversight could cause hours of searching 
>> , almost nullifying the reduced development time of using D :/.  I 
>> think someone mentioned something about the error messages getting 
>> beefed next release <crosses fingers> .
>
>
> Also look for lines like:
>     assert(obj != null);
> or
>     assert(obj == null);
>
> This has bitten me a couple of times.  Unfortunately, what happens 
> here is that == and != are the compare-by-value operators.  Thus, what 
> you are really saying is:
>
>     assert(obj.member1 == (cast(WHATEVER)null).member1 &&
>            obj.member2 == (cast(WHATEVER)null).member2 &&
>            obj.member3 == (cast(WHATEVER)null).member3 ... );
>
> Of course, this will segfault (a.k.a. "Access Violation") when it 
> tries to read the first member of the "null" object.  So what you 
> really need instead is:
>     assert(obj !== null);
> or
>     assert(obj === null);
> which are the compare-by-pointer operators.
>
Or just
assert(obj);
or
assert(!obj);

-- 
-Anderson: http://badmama.com.au/~anderson/
March 26, 2004
Re: Um. "Error: Access Violation", no other information, doesn't even ask if I want to debug it, etc.
C <dont@respond.com> wrote:

> Arrow-key mode ?

Using only the arrow keys for moving the cursor, which constantly requires 
you to pull your hand away from the standard key position.  AKA "Notepad-
style" :-)

>> but I find it inadequate for real C++ work.
> 
> Sacriledge!!  What do you consider a 'good' IDE, and what features
> make it so good ?  I use emacs all the time, you get so comfotable
> with it after a while its hard to be anywhere near as productive with
> another. 

LOL.  Yes, I know it's sacrilege :-)  Well, first off, of course, it's a 
personal preference thing -- as the long-running vi vs. emacs war 
demonstrates. Some people love vi, some love emacs, and they will never 
agree with each other. And some lusers love notepad :-)

IAC, what I am looking for is an development system that understands my 
program. Emacs is a great text editor, but that's all it is -- text 
editing. It doesn't understand my C++ except through a multitude of regular 
expressions that one hopes are mostly correct. It can't even narrow-to-
defun correctly in C++. I want an intelligent source browser that knows 
where everything is in my code and that isn't confused because I didn't 
put the brace in column 0. Speedbar and imenu don't qualify, at least for 
C++, but it's not their fault -- the damned language is so insanely complex 
it would take a super-human effort to get it right, and with elisp it 
would be dreadfully slow. This is why I think Walter is totally on the 
right track with D, and I'm glad someone with the skill to do something 
about it actually *is* doing something about it.

To tell you the truth, if it weren't for Microsoft's policy of not fixing 
their bugs (until the next paid upgrade :-) I would say the current Visual 
Studio .NET is the best. Well, actually, it is, despite that. I am 
incredibly more productive with that tool than with anything else I have 
found. And I have been searching for years. I've used Emacs about 8 years, 
but my use of it has dropped way off. One would need to take more than a 
passing glance at Visual Studio .NET to see why it is so good. But it 
understands C/C++ more than any other tool I've ever used (although it 
misses on a fair amount of my code that uses a lot of templates and 
namespaces). And of course, I've customized it with my own set of 
keystrokes and macros, but not extensively. I've concluded that lots of 
little macro-y things aren't the solution to productivity, at least for me. 
When I have a large project going, I do not want to spend ANY time dicking 
around with source files, trying to find the definition or declaration of 
something. Intellisense has gotten *very* smart in their recent versions 
(emacs with cc-mode and speedbar and imenu come nowhere close). And it's 
interactive in real-time: they have incremental parsing of the source as 
you type, and both Intellisense and Class View are updated on the fly. It's 
quite impressive.

Of course they still have a ways to go, and they still have feature 
backfires. BTW, you might be interested to know that when I interviewed at 
MS for the Visual C++ team (for which I was turned down, I think because I 
said "fuck" in one of the interviews, and I called one of the interviewers 
a bastard (purely in fun :-)), one of the main things they were interested 
in was the kinds of features that would appeal to someone who normally used 
Emacs or other Unix-style tools. We had a big discussion about this.

I must add that I'm not a Microsoft Corporation fan, especially their 
dishonest and predatory business practices, but I also feel that credit 
should be given where it is due, and they've earned it with Visual Studio. 
The developers I met up there were all very sharp guys devoted to creating 
great development tools -- but I doubt they have any say at all about what 
happens up at the management level, and if I worked there I would feel 
betrayed by the antics Bill and Steve engage in. And I don't like any of 
MS's other products :-) MFC, for instance, is a terrible example, IMO, of 
an "industry standard" technology.

Anyway, I appreciate your interest in this topic. I've found virtually no 
interest amongst the MS fan-boys I've worked with :-) but it makes sense 
that someone willing to move forward with D would also have a strong 
interest in advanced development tools as well.

-- 
dave
March 26, 2004
Re: Um. "Error: Access Violation", no other information, doesn't even ask if I want to debug it, etc.
J Anderson wrote:
> Or just
> assert(obj);
> or
> assert(!obj);

When you assert(obj), the compiler does NOT check obj against null...it 
just runs ahead and starts testing it.

So
	assert(obj);
will get Access Violation if obj === null.

:(
March 26, 2004
Re: Um. "Error: Access Violation", no other information, doesn't even ask if I want to debug it, etc.
> Using only the arrow keys for moving the cursor, which constantly 
> requires
> you to pull your hand away from the standard key position.  AKA "Notepad-
> style" :-)

Argh your right , that is probably what slows me down the most.  Im 
working on a ( dreaded ) MFC acellerator table class, hopefully this will 
allow for more advanced configurations.  Does VC .net have this ?  I dont 
have it yet , but from what you've said I defintley want to check it out.

> it would take a super-human effort to get it right, and with elisp it
> would be dreadfully slow.

Yes no doubt there, formatting large files takes an unbearabley long time.

> MS for the Visual C++ team (for which I was turned down, I think because 
> I
> said "fuck" in one of the interviews, and I called one of the 
> interviewers
> a bastard (purely in fun :-))

lol , little boozin in the morning :) ?

> The developers I met up there were all very sharp guys devoted to 
> creating
> great development tools

Yea from what I understand they've aquired some big players , done alot 
for 'standards conformance'.  Im not quite a fan either, but they have 
done alot for CS in general.

> but I also feel that credit
> should be given where it is due, and they've earned it with Visual 
> Studio.

Yea I really want to check it out, i bought the pre-2003 version, I wonder 
if that $29 dollar upgrade still stands.

> Anyway, I appreciate your interest in this topic.

And I appreciate the input!

C

On Fri, 26 Mar 2004 04:46:27 +0000 (UTC), Dave Sieber 
<dsieber@spamnot.sbcglobal.net> wrote:

> C <dont@respond.com> wrote:
>
>> Arrow-key mode ?
>
> Using only the arrow keys for moving the cursor, which constantly 
> requires
> you to pull your hand away from the standard key position.  AKA "Notepad-
> style" :-)
>
>>> but I find it inadequate for real C++ work.
>>
>> Sacriledge!!  What do you consider a 'good' IDE, and what features
>> make it so good ?  I use emacs all the time, you get so comfotable
>> with it after a while its hard to be anywhere near as productive with
>> another.
>
> LOL.  Yes, I know it's sacrilege :-)  Well, first off, of course, it's a
> personal preference thing -- as the long-running vi vs. emacs war
> demonstrates. Some people love vi, some love emacs, and they will never
> agree with each other. And some lusers love notepad :-)
>
> IAC, what I am looking for is an development system that understands my
> program. Emacs is a great text editor, but that's all it is -- text
> editing. It doesn't understand my C++ except through a multitude of 
> regular
> expressions that one hopes are mostly correct. It can't even narrow-to-
> defun correctly in C++. I want an intelligent source browser that knows
> where everything is in my code and that isn't confused because I didn't
> put the brace in column 0. Speedbar and imenu don't qualify, at least for
> C++, but it's not their fault -- the damned language is so insanely 
> complex
> it would take a super-human effort to get it right, and with elisp it
> would be dreadfully slow. This is why I think Walter is totally on the
> right track with D, and I'm glad someone with the skill to do something
> about it actually *is* doing something about it.
>
> To tell you the truth, if it weren't for Microsoft's policy of not fixing
> their bugs (until the next paid upgrade :-) I would say the current 
> Visual
> Studio .NET is the best. Well, actually, it is, despite that. I am
> incredibly more productive with that tool than with anything else I have
> found. And I have been searching for years. I've used Emacs about 8 
> years,
> but my use of it has dropped way off. One would need to take more than a
> passing glance at Visual Studio .NET to see why it is so good. But it
> understands C/C++ more than any other tool I've ever used (although it
> misses on a fair amount of my code that uses a lot of templates and
> namespaces). And of course, I've customized it with my own set of
> keystrokes and macros, but not extensively. I've concluded that lots of
> little macro-y things aren't the solution to productivity, at least for 
> me.
> When I have a large project going, I do not want to spend ANY time 
> dicking
> around with source files, trying to find the definition or declaration of
> something. Intellisense has gotten *very* smart in their recent versions
> (emacs with cc-mode and speedbar and imenu come nowhere close). And it's
> interactive in real-time: they have incremental parsing of the source as
> you type, and both Intellisense and Class View are updated on the fly. 
> It's
> quite impressive.
>
> Of course they still have a ways to go, and they still have feature
> backfires. BTW, you might be interested to know that when I interviewed 
> at
> MS for the Visual C++ team (for which I was turned down, I think because 
> I
> said "fuck" in one of the interviews, and I called one of the 
> interviewers
> a bastard (purely in fun :-)), one of the main things they were 
> interested
> in was the kinds of features that would appeal to someone who normally 
> used
> Emacs or other Unix-style tools. We had a big discussion about this.
>
> I must add that I'm not a Microsoft Corporation fan, especially their
> dishonest and predatory business practices, but I also feel that credit
> should be given where it is due, and they've earned it with Visual 
> Studio.
> The developers I met up there were all very sharp guys devoted to 
> creating
> great development tools -- but I doubt they have any say at all about 
> what
> happens up at the management level, and if I worked there I would feel
> betrayed by the antics Bill and Steve engage in. And I don't like any of
> MS's other products :-) MFC, for instance, is a terrible example, IMO, of
> an "industry standard" technology.
>
> Anyway, I appreciate your interest in this topic. I've found virtually no
> interest amongst the MS fan-boys I've worked with :-) but it makes sense
> that someone willing to move forward with D would also have a strong
> interest in advanced development tools as well.
>



-- 
D Newsgroup.
March 26, 2004
Re: Um. "Error: Access Violation", no other information, doesn't even ask if I want to debug it, etc.
C <dont@respond.com> wrote:

> Argh your right , that is probably what slows me down the most.  Im 
> working on a ( dreaded ) MFC acellerator table class, hopefully this
> will allow for more advanced configurations.  Does VC .net have this ?
>  I dont have it yet , but from what you've said I defintley want to
> check it out. 

Hmmm, I'm not sure what an MFC accelerator table is...? (MFC was never my 
strong suit :-)

> lol , little boozin in the morning :) ?

Hah!  I WISH!  I would have been less nervous, I think :-) I had six 
interviews back to back, over 8 hours, including being interviewed through 
lunch. And I blew it in the very last one...

> Yea I really want to check it out, i bought the pre-2003 version, I
> wonder if that $29 dollar upgrade still stands.

If you're doing C++ work, you definitely should get VS.NET 2003. The C++ 
compiler is *much* better. It compiles Boost with no problems, Koenig 
lookup works, partial ordering, etc.  There is still the occasional 
internal compiler error, but it is greatly improved.  That said, you will 
find some issues with Visual Studio itself, depending on the kind of work 
you're doing. As I mentioned, if you're doing heavy-duty templates and 
namespaces, you may find that Intellisense and/or Class View can get 
confused. For straight-ahead stuff, though, it works great. I really do 
wish they would issue some patches or service packs, like they used to do 
back with VC++ 6.0.

-- 
dave
March 26, 2004
Re: assert + if + double standards
Russ Lewis wrote:

> When you assert(obj), the compiler does NOT check obj against 
> null...it just runs ahead and starts testing it.
>
> So
>     assert(obj);
> will get Access Violation if obj === null.
>
> :(
>
Of course your right.  This should be changed. I'm so used to using 
assert(obj) in C++ and I always think of objects as pointers in D.  We 
also want to encourage users to take the efficient option.  The == and 
=== should stay as they are.

In this example:

   test t; // = new test;
  
   if (t)   {}

It's correct, so why change it for assert?

There seems to be some double standards here.

-- 
-Anderson: http://badmama.com.au/~anderson/
March 29, 2004
[Suggestion] Re: Um. "Error: Access Violation", no other information, doesn't even ask if I want to debug it, etc.
C wrote:

> I usually get this error when forgetting to 'new' something.  But i feel 
> your pain, this single oversight could cause hours of searching , almost 
> nullifying the reduced development time of using D :/.  I think someone 
> mentioned something about the error messages getting beefed next release 
> <crosses fingers> .
<snip>

I agree, I too drive myself mad finding the cause of my access 
violations, only to finally kick myself that I'm following a reference 
to nowhere.

A few ideas:

- The compiler ought to be able to try to detect whether an object 
reference is null when it is used.  If it's definitely null (like it's 
just been declared and there's nowhere it could've been assigned) it 
would report an error.

- For situations where the nullness can't be determined at compile-time, 
it would implicitly stick an assert(obj) before each member use.  Except 
that it would throw a new type, we could call it NullReferenceError, 
instead of AssertError.  Just like AssertError at least, it would report 
the filename and linenumber.  Of course, just like an assert or ABC, the 
check would be taken out for the release build.

Stewart.

-- 
My e-mail is valid but not my primary mailbox, aside from its being the 
unfortunate victim of intensive mail-bombing at the moment.  Please keep 
replies on the 'group where everyone may benefit.
March 30, 2004
Re: [Suggestion] Re: Um. "Error: Access Violation", no other information, doesn't even ask if I want to debug it, etc.
Stewart Gordon wrote:

[...]
> Except that it would throw a new type, we could call it NullReferenceError, 
> instead of AssertError.
[...]

I am totally with you.

So long!
Next ›   Last »
1 2 3
Top | Discussion index | About this forum | D home