Steve Trefethen
Contact me
About Me View my LinkedIn profile

Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?
Need consulting?
Need Consulting?

Spread Thunderbird

Disclaimer

The posts on this weblog are provided AS IS with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

TestComplete Keyword Testing Online Training

I will be presenting a three day webinar April 12-14th 2010 from 9am-1pm PST on AutomatedQA's TestComplete. The cost is $499/person and you can register on Falafel Software's website here. For detailed information on this training click here.

Delphi RTL and Language Wisdom

June 26 2007 4:34PM

It's Tuesday and following up my VCL list from yesterday, here my list for the RTL and Object Pascal language:

  • Learn to create your own TList descendants
  • Learn to write your own TCollection/TCollectionItem descendants
  • Use Format
  • Learn TThread then, understand TThread.Synchronize
  • Use TFileStream, TStringStream, TMemoryStream
  • Learn how to use the classes in SyncObjs.pas
  • Learn to call a function from a dynamically loaded DLL
  • Use exceptions
  • Learn when to use stdcall
  • Learn to use open array parameters
  • Use the *utils.pas units, DateUtils, StrUtils, MaskUtils, ConvUtils, VarUtils etc.
  • Learn the Math unit
  • Use SafeMM
  • Learn which exceptions the RTL throws
  • Use try...finally
  • Read the comments in SysUtils.pas
  • Call FindClose after calling FindFirst
  • Learn how to load packages dynamically
  • Use FindCmdLineSwitch
  • Just because it's not in Windows.pas doesn't mean it can't be called from Delphi
  • Learn function inlining
  • Be careful using "with"
  • Learn to use interfaces
  • Use dynamic arrays
  • Read the Language Reference manual
What am I missing?
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Tags:

Comments

6/26/2007 7:28:50 PM #

Sebastian Zierer

Where can I get SafeMM?

Sebastian Zierer

6/27/2007 1:37:47 AM #

Eric TF Bat

First: always use FreeAndNil(X) instead of X.Free.

Second, the biggest single time-saver for me is my own TMonitoredObject class.  It inherits from TObject, but adds a sequential ID number for each instance.  If I $DEFINE DEBUG, the constructor and destructor each write a log entry indicating that they've been called, along with the actual class name and ID number.  At the end of a program run, the unit that defines TMonitoredObject gives me a list of any objects that haven't been freed.  It also tracks double-freeing, although that's less of an issue if you use FreeAndNil.  Just insure you always use type TFoo = class(TMonitoredObject) instead of TFoo = class, and you're set.  In one fell swoop, it makes memory leaks virtually impossible.  I can stick a copy up somewhere if you want to see it, but it's pretty easy to produce just from that description.

Eric TF Bat

6/27/2007 3:20:23 PM #

Steve Trefethen

Sebastian,
Ben Taylor did work on SafeMM though I can't find much about it on the web. I'll dig up what I have about it and get it posted. We use it here to help strictly with memory leak detection.

Steve Trefethen

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Spam filtering provided by: Spam Counter
331 comments approved, 1455 spam caught since October 28, 2009
Powered by Commentor