Other things to watch out for:
- Assembler (asm). The normal best practice for assembler code is to write it first in the higher-level language (Pascal), then rewrite it in assembler. The high-level code is then left in the file commented out. Not only do Delphi programmers almost never, ever do this, but they almost never include so much as a single line of comments. This shows how even great, hotshot programmers can write terrible code (read: hard to maintain, difficult to enhance, almost impossible to port). I chalk this up to a lack of adult supervision when they started out. With a good manager who is also an actual developer, a new programmer should never develop bad habits like this.
- Font assumptions. Windows and Mac both come with many of the same TrueType fonts, such as Courier New, Times New Roman, and Arial. As such, you can use these fonts in your forms without problem. By default, Delphi uses MS Sans Serif - you can change this to Arial without much difference in look and then the form will display the same on Mac. With GTK, these fonts generally look terrible. Fortunately it appears as though the GTK(1) widgetset is being phased out with Lazarus. The more recent GTK libraries used by the GTK2 widgetset do a much better job of matching up a similar font so you should be able to continue using TrueType if you want on the Windows/Mac side and let the GTK smarts handle the mapping so you don't have to use two different form design files.
- All the extra Win-specific units such as MMSystem, etc. that Delphi makes so easy to use.
- Lots of programs use TMetaFile to do preview-mode stuff. TMetaFile is not available cross-platform in the LCL. I believe there is a Windows-only version. On Mac, you really don't need a preview mode. Any program that can print can also preview as well as save to PDF, all from the Print dialog. That just leaves Linux...
- If you're on top of your game and you're porting a large codebase, you will almost certainly find bugs in the Lazarus LCL or Free Pascal RTL. Once logged, generally these bugs are fixed pretty fast, but then you have to decide whether you can continue using the stable version. Sometimes fixes are so tied up to other changes that you have no choice but to move to a snapshot/SVN version so as to get the fixes you need.
- Other things that can usually be worked around pretty easily: Differences in clipboard, loading resources like cursors, shelling to external apps, etc.
- Hardwired backslash as part of file paths, even though Delphi has always provided IncludeTrailingBackslash and similar functions for avoiding this.
Thanks.
-Phil