Lately I have been doing my first (real world) C# project. (Unfortunately I had to do it in VS2003 ;( )
C# must be Delphi's little brother! The language really feels like the Delphi language. Also the syntax, was not all that difficult to get used to.
I find my self programming 'Delphi code style' in C#.
For example in Delphi you write a function like this:
function ReturnANumber(SomeCondition : Integer) : Integer;
begin
Result := 0;
If SomeCondition > 100 then
Result := 101
else
Result := 102;
end;
You can not do this in C#, because it will return immediately to the caller, so I figured the following:
private int ReturnANumber(int SomeCondition)
{
int Result;
Result = 0;
If (SomeCondition > 100)
{
Result = 101
}
else
Result = 102;
return Result;
}
How about this function:
private void bool Assigned(object AObject)
{
if (AObject = null) return false else return true;
}
If you use this function for raising an event, well it could almost be Delphi :-)
if Assigned(SomeMethodPointerType) SomeMethodPointerType(this);
Programming blogs containing .NET, C#, LINQ, Objective-C and Delphi experiences
Subscribe to:
Post Comments (Atom)
Use an image as your UIBarButtonItem
Using an image as your UIBarButtonItem in your navigationcontroller bar can only be achieved by using a common UIButton as the BarButtonItem...
-
In ASP.NET it is easy to set the prefered authentication method in the web.config file. For external websites this is set mostly to Forms ...
-
Using an image as your UIBarButtonItem in your navigationcontroller bar can only be achieved by using a common UIButton as the BarButtonItem...
-
How to get, for example, all the hyperlinks from a webpage, which is loaded in your iPhone app using the UIWebView control? (Xcode's web...
No comments:
Post a Comment