<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jamie&#039;s Blog &#187; .NET General</title>
	<atom:link href="http://jamiei.com/blog/topic/development/win-dev/dotnet-general/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamiei.com/blog</link>
	<description>Delphi Programming, Web Development, General Technology and, of course, Midget Gems</description>
	<lastBuildDate>Mon, 19 Dec 2011 09:19:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<cloud domain='jamiei.com' port='80' path='/blog/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>F# for a Delphi Programmer</title>
		<link>http://jamiei.com/blog/2011/02/f-for-a-delphi-programmer/</link>
		<comments>http://jamiei.com/blog/2011/02/f-for-a-delphi-programmer/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 22:21:57 +0000</pubDate>
		<dc:creator>jamiei</dc:creator>
				<category><![CDATA[.NET General]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Windows Development]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[introduction]]></category>

		<guid isPermaLink="false">http://jamiei.com/blog/?p=637</guid>
		<description><![CDATA[When Visual Studio 2010 was released and it included a large number of great new features, one of which in particular was portrayed as a stealth revolution by an article in The Register: F#. F# is a new .NET based functional programming language which emerged from Microsoft&#8217;s Cambridge Research lab as the primary focus of Don [...]]]></description>
			<content:encoded><![CDATA[<p>When <a href="http://www.microsoft.com/visualstudio/">Visual Studio 2010</a> was released and it included a large number of great new features, one of which in particular was portrayed as a <a href="http://www.theregister.co.uk/2010/04/19/microsoft_f_sharp/">stealth revolution</a> by an article in The Register: F#. F# is a new .NET based functional programming language which emerged from Microsoft&#8217;s Cambridge Research lab as the primary focus of <a href="http://research.microsoft.com/en-us/people/dsyme/">Don Syme</a>. F# is a major new first class .NET language citizen which is now built into the VS2010 product. The language takes a lot of inspiration from <a href="http://www.ocaml-tutorial.org/">OCaml</a>. Anders Hejlsberg recently spoke very encouragingly about it in his <a href="http://channel9.msdn.com/posts/adebruyn/TechDays-2010-Developer-Keynote-by-Anders-Hejlsberg/">Future Trends in Programming languages</a> talk at TechDays in Belgium, which is certainly worth watching if you haven&#8217;t seen it before. I&#8217;ve only been playing with F# for a while but it&#8217;s pretty nice and it&#8217;s certainly worth looking at functional programming if you haven&#8217;t already if only because it&#8217;s an interesting set of new techniques and requires a slightly different approach to problems.</p>
<p><img src="http://blogs.msdn.com/blogfiles/kathleen/WindowsLiveWriter/CreatingYourFirstFProgramwithVisualStudi_1046E/FSharp_1.png" alt="F# in Visual Studio 2010" /></p>
<p>The <a href="http://blogs.msdn.com/b/dsyme/archive/2010/11/04/announcing-the-f-compiler-library-source-code-drop.aspx">F# compiler and libraries</a> were also recently released as Open Source under the Apache 2.0 license which should make for some exciting developments in the future, not to mention better support for Mono.</p>
<p>I also found F# a good way to understand the slightly functional constructs that <a href="http://jamiei.com/blog/2010/06/new-goodies-in-delphi-prism-2011/">appeared in Delphi Prism 2011</a>. I&#8217;ve only just started beginning to learn F# but I thought I would highlight some of the particularly interesting differences that I&#8217;ve found compared to Delphi.</p>
<h3>Identifiers and let bindings</h3>
<p>Identifiers are the way which you assign names to your values so that you can reference them later, using the let keyword. To a Delphi programmer this may sound like the concept of variables, however there is one important difference in F#: Variables are immutable and therefore <em>normally</em> can&#8217;t be changed and once a value has been assigned to it. Consider the following:</p>
<pre class="brush: plain; title: ; notranslate">
open System

let x = 1
printfn &quot;%d&quot; x

let x = 2
printfn &quot;%d&quot; x
</pre>
<p>This will produce a compiler error where we attempt to reassign a new value to the identifier x. F# shares the type inference approach of C# 3.0 onwards so you do not need to explicitly declare the types of your variables as you do in Delphi (while Delphi Prism shares the C# approach). It should also be noted that as in Delphi, you can also assign identifiers to methods. For example, in Delphi you might do something like the following:</p>
<pre class="brush: delphi; title: ; notranslate">
var
  i: integer;
  myAdder: TFunc&lt;integer, integer, integer&gt;;
begin
  myAdder :=
    function(a, b: integer): integer
    begin
      result := a + b;
    end;
  i := myAdder(1, 2);
end;
</pre>
<p>The equivalent F# code might look like this where F# Functions are values in their own right anyway:</p>
<pre class="brush: plain; title: ; notranslate">
// Could also be written in longform as:
// let myAdder = fun a b -&gt; a + b

let myAdder a b = a + b
let i = myAdder 1 2
</pre>
<p>If you&#8217;re coming from Delphi, it is also worth noting that identifier names are case-sensitive.</p>
<h3>Scope</h3>
<p>F# defines scope, by default, using whitespace and indentation creates new scope, and the end of that particular scope is signaled by the end of the indented block. The following example demonstrates this, by reusing the identifier &#8216;z&#8217; as a midway calculation half way through a block.</p>
<pre class="brush: plain; title: ; notranslate">
let z = 1

let y =
    let z = 3 * 2
    z / 2

printfn &quot;%d&quot; y
</pre>
<p>This code also demonstrates that like the <a href="http://www.ruby-lang.org/en/">Ruby language</a>, you do no need to explicitly state a return value for a method. This can be quite freeing in many ways.<br />
It should also be noted that you can redefine identifiers with the <em>let</em> keyword whilst in the scope of a function. </p>
<h3>Pattern Matching</h3>
<p>Another favoured building block for functional programming is pattern matching. A very simple example of this might be compared to series of <strong>case</strong> or <strong>if</strong> statements in Delphi. For example, if we look at an implementation of the FizzBuzz problem in Delphi:</p>
<pre class="brush: delphi; title: ; notranslate">
	// if ((i mod 15 = 0)) then
        if ((i mod 3 = 0) and (i mod 5 = 0)) then
        begin
          WriteLn('FizzBuzz');
        end
        else if (i mod 3 = 0) then
        begin
          WriteLn('Fizz');
        end
        else if (i mod 5 = 0) then
        begin
          WriteLn('Buzz');
        end
        else
        begin
          WriteLn(i);
        end;
      end;
</pre>
<p>And then using pattern matching in F#:</p>
<pre class="brush: plain; title: ; notranslate">
// FizzBuzz Solution - @jamiei
open System

let FizzBuzz() =
    let nums = [1..100]
    let printbuzz x =
        match x with
        // | x when x%15=0 -&gt; printfn(&quot;FizzBuzz&quot;)
        | x when x%3=0 &amp;&amp; x%5=0 -&gt; printfn(&quot;FizzBuzz&quot;)
        | x when x%3=0 -&gt; printfn(&quot;Fizz&quot;)
        | x when x%5=0 -&gt; printfn(&quot;Buzz&quot;)
        | _ -&gt; printfn &quot;%d&quot; x;
    nums |&gt; List.iter(fun x -&gt; printbuzz x)
FizzBuzz()
let _ = Console.ReadLine()
</pre>
<p>Pattern matching must either be complete (i.e. must match all possible values of an identifier) or incomplete and include a wildcard (&#8220;_&#8221; in the above example) or the compiler will raise an exception at runtime. The compiler will also emit a warning for rules which will never be matched.</p>
<pre class="brush: plain; title: ; notranslate">
let rand = new Random()
let randNum = rand.Next(0, 100);
let coinToss =
    match randNum % 2 = 0 with
    | true -&gt; &quot;heads&quot;
    //| false -&gt; &quot;tails&quot;
printfn &quot;%A&quot; coinToss
</pre>
<p>Pattern matching may appear to be a simple tool but it&#8217;s an extremely concise way of controlling the flow of an application, particularly to get rid of what would otherwise turn into a spaghetti ball of if statements. Pattern matching can also be active, which means that they allow you to execute a function to determine the match.</p>
<h3>Units of measurement</h3>
<p>If you were listening carefully to the <a href="http://www.delphi.org">Podcast of Delphi.org</a> when <a href="http://blogs.remobjects.com/blogs/mh">marc hoffman</a> was talking to Jim McKeeth about the future of Delphi Prism, you&#8217;ll remember that he mentioned that this might be coming to Delphi Prism. This represents a pretty nifty way of marking the units of a value which makes you less likely to accidentally make a mistake when combining them with less effort than in Delphi where you would have to declare and create a class for each. The following code in F#, will throw an exception:</p>
<pre class="brush: plain; title: ; notranslate">
[&lt;Measure&gt;]type centimetre
[&lt;Measure&gt;]type inch
let distanceToMyThumb = 1&lt;inch&gt;
let distanceToMyOtherThumb = 2.5&lt;centimetre&gt;
let newVol = distanceToMyThumb + distanceToMyOtherThumb
</pre>
<h3>Summary</h3>
<p>F# is a very expressive language and the more I read and use it, the more I find that the expressions and constructs that it allows give me new ways to think about certain problems. It is also great that it is built upon the .NET Framework and can interact fully with the standard .NET libraries. My F# test modules can also interact with and be interacted by any Delphi Prism applications that I need it to. If your curiosity is piqued by functional programming and you are already familiar with the .NET framework then F# is a great way to try your hands. </p>
<h3> Further Information </h3>
<p>You can find more information on F# here:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/fsharp/default">F# MSDN Home</a></li>
<li><a href="http://fsharpsamples.codeplex.com/">F# Community Samples</a></li>
<li><a href="http://msdn.microsoft.com/en-us/magazine/ee336127.aspx">An Introduction to Functional Programming for .NET Developers</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jamiei.com/blog/2011/02/f-for-a-delphi-programmer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New Language Features in Delphi Prism</title>
		<link>http://jamiei.com/blog/2009/01/new-language-features-in-delphi-prism/</link>
		<comments>http://jamiei.com/blog/2009/01/new-language-features-in-delphi-prism/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 17:47:11 +0000</pubDate>
		<dc:creator>jamiei</dc:creator>
				<category><![CDATA[.NET General]]></category>
		<category><![CDATA[codegear]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Delphi Prism]]></category>
		<category><![CDATA[delphi prism]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[linq]]></category>

		<guid isPermaLink="false">http://jamiei.com/blog/?p=64</guid>
		<description><![CDATA[Continuing my look at Delphi Prism, in my previous post I took a (very short) look at some of the compatibility changes required to port my Delphi.NET  Twitter Library to Delphi Prism, I mentioned that I now needed to learn about some of the new language features provided by Prism. Ever since the release of [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing my look at <a href="http://www.codegear.com/products/delphi/prism">Delphi Prism</a>, in my previous post I took a (very short) look at some of the compatibility changes required to <a href="http://jamiei.com/blog/2008/12/migrating-a-project-to-delphi-prism-from-delphinet/">port my Delphi.NET</a>  Twitter Library to Delphi Prism, I mentioned that I now needed to learn about some of the new language features provided by Prism.</p>
<p>Ever since the release of Delphi.NET there has been much confusion surrounding why you would choose the Delphi language for .NET Development. When Delphi.NET was released there was concern that it was not a first class member of the .NET framework and always seemed to lag 12-18 months behind the lightning fast pace of development of the .NET Framework. With Prism Delphi offerings for .NET are based upon the <a href="http://www.remobjects.com">RemObjects</a> Oxygene compiler which isn&#8217;t required to maintain a loose language compatibility with the Win 32 Delphi compiler and therefore is able to progress at a much faster pace.  </p>
<p>Still, despite this: A recent <a href="http://stackoverflow.com/questions/242584/will-you-use-delphi-prism">Delphi Prism related thread</a> at <a href="http://stackoverflow.com/questions/tagged/delphi">StackOverflow</a> showed that there still seems to be a general feeling that Delphi is a second class citizen in the .NET Development World. Some even seemed to suggest that the language features in Prism make it unrecognisable as Delphi. To try to dispense with this idea: I thought that I would show off some of <em>my own</em> favourite new language features in Delphi Prism and ones which for me make it a natural fit for .NET.  </p>
<p>Please note: This is <strong>not</strong> intended to be a comprehensive guide to the new language features. For that you&#8217;ll need to refer to the <a href="http://prismwiki.codegear.com/en/Main_Page">Delphi Prism Wiki</a> page on <a href="http://prismwiki.codegear.com/en/Delphi_Prism_Syntax_compared_with_Win32_Delphi">Compatibility with Win 32 Delphi</a>.</p>
<p>My favourite new language features which Prism brings to the table for Delphi Developers is <a href="http://msdn.microsoft.com/en-gb/library/bb308959.aspx">LINQ</a>. <a href="http://www.monien.net/blog/">Olaf Monien</a>, who I also follow on Twitter (<a href="http://twitter.com/omonien">@omonien</a>), posted a beautifully simple<a href="http://www.monien.net/blog/index.php/2008/12/delphi-can-do-linq/"> example of using LINQ with Delphi Prism</a> on his own blog and then showed how Delphi Prism can also do <a href="http://www.monien.net/blog/index.php/2008/12/delphi-can-even-linq-to-sql/">LINQ to SQL</a>. I have replicated his basic example below because it also demonstrates another great language feature.</p>
<pre class="brush: delphi; title: ; notranslate">// Type Declaration
  MusicAlbum = record
  public
    Name: string;
    Artist: string;
    AlbumYear: integer;
  end;</pre>
<pre class="brush: delphi; title: ; notranslate">var
  MyAlbum: MusicAlbum;
  MyAlbums : List&lt;MusicAlbum&gt;;
begin
// Create our Album List
MyAlbums := new List&lt;MusicAlbum&gt;; 

// Setup a our records
MyAlbum := new MusicAlbum;
MyAlbum.Artist := 'Kanye West';
MyAlbum.Name := '808s and Heartbreak';
MyAlbum.AlbumYear := 2008;
MyAlbums.Add(MyAlbum);  

// Execute our LINQ Query
var AlbumsLastYear := from Album in MyAlbums where Album.AlbumYear.Equals(2008); 

// Add the result to our listbox
for Album in AlbumsLastYear do
begin
  lbFoundAlbums.Items.Add(Album.Artist + ' - ' + Album.Name + ' (' + Album.AlbumYear + ')');
end;

end;</pre>
<p> <br />
This code clipping also demonstrates <a href="http://prismwiki.codegear.com/en/Type_Inference">Type Inference</a> which allows a variable type to be inferred from the context of it&#8217;s usage. For example, consider writing the following: <strong><em>var</em></strong><em> MyGreatList := </em><span class="hl kwa"><strong><em>new</em></strong></span><em> List&lt;</em><span class="hl kwb"><em>String</em></span><em>&gt;; </em>or even something as simple as <strong><em>var</em></strong><em> s := &#8216;string&#8217;;</em>. Type Inference is a useful addition which I can see myself making extensive use of. My only concern about Type Inference is how it affect&#8217;s the readability of the code as I am used to reviewing the var section of a method for a guide to what types are used within a method.</p>
<p>LINQ can also be used with XML. The below example takes our previous sample and reads the data from an XML file instead: </p>
<pre class="brush: delphi; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;albums&gt;
		&lt;album&gt;
			&lt;artist&gt;Kanye West&lt;/artist&gt;
			&lt;title&gt;808s and Heartbreak&lt;/title&gt;
			&lt;albumyear&gt;2008&lt;/albumyear&gt;
		&lt;/album&gt;
		&lt;album&gt;
			&lt;artist&gt;Kanye West&lt;/artist&gt;
			&lt;title&gt;Graduation&lt;/title&gt;
			&lt;albumyear&gt;2007&lt;/albumyear&gt;
		&lt;/album&gt;
		&lt;album&gt;
			&lt;artist&gt;Nas&lt;/artist&gt;
			&lt;title&gt;Unartistd&lt;/title&gt;
			&lt;albumyear&gt;2008&lt;/albumyear&gt;
		&lt;/album&gt;
		&lt;album&gt;
			&lt;artist&gt;Notorious OST&lt;/artist&gt;
			&lt;title&gt;The Notorious B.I.G.&lt;/title&gt;
			&lt;albumyear&gt;2009&lt;/albumyear&gt;
		&lt;/album&gt;
&lt;/albums&gt;
</pre>
<pre class="brush: delphi; title: ; notranslate">

var
  AlbumData: XDocument;
begin
  // Load our XML Document with a System.Xml.Linq.XDocument
  AlbumData := XDocument.Load('../../albums.xml');

  // Query for albums in the year 2008
  var AlbumsLastYear := from Album in AlbumData.Descendants('album') where Album.Element('albumyear').Value = '2008' select Album;

  for Album in AlbumsLastYear do
  begin
    var s := String.Format('{0} - {1} ({2})', Album.Element('artist').Value, Album.Element('title').Value , Album.Element('albumyear').Value);
    lbFoundAlbums.Items.Add(s);
  end;
</pre>
<p> </p>
<p>Another new language feature that I like in principle but will completely admit to not fully understanding yet is <a href="http://prismwiki.codegear.com/en/Anonymous_Methods_and_Delegates">Anonymous Methods and Delegates</a> which make executing code with different threads much easier. Sadly in my brief testing of Anonymous methods I discovered that they are only available in projects which link to the .NET Framework 3.0 and above (and, in my case, only WPF projects). In order to execute our ListBox adding code from the first code sample as an Anonymous Delegate you can do the following:</p>
<pre class="brush: delphi; title: ; notranslate">
// Add the result to our listbox
for Album in AlbumsLastYear do
begin
  Dispatcher.Invoke(DispatcherPriority.ApplicationIdle, method(MyAlbum : MusicAlbum);
      begin
      lbFoundAlbums.Items.Add(MyAlbum.Artist + ' - ' + MyAlbum.Name + ' (' + MyAlbum.AlbumYear + ')');
      end, Album);
end;
</pre>
<p>This means that the compiler declares a delegate with a signature matching our anonymous method and we have now easily executed this code within a seperate thread with a minimum of code.</p>
<p>There are several new language features which I personally have no use for but which facilitate the use of the Microsoft Parallels framework such as <a href="http://prismwiki.codegear.com/en/Futures">Futures</a> and <a href="http://prismwiki.codegear.com/en/Sequences">Parallel sequences</a>. Delphi Prism also supports Generics and as well as most of the standard Delphi Win32 syntax.<br />
 <br />
There are also lots of small additions that aren&#8217;t .NET features per-se but demonstrate the usefulness of freeing the Prism compiler and allowing more rapid progression such as <a href="http://prismwiki.codegear.com/en/Boolean_Double_Comparison">Double Boolean Expressions</a>. I&#8217;m sure we&#8217;ve all written a statement like this before:<strong> if</strong> (cost > 400) <strong>and</strong> (cost < 600) <strong>then</strong>. In Delphi Prism this can also be written as: <strong>if</strong> 400 < cost < 600 <strong>then</strong>. </p>
<p>As I quickly discovered whilst going through the Delphi Prism Wiki: the language changes to Delphi Prism were easier to adapt to and to learn than I had originally imagined. The New language features gained mostly did not affect my coding style too much <strong>so any developers who were concerned that Delphi Prism is nothing like Delphi have nothing</strong> to worry about. Many of the new features are useful for compatibility with the .NET Framework and will be a natural fit for existing Delphi or .NET Developers</p>
]]></content:encoded>
			<wfw:commentRss>http://jamiei.com/blog/2009/01/new-language-features-in-delphi-prism/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Migrating a Project to Delphi Prism from Delphi.NET</title>
		<link>http://jamiei.com/blog/2008/12/migrating-a-project-to-delphi-prism-from-delphinet/</link>
		<comments>http://jamiei.com/blog/2008/12/migrating-a-project-to-delphi-prism-from-delphinet/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 16:25:04 +0000</pubDate>
		<dc:creator>jamiei</dc:creator>
				<category><![CDATA[.NET General]]></category>
		<category><![CDATA[codegear]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Delphi Prism]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Windows Development]]></category>
		<category><![CDATA[delphi prism]]></category>
		<category><![CDATA[project conversion]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://jamiei.com/blog/?p=59</guid>
		<description><![CDATA[As we know, now that the future of Delphi.NET is Delphi Prism (based on the RemObjects Oxygene compiler) we have to migrate our Delphi.NET projects to be compatible with the Prism compiler. The Easiest way to get started is to look at the free Oxidizer tool provided on the RemObjects Wiki. The tool helps with [...]]]></description>
			<content:encoded><![CDATA[<p>As we know, now that the future of Delphi.NET is <a href="http://www.codegear.com/products/delphi/prism">Delphi Prism</a> (based on the <a href="http://www.remobjects.com">RemObjects Oxygene</a> compiler) we have to migrate our Delphi.NET projects to be compatible with the Prism compiler.<a href="http://www.codegear.com/products/delphi/prism"><img class="alignright" title="Codegear Delphi Prism Logo " src="http://www.codegear.com/article/38820/images/38820/prism.png" alt="" width="112" height="75" /></a></p>
<p>The Easiest way to get started is to look at the free <a href="http://prismwiki.codegear.com/en/Oxidizer">Oxidizer tool</a> provided on the <a href="http://prismwiki.codegear.com/en/Main_Page">RemObjects Wiki</a>. The tool helps with the conversion of Delphi Win32 projects to Delphi Prism (but I&#8217;m uncertain about how it performs on Delphi.NET to Delphi Prism). The Wiki is also an excellent place to get started, particularly the pages on <a href="http://prismwiki.codegear.com/en/Win32_Delphi_vs._Delphi_Prism">Delphi Win32 vs Delphi Prism</a> which list the major incompatibilities between the two languages. </p>
<p> </p>
<p>Whilst converting my Delphi.NET Library for accessing Twitter, I encountered a few basic hints and tips which I felt I should share here:</p>
<ul>
<li>You need to specify the <strong>namespace</strong> keyword at the top of your unit file instead of the <strong>unit</strong> keyword. The first time I tried to compile after doing this Prism still complained about not having a namespace keyword present, this was fixed by closing the solution and re-opening.</li>
<li>Delphi Prism automatically makes classes that are not explicitly marked otherwise as <strong>strict private</strong>. This meant that I had to go through my library and mark all classes that I wanted to make public. eg. <em>TMyClass = <strong>public </strong>class(System.Object);</em></li>
<li>The <strong>overload</strong> keyword isn&#8217;t neccesary as overloading is now implicit. This isn&#8217;t a problem at all and isn&#8217;t dificult to fix as it simply meant doing a Search and Replace for the overload keyword and removing it.</li>
<li><strong>TObject </strong>no long exists and instead needs to be replaced with <strong>System.Object</strong> which has much the same properties. </li>
<li>I encountered a few problems with the use of <strong>for .. in</strong> loops. It would seem that Delphi Prism loop variables are local to the loop and therefore should be declared at the beginning of the loop (see the <a href="http://prismwiki.codegear.com/en/For_(keyword)">for</a> wiki page for more info). In reality this meant changing: <strong><em>for </em></strong><em>strItem </em><strong><em>in</em></strong><em> list </em><strong><em>do </em><span style="font-weight: normal;">to<em> </em><strong><em>for </em></strong><em>strItem: string </em></span><em>in</em><span style="font-weight: normal;"><em> list </em><strong><em>do</em></strong> and then removing the </span>strItem: string; <span style="font-weight: normal;">declaration in the method var section.</span></strong></li>
<li>The <strong>TObject.Create([...]);</strong> constructor still exists however it is now <a href="http://prismwiki.codegear.com/en/New_(keyword)">recommended</a> that you switch to the <strong>new Object([..]) </strong>keyword for new projects. This may come as a shock to traditional Delphi&#8217;ers who have been <strong>.Create()</strong>&#8216;ing since the dawn of Borland but this is the construction method that sems to fit in with the .NET framework better. There is also a compatibility flag in the Project properties which allows the compiler to work some magic to allow .Create to continue to function.</li>
</ul>
<p>These are not the only changes that you will probably need to make but I found them to be a good starting point. You should definitely consult the <a href="http://prismwiki.codegear.com/en/Main_Page">Prism Wiki</a> for help in which I was able to find answers very quickly (no wading boots required!).</p>
<p>Lastly: My project could do with a lot of refactoring in order to take advatages of the unique language features of Prism. This will take considerably more time as it means learning the new language features first!</p>
]]></content:encoded>
			<wfw:commentRss>http://jamiei.com/blog/2008/12/migrating-a-project-to-delphi-prism-from-delphinet/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A New Beginning for Delphi</title>
		<link>http://jamiei.com/blog/2008/11/a-new-beginning-for-delphi/</link>
		<comments>http://jamiei.com/blog/2008/11/a-new-beginning-for-delphi/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 19:46:08 +0000</pubDate>
		<dc:creator>jamiei</dc:creator>
				<category><![CDATA[.NET General]]></category>
		<category><![CDATA[codegear]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[delphi prism]]></category>
		<category><![CDATA[marketing]]></category>

		<guid isPermaLink="false">http://jamiei.com/wordpress/?p=40</guid>
		<description><![CDATA[Delphi programming is currently being rejuvenated on so many different levels. I was pleased to see that in the November 2008 TIOBE Index of Programming Languages Delphi shot up to 8th place (only .020% behind c#). I believe that this is partially on the excellent efforts of my good friend Jim McKeeth whose community herding has helped [...]]]></description>
			<content:encoded><![CDATA[<p>Delphi programming is currently being rejuvenated on so many different levels. I was pleased to see that in the <a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html">November 2008</a> TIOBE Index of Programming Languages Delphi shot up to 8th place (only .020% behind c#). I believe that this is partially on the excellent efforts of my good friend <a href="http://www.delphi.org">Jim McKeeth</a> whose community <a href="http://www.delphi.org/2008/10/delphi-language-of-the-year-2008/">herding</a> has helped out Delphi community to become more visible (&#8220;Delphi Programming&#8221; is simply not a phrase we were used to using!) and partially because of the excellent reviews and community <em>noise</em> that Delphi 2009 is receiving!</p>
<p><a href="http://www.codegear.com/products/delphi/prism">Delphi Prism</a> was announced finally at the Microsoft PDC where we discovered (or some of us) that Delphi Prism is the new Delphi .NET Development solution which drops the slightly crippled compatibility approach that Delphi used to employ and instead fits within the Visual Studio IDE. Delphi Prism now supports all the latest and greatest .NET technologies including WPF, LINQ and Various Language methods. They&#8217;ve achieved this by making use of the extremely cool <a href="http://www.remobjects.com">RemObjects</a> <a href="http://wiki.remobjects.com/wiki/Oxygene">Oxygene</a> Compiler which I would highly recommend that you investigate right away if you&#8217;re interested at all in .NET Development! I will be doing a post soon to discuss some of my favourite new Delphi Prism language features!</p>
<p> </p>
<p>This rejuvenation of Delphi is causing a product marketing effect and is slowly gathering momentum and I fully intend on doing whatever I can to generate enthusiasm for the Delphi Programming Community. This concept of User-led marketing has been widespread for many years as Apple fans will testify. As part of this I have a new project in mind for the Delphi community and will be explaining this in due course. I will certainly require Delphi enthusiasts to help with this venture, if you&#8217;re interested then please contact me.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamiei.com/blog/2008/11/a-new-beginning-for-delphi/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

