Visit site The Programming Works

February 2012

2
votes
Vote UpVote

Functional programming style in Delphi

The Programming Works – Functional programming paradigm gradually finds its way even in Delphi – a procedural language without a garbage collector. Consider the next code sample that changes a button’s caption using extended RTTI (requires Delphi 2010 and above): procedure TForm1.Button1Click(Sender: TObject); ...
Details Favorite? Off-Topic? Serg @ 2012-02-04 02:57

January 2012

3
votes
Vote UpVote

On the Delphi documentation issues

The Programming Works – Delphi XE2 documentation states: ‘Packed’ Now Forces Byte Alignment of Records If you have legacy code that uses the packed record type and you want to link with an external DLL or with C++, you need to remove the word “packed” from your code. The packed keyword now forces ...
Details Favorite? Off-Topic? Serg @ 2012-01-27 09:32
1
vote
Vote UpVote

On the type compatibility in Delphi

The Programming Works – Delphi compiler evolves much faster than Delphi documentation, and some language features remain unnamed. Consider the following code snippet: type MyPChar1 = PChar; MyPChar2 = type PChar; MyPChar3 = ^Char; procedure Test(Ch: PChar); begin end; procedure TForm1.Button4Click(Sender: ...
Details Favorite? Off-Topic? Serg @ 2012-01-12 16:08

December 2011

7
votes
Vote UpVote

TThread Facts

The Programming Works – Delphi RTL TThread class has been an object of criticism since its introduction. Some criticism was deserved, some not. TThread implementation was gradually improving with every Delphi version. Here I am neither criticizing nor advocating the TThread class, just listing some facts about TThread ...
Details Favorite? Off-Topic? Serg @ 2011-12-18 05:37
1
vote
Vote UpVote

Yet Another Word about FreeAndNil

The Programming Works – The FreeAndNil discussion never stops. I decided to add my twopence. How about this: {.$DEFINE FREEANDNIL} {$IFDEF FREEANDNIL} procedure FreeObj(var Obj); inline; begin FreeAndNil(Obj); end; {$ELSE} procedure FreeObj(Obj: TObject); inline; begin Obj.Free; end; {$ENDIF} With FreeObj procedure ...
Details Favorite? Off-Topic? Serg @ 2011-12-14 08:16
1
vote
Vote UpVote

Hierarchical database structures and Firebird PSQL

The Programming Works – The idea of storing a hierarchical data in a relational database is very simple, but effective work with such a data requires some knowledge of server-side programming using procedural SQL (PSQL). So the hierarchical data structures are a good chance to get acquainted with PSQL. For demonstration ...
Details Favorite? Off-Topic? Serg @ 2011-12-09 13:34
20
votes
Vote UpVote

Why we need interfaces in Delphi.

The Programming Works – Objects are normally accessed by an object reference. Interface reference is a different method to access an object’s functionality. A simple question – why do we need interface references at all, why can’t we use object references everywhere? There are several reasons to use interface ...
Details Favorite? Off-Topic? Serg @ 2011-12-08 15:45
9
votes
Vote UpVote

Semaphore throttle

The Programming Works – Suppose we have an algorithm that uses N parallel threads, and we have a system with M CPU cores, N > M. Running the algorithm on the system leads to performance loss because the threads are contend for available CPU cores and cause time-consuming thread context switching. A better approach is to ...
Details Favorite? Off-Topic? Serg @ 2011-12-08 07:06

August 2011

4
votes
Vote UpVote

Dotted unit names in Delphi

The Programming Works – For some time now (probably since Delphi 2005; at least the feature is present in Delphi 2007) Delphi has support for dotted unit names (like myLib.myUtils.pas). A fully qualified unit name (myLib.myUtils.pas) consists of a scope prefix (myLib) and a scoped or partially qualified unit name ...
Details Favorite? Off-Topic? Serg @ 2011-08-09 05:31

June 2011

4
votes
Vote UpVote

Sleep sort and TThread corner case

The Programming Works – If you have not heard it yet – an anonymous genius from 4chan invented a sleep sort, brilliant esoteric sorting algorithm. I have written sleep sort implementation based on Delphi TThread class for rosettacode project, and started to experiment with the code. One of the working variants is: ...
Details Favorite? Off-Topic? Serg @ 2011-06-25 05:22

May 2011

1
vote
Vote UpVote

Generic musings 2

The Programming Works – It was pointed out in the comments to my previous post that my simple generic sorting routine contains additional overhead compared to TArray Rtl code (Generic.Collections & Generic.Defaults units) because RTTI is used inside the loop. Yes, that is true. Let try to improve the code by taking ...
Details Favorite? Off-Topic? Serg @ 2011-05-11 12:20
1
vote
Vote UpVote

Generic musings

The Programming Works – Delphi (as Pascal descendant) has always had powerful type system. Consider the following sample code implementing simple insertion sort algorithm (I use Delphi 2009): unit InsSort; interface type TItem = Integer; TArray = array of TItem; procedure InsertionSort(var A: TArray); ...
Details Favorite? Off-Topic? Serg @ 2011-05-10 14:24
11
votes
Vote UpVote

Installing Virtual Treeview

The Programming Works – Delphi component’s package installation procedure has always been a mess. If you don’t rely on self-made “automated” installations that just copy compiled binaries and do some registry patches that could easily destroy your Delphi installation beyond repair you should do ...
Details Favorite? Off-Topic? Serg @ 2011-05-06 15:14

April 2011

7
votes
Vote UpVote

Best 1st April joke. Ever.

The Programming Works – My regards to lazarus.su (in Russian). It’s 1st April post was: Lazarus developers announced that the IDE source code is closed and sold to Embarcadero. Under the unconfirmed information the last Lazarus version 0.9.30 will become the base for the next Delphi release – FPC Edition. ...
Details Favorite? Off-Topic? Serg @ 2011-04-03 17:30

February 2011

2
votes
Vote UpVote

How to generate HTML Help with Doc-O-Matic Express

The Programming Works – XMLDoc in-source documentation style is becoming popular among Delphi open-source projects. There is also very good Delphi Documentation Guidelines document which describes what XML tags should be used for in-source XMLDoc-style documenting comments and how to use these tags. Unfortunately currently ...
Details Favorite? Off-Topic? Serg @ 2011-02-11 12:27
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Delphi Tage Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)