Boo Tips
Home Up

 

Developing & Debugging visually in Boo

You can use the SharpDevelop IDE to edit, run and compile boo programs with the boo add-in.  You cannot do debugging in SharpDevelop but you can do astounding things with the Microsoft .net debugger (see next section).

Note the latest SharpDevelop IDE (as of September 2005) sometimes locks up when you exit it.  Don't let this put you off a fantastic IDE - just use task manager to zap the app. 

Debugging

To debug boo apps, just use the Microsoft debugger e.g.

C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\GuiDebug\dbgclr.exe 

which displays boo source code and shows all relevant variables and objects during debug - letting you set breakpoints etc. perfect!  

Boo Unit tests

You can write boo unit tests that are runnable within nUnit Gui.  See 

 http://boo.codehaus.org/Unit+Testing+and+You%2C+a+guide 

Unit testing via the console

Sometimes you want to run unit tests via the console (not from a GUI). e.g.

"\Program Files\NUnit 2.2\bin\nunit-console.exe" UnitTestRm02.dll

For example you want to debug your way through the unit test thus running as a console app is needed.

Debugging Boo Unit tests

To debug a boo unit test which is being run via a console, load up the microsoft debugger dbgclr.exe and select from the menu

Debug/Program to Debug...

and in the dialog enter the following

Program: C:\Program Files\NUnit 2.2\bin\nunit-console.exe

Arguments: UnitTestRm02.dll

Working Directory: C:\...\SharpDevelop Projects\RelationshipManager55\UnitTestRm02\bin\Debug

of course change the paths above and the dll name to match your system and the assembly you are debugging.

In the above case, UnitTestRm02.dll is a boo class project with unit tests in it.  You will then be able to single step through your unit tests and set breakpoints and examine variable etc.  Fab.

Debugging between Boo and C#

Yes it is possible to trace from one language into the other.  The Microsoft debugger should just display the source code of the relevant language as you single step from one assembly to the other. Awesome!

Tips on Porting from Python to Boo

As well as the guide  Differences with Python I also personally found the following issues:

Iterating through a dictionary. 

for key in mydict:
    print key

in python the above will print the keys.  In boo, it will print an object.  So you need to translate this too

for key in mydict.Keys:
    print key

List append

Instead of

mylist.append('hi')

you must say

mylist.Add("hi")

Iteritems

There is no iteritems property of a dictionary in boo.