Things I’ve done…

The software industry is always moving and new things are on the edge from day to day; these are some of the things I’ve stumbled upon in these years.

Cross platform UIs

There are many toolkit and libraries around that can be used to develop cross platforms User Interfaces – long ago I had to use zApp from Rogue Wave to implement a monitoring tool for a trading platform that was used both under Windows and Solaris. The language used was pure C++, the existing code was pretty a mess and was written not exactly in an orthodox C++ style, so it took quite some time to clean it up. Introducing the STL has been necessary to implement a reasonable join mechanism for a bunch of real time tables coming from the platform.

Code porting (legacy to managed)

.NET has been the big thing for a while when it came out in early 2Ks; my company had two big UIs at the time written in C++ and soon was decided to embrace the new technology rewriting the existing code to .NET (which was 2.0 in these days). The language used was of course C# and since some legacy libraries could not be replaced some C++/CLI code was used too. The GUI Library was of course WinForms since was the only available in those days.

Trading UIs

After having worked at the platform administration UI for some years I moved to the trading UI; it’s a big software solution that not only provides the trading tool for many traders around the world but is also the company toolkit and a modular software that can be enhanced with plugins both by the company and by the customers. The first module I wrote was the negotiation settings configurator, a multi table screen used to configure the automatic negotiation rules for the dealer to customers trading. After that I wrote some simple plugins across the trading and the administration UIs and finally I started working in the Core Architecture Team, which maintains and develops the main trading application.

ODBC driver

One of the functionalities often provided by the trading solutions is some form of database (sometimes with custom filtering or query built in…) with the registration of whatever kind of operations (orders, trades, platform statistics, …). Some people really love to work with Microsoft Excel and to simplify browsing custom data that would be otherwise available only through custom UIs, I implemented an ODBC driver able to feed Excel with custom data in a standard format. A small VBA user interface was also provided to operate on the custom filtering before the query was sent to the DB.

Did someone say… scrum?

The scrum agile development is something in which more or less all the developers has heard of or done; scrum has been adopted also by the company in which I work: all the usual vocabulary has been analysed, discussed, used,… and sometimes criticised; development team, scrum master, daily meeting, backlog, sprint planning and review, points, retrospective, and so on.
I’d say it has pros and cons, so all of us has his view on this right? 😉

Porting, porting all the way! (WPF)

WinForms is cool but since its inception the Windows environment has changed quite a bit: starting from Windows Vista many standard UI features has been implemented using DirectX, leveraging the capabilities of the GPUs – the process got refined in the subsequent OS versions (Windows 7 and Windows 10). Even if the Microsoft strategies about the languages and the toolkits to use for the LOB software have been not so clear along the years (the UWP attempt is one of these…), as of now for those who want (or need) to develop Desktop Applications the available technologies are many but if you want to adopt Microsoft you still can choose from WinForms, WPF, UWP or the new .NET Core implementation. The WPF layouting and rendering stack can be somehow confusing if you come from the usual Paint() Win32 model but in terms of customisation is the best you can probably get if you have to play with the Redmond ecosystem. Also, if adopted the right way, the MVVM pattern is incredibly clean and helps a lot also in terms of unit testing your classes.

The next big thing has thus been the complete rewriting of the trading UI using WPF: the user interface got a complete redesign and modernisation, a brand new theme engine (great for customisation), new form of interactions and a complete toolkit with a lot of customised widgets that simplifies the implementation of the trading interfaces.

Performance monitoring

A trading application is a mission-critical software, so it is important that everything goes as expected. But in financial markets it can happen to face particularly volatile data streams or receive burst of updates due to spike events. While it is a common development technique to log into a service file some relevant information and/or application health and performance statistics, if something goes wrong or the application isn’t able to get back to the statistical procedure, it could result in these data to be missing or partial.

Providing an external monitoring tool that checks through the standard Windows API and other techniques the application health and the overall performance of the solution and the machine in which the application is running has been one of the tasks which turned out to be most challenging and interesting in the latest years – process resources, GDI and USER objects, threads deadlock and performance, IO monitoring, memory and CPU usage, .NET performance indicators are only some of the aspects that we had to take into account to be able to investigate performance issues and bottlenecks in our software.

Crash analysis

Well, programming is a human activity and humans… make mistakes. To avoid a crash in a software in all these years engineers has written rivers of articles, invented coding technique, design pattern but still we have to deal with it. Once I read a Bjarne Stroustrup interview in which one of the questions was something like “how do you avoid memory leaks?” – and the answer was “You don’t do it”. Easy peasy :-\
It would be great if we could do the same with application crashes (ever seen a crashing application due to “Out of memory”?) but unfortunately it isn’t easy at all. Using managed code helps but in complex configurations not always we can avoid legacy libraries – sooner or later you’ll have to reckon with minidumps.

One of the usual activities in my developer years has been to dig into minidumps with WinDbg (today there’s also a more modern WinDbg Preview version) and – incredible to say – I’ve also found that sometimes the culprit is not only your code but also the code written by the big names: in the end, if we consider how we started this paragraph, a reasonable corollary is “and all developers are humans“.

Inter Process Communication

Sometimes multi-threading is not enough; when an application becomes really big and offers a huge amount of functionalities I think we should start looking at it as a “set of services“, not just as an application – the obvious next step (at least, to me) is to start fragmenting it into smaller processes and interconnect them with a solid IPC system. It can happen in many years of coding that a big application, developed by many developers from various teams, needs its stacks to be simplified and some pipelines to be introduced to clean-up the overall design.

I’ve written a small IPC library in C# able to interconnect processes and send/receive messages among them; messages are dispatched directly to the handling procedures with a minimal effort from the user that just have to write as POCO as possible. The library has nearly no charge on the main thread and is also able to simulate blocking and async RPC.

HTTP Server and WebSocket

Even if I’ve mainly worked with desktop solutions it’s been pretty common for the companies in the latest years to get aboard the Web Train, which (in many ways) means HTML5 and all the libraries that you can find around about it (React, Angular, Node.js, Vue, Redux, jQuery, Bootstrap, you name it…). Interacting with this world can be easy or not, depending on the level of interaction and integration needed (theming, UX, …).

To simplify this thing I recently extended our IPC library to make it implement a small and flexible HTTP Server that lets it clients to Upgrade the connection to a standard Unix socket or to a WebSocket link compliant with RFC 6455. This let our desktop application easily interact with other legacy software or Javascript applications using the JSON data-interchange format.

…and what I’m doing.

I’m currently leading the integration of the user interfaces available from my firm and our customers into a single “Operational Environment” that let the applications inter-operate and share data across technologies.