Panopticon Central

a blog on Visual Basic, .NET and other stuff

  Home :: Contact :: Syndication  :: Login
  496 Posts :: 19 Stories :: 3378 Comments :: 637 Trackbacks

News

The information in this weblog is provided "AS IS" with no warranties, and confers no rights.

My Book

Picture

My Recent Posts

Article Categories

Archives

Post Categories

Microsoft Blogs

Samples

Technical Blogs

VB Links

This sort of thing is one of the reasons why we have avoided increment and decrement operators in VB.
posted on Wednesday, September 01, 2004 11:56 AM

Feedback

# re: The joys of ++ and -- 9/2/2004 12:37 AM Simon Geering
What madness that is, I don't think vb developers are mission out on much from not having increment and decrement operators, other than the migraines every now an then :)




# Les op 9/2/2004 12:57 AM Richard Clark


# re: The joys of ++ and -- 9/2/2004 8:05 AM Michael Russell
My biggest problem with these oh-so-wonderful operators is the undefined order of side-effects.

About four years ago, I was working as a test lead on a game, and we were trying to upgrade from Visual C++ 4.2 to Visual C++ 6.0 so we could use the newest DirectX libraries to help us out with a bug. The project was over 320KLOC, and large portions had been written by developers that were no longer around.

Once the project had been upgraded, we did a build and began testing, and found that the entire graphics engine was no longer working correctly. After tracing into the code, we found wonderful gems similar to this:

m_i++ = o->f(++m_i, ++m_i);

In VC4.2, that would compile out one way. In VC6, it would compile another way. We ended up staying in VC4.2 so that we could actually ship.

# Blog link of the week 36 9/5/2004 11:54 AM Daniel Moth
http://www.zen13120.zen.co.uk/Blog/2004/09/blog-link-of-week-36.html

Post Feedback

Title:
Name:
Url:
Comments: