Tuesday, November 16, 2010

Silicon Valley Chrome Developers

I'm going to a Meetup with Silicon Valley Chrome Developers! http://meetu.ps/2n8J
My 2C to community will be from this blog.

Thursday, November 4, 2010

ASSERT - how it should be

ASSERT in case of failure should dump the file/line along with string presentation of condition. Ideally some extra info similar to TRACE output:

ASSERT( conditionToFail)( var1, var2,...);

In debug mode it should ask to "break, ignore, ignore forever". On break set programmatic breakpoint and call debugger, than call condition once more.
Depend of interactivity ability (console, UI, none) prompt could be shown or not.

while( !condition )
    static boolean ignoreForever = false;
    if( ignoreForever )

    log( "condition=" #condition# " var1=" #var1 "var2=" #var2 );
    int pr = prompt( "assertion condition " #condition# " failed. break, ignore, ignore forever"? );
    if( pr == ignore )
    if( pr == IgnoreForever )
        ignoreForever = true;
    debugger; // programmatic breakpoint
    int repeatAgain = 0;
    condition; // second call for troubleshooting in debugger
    if( !repeatAgain ) // in debugger set to 1 and will cycle again