Show me cool, obscure languages!

View other answers to this thread
Start a personal dev blog on your domain for free and grow your readership.

3.4K+ developers have started their personal blogs on Hashnode in the last one month.

Write in Markdown · Publish articles on custom domain · Gain readership on day zero · Automatic GitHub backup and more

Paul Lefebvre's photo

Xojo fits the bill. A couple cool features:

  • Native, cross-platform desktop apps from a single project file
  • Event Handling

Animal example using events

Create a new class called Animal. Add to it a Speak method that returns String with this code:

Return SpeakSound

Now add to the Animal class an Event Definition called SpeakSound and set its return value to String.

Next, create a subclass of Animal, called Cat. Click on the button “+” button on the toolbar and select “Add Event Handler”. In the dialog, you will see the SpeakSound event handler. Select and and press OK. The code for this event handler is:

Return "Meow!"

Create another subclass of Animal, called Dog, and also add the SpeakSound event handler with this code:

Return "Woof!"

To test this, create a button on a window. In the Action event of the button add code to create an array of Animals:

Dim animals() As Animal
animals.Append(New Cat)
animals.Append(New Dog)

For Each a As Animal In animals

When you run this code, you will see “Meow!” and then “Woof!”.