/ elements

It's the Little Things.

The other day I was working on a new feature in Fire, and as I was testing it, I saw this:

!> Message: Null Reference Exception for expression: self.@_searchField

I had actually noticed this feature in the commit log a few days earlier, but it didn't strike me until I unexpectedly saw it in action how much such a small thing is going to improve my day-to-day coding life.

In case you're missing what I'm talking about: note how the exception message is telling me what exact expression was null. It's a game changer! In this case, it probably saved me 5 minutes of further investigation, but I can think back to dozens of debug sessions in the past where this info might have saved me hours of work.

It's the little things that make the difference. And the past three months of Elements 10 updates have been chock full of little (and not so little) enhancements that make your development life better every day. Let's take a look!

Breakpoints in Fire And Water

There have been a bunch of improvements to breakpoints in Fire and Water:

  • As your project runs, breakpoints now color-code (blue or red) to indicate whether they are in a valid location and can be hit. A small "did not resolve" message also shows inline in the editor if a breakpoint failed to resolve (and thus will not work).

  • You can now set symbolic breakpoints via the Add Breakpoint dialog. Useful if you know the name of a method you want to break on, but not its exact file or line number. (You can also manually set breakpoints on a file+line number basis, as well.)

  • Breakpoints now have a dedicated entry in the Jump Bar where you can see them all, see their status, and also navigate to them (if they are file-based).

  • Build .2283, coming this Friday, also adds a new Breakpoint Manager sheet, where you can see all breakpoints, and remove them.

Arguments Manager

The Start-Up Argument Manager sheet in Fire and Water has seen some significant improvements, as well:

  • For one, it is now available in Water.

  • There's a new "Paste & Split" button that will take your clipboard contents and paste it as if it was an existing command line. It will automatically split the line into individual arguments, of course honoring quotes.

  • Of course (this isn't new), you can also paste the clipboard as a single argument – just press ⌘V / Ctrl+V!

  • There's also a new Filter box at the bottom of the Arguments Manager. You won't need it often, but when you do, you do. When I work on EBuild, my project has about 50 different command line arguments – pointing at different test projects – that I enable selectively. The Filter option really helps me find the right ones quickly, now.

Debug Console History

The interactive debug console in Fire and Water is great, as you can use it to pass textual commands to interact with the Elements debugger or LLDB (for Cocoa).

New in .2271, the console now keeps a history of commands – just press Cursor-Up or Cursor-Down to navigate between your recent commands, like you would in Terminal.

Code Editor

Pressing enter after a { in Fire and Water will now smartly insert the closing } for you in the right location, but only if needed. Such a small thing, I didn't even know I missed it until it was there ;)

Compiler and Languages

  • Class Contracts, a staple feature of Oxygene since version 1.0, are now also available for C#, Swift and Java. Add pre- and post-conditions to your methods, or define invariants for your classes, to help validate your code in debug builds.

  • Class contracts are, where possible, now also enforced at compile time. Have a method marked as requiring a parameter to be non-zero, and your caller passes "0"? The compiler will now tell you and emit an error.

  • Default Interface Implementations allows you to provide optional method bodies when you define an interface. Classes implementing the interface can choose to implement the method — if not, they will inherit the default. This gives you one of best aspects of multi-inheritance, without the mess of actual multi-inheritance.

type
  ILogger = public interface
    method Log(aMessage: String);

    public method Log(aMessage: String; params aParameters: array of Object);
    begin
      Log(String.Format(aMessage, aParameters));
    end;
  end;
  • The compiler will now hide cross-platform warnings in code that is explicitly defined to be platform-specific (e.g. inside an #if ECHOES or if defined("TOFFEE") then)

Incremental Compilation

On Cocoa and Island, the Elements compiler now employs incremental compilation, generating separate object files for each class. As you change code and build your (large) project, now only those classes that are affected by the change will be processed, saving on build times, bigly. You can toggle this via the Incremental project setting.

EBuild

  • EBuild has been the default/standard in Fire and Water for a while now. Starting with .2277, it is now also the default build chain in Visual Studio for Cooper and for Island (with Toffee and Echoes following soon). The MSBuild-based toolchain for Cooper and Island has officially been deprecated.

  • The whole CrossBox and Device (iOS, Android) infrastructure has been re-architected as part of EBuild, and is shared between Fire, Water, Visual Studio and the command line builds now. This includes remote builds on Mac from Windows, device discovery and management, as well as remote deployment and debugging for Island and for Mac, iOS and Android.

  • Fire and Water now show and automatically boot up Android emulators when you choose them as target device, courtesy of EBuild.

  • CrossBox 2 builds can use a "shared root" (when you work in a VM, or have a shared network drive) to eliminate extra SSH network traffic, if your project is located in a folder accessible both to your Mac and Water or Visual Studio on Windows.

  • Gradle and NuGet packages, which EBuild now resolves on its own, for Java/Android and for .NET, get cached locally, for faster build times.

Island

  • If you're working with Island and inter-op with native APIs, you'll find that the DllImport and DllExport attributes have been greatly improved to automatically take care of calling-convention-based name mangling for you.

  • There have been a whole bunch of improvements to the Island tool chain, in particular for WebAssembly and Windows. Including vast binary size reductions, incremental linking, build speed improvements and more Island RTL and Elements RTL APIs.

  • For fans of the Delphi VCL, we added a special treat: a VCL-compatible library for creating WebAssembly forms, which Diego wrote about here.

Cocoa

  • Do you want to use third party .frameworks created in Objective-C? Importing those is now even easier than before, with the "Import .framework" option in Fire's "Tools" menu. Just point it to your .framework file, and off you go.

  • Speaking of frameworks, there's also been many enhancements in the EBuild build chain for supporting them – including that the build will now automatically re-sign embedded frameworks for you, for iOS.

  • "Make Swifty" has been improved for imported Cocoa frameworks, to offer lower-cased enum values and parameter prefixes in Swift.

Water

Water has come a long way in the past three months, going from "usable" to "almost ready." Among dozens of fixes and improvements, we've put a lot of work into providing feature parity with Fire. We've ported more parts over, including the Project Settings view (which leverages a new WPF grid control we created and looks absolutely gorgeous), added support for editor code snippets and search symbols, added more advanced CC capabilities that were previously Fire-only, and all of the "Manager" views in Fire.

We've also added support for remote Cocoa debugging via EBuild's CrossBox 2, bringing full coverage for all our platforms into Water. And we've ported support for Remoting SDK and Data Abstract file actions (such as generating/updating code from RODL or daSchema files).

Going Dark

Finally, Fire's Dark Theme has been extended beyond the Editor. Fire now fully embraces macOS Yosemite-and-later's unofficial dark mode. I must say, it looks pretty stunning in action – even if I myself am not a fan of dark UI. But those of you who prefer dark mode will love it.

marc hoffman

marc hoffman

Chief Architect and CEO here at RemObjects Software. Project Manager for Elements and lead developer of Fire, our awesome new development environment for the Mac.

Read More