Saturday, May 23, 2015

Questions that Reveal the Importance Of Good Tools and Add-Ons for Delphi Users

I'm working on a review of the new Nexus Quality Suite, which I'll be posting as soon as I've finished it.  I just wanted to write a quick post about a very simple topic, that I think might be a good question for every delphi shop's developers, and every single-person delphi developer to think about:

Can you afford NOT to answer any of these questions?

1.  What is the slowest function in my application? (Total CPU seconds spent while doing some particular sequence of commonly used features)

2. What function is called most often in my application, perhaps thousands or millions of times, perhaps even unnecessarily?  (Function X calls function Y, in a tight loop, burning CPU, and something calls function X more often than necessary.)

3. Do I have any memory leaks? Are any heap memory areas being written to after they are freed?

4.  Are there errors in my code that the Delphi compiler and its hints and warnings can't show me, that could be found easily by static analysis?

5.  What is your largest module (lines of code)?  What is your longest and most complex, and most potentially buggy function?

If you need answers to #1, and #2, and I think most developers do need answers, then you need a profiling tool.

If you need answers to #3, you need something of a heap debug session, either FastMM in Full Debug Mode, or something equivalent.

If you need answers to #4, you need something of a "LINT" tool, either CodeHealer, or Pascal Analyzer.

If you need answers to #5, and you're on XE8, you have Castalia, which will help you find functions that could be the most complex, or largest, or the largest units, in your application.   There are also some answers to related questions in the Audits and Metrics feature built into higher SKUs of Delphi.

What other questions should every Delphi developer ask about her codebase, and what tools do you recommend to find the answers to those important questions?