Archived

This topic is now archived and is closed to further replies.

delphi vs c++

This topic is 5668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The two languages are so similar that people often translate code between the two. Any application you can make in C++ can be made with Delphi. Delphi has full access to DirectX and every other Win32 API.

The only factor you should take into account is which language do you prefer? C++ or Object Pascal? Nothing else is relevant.

Download the free version of Delphi 6 Personal (140MB) from Borland and compare the two yourself.

Steve 'Sly' Williams   Monkey Wrangler  Krome Studios
turbo game development with Borland compilers

[edited by - sly on June 4, 2002 7:56:18 PM]

Share this post


Link to post
Share on other sites
Delphi (the IDE) lends itself to RAD more than most C and C++ development environments do, so it''s often used for developing GUI''s quickly.
quote:
Original post by Sly
Any application you can make in C++ can be made with Delphi.

Yeah. To put some perspective on it though: the same can be said about C and C++, even though C doesn''t have all of the features that C++ has.

Share this post


Link to post
Share on other sites
Hmmm...
I getting to the stage where I need to make a win32 level editor for my game, and if Delphi is quicker at that maybe I should learn it... you say that C++ and Delphi are similar, but just how similar, like how long would it take for me to learn it, or am I just better brushing up on my win32 skills and doing it in that?

CEO Plunder Studios

Share this post


Link to post
Share on other sites
Generic code snippets:
var
i: Integer;
begin
for i := 0 to someValue do
begin
something(); // usually you just say "something;"
end;
end;
int i;
for (i = 0; i <= someValue; ++i)
{
something();
}

------------------------------------------
TSomething = class(TBaseClass)
private
protected
public
constructor Create;
destructor Destroy; override;
end;

constructor TSomething.Create;
begin
inherited; // call base class method of same name
end;

destructor TSomething.Destroy;
begin
inherited;
end;
class CSomething: public TBaseClass
private:
protected:
public:
CSomething();
~CSomething();
};

CSomething::CSomething()
{
}

CSomething::~CSomething()
{
}

----------------------------------------
procedure SomeProc(i,j,k,l: Integer);
begin
end;

void SomeProc(int i, int j, int j, int l)
{
}

-----------------------------------------
type
TCards = (cdAce, cdDiamond, cdClub, cdSpades);
enum TCards { cdAce, cdDiamond, cdClub, cdSpades} ;  

-----------------------------------------
virtual void someAbstractProc() = 0; // abstract
procedure someAbstractProc; virtual; abstract;


-----------------------------------------

Finally, some OpenGL code:

glBegin(GL_POLYGON);
glVertex3f(0.5, 2.0, 0.0);
glVertex3f(0.0, 2.5, 0.0);
glVertex3f(-0.5, 2.0, 0.0);
glVertex3f(-0.5, 1.4, 0.0);
glVertex3f(-0.1, 1.0, 0.0);
glVertex3f(0.1, 1.0, 0.0);
glVertex3f(0.5, 1.4, 0.0);
glEnd();


(Either language(!).)

In short:
+ They both end with semi-colons
+ Delphi isn't case sensitive
+ They have about the same functionality
+ You generally type slightly more in Delphi
+ C++ lets you get away with more type tomfoolery (casting betweem all sorts of types. You can do this in Delphi but you generally have to try harder to blow things up

* Delphi doesn't do templates or multiple inheritance. The latter isn't a big loss in my opinion. The former could be. There is talk (thanks to Magmai for this tidbit) that .NET might include generics, so that could be introduced into the next Delphi .NET. Also, look for DECAL for generic containers.

The final conclusion? Use whatever makes you happy. For me it's Delphi simply because I prefer readability and can touch type...

[edited by - Alimonster on June 4, 2002 8:48:29 PM]

Share this post


Link to post
Share on other sites
Fair enuff, but I implore you: if you''re doing RAD in C++ then use Borland C++ Builder. Not MFC or Win32 API. If you try out Builder you''ll see it''s pretty good for this (much better than the alternatives IMHO) - imagine something like VB but with a proper language underneath (like Delphi too, IMO . There''s little point doing something the long-winded way (Win32 API) or the utterly moronic way (MFC) or the not-too-well-known way (ATL) when there''s a fairly decent C++ RAD tool to use.

[/End of pointless post...]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Alimonster
Fair enuff, but I implore you: if you''re doing RAD in C++ then <u>use Borland C++ Builder</u> . Not MFC or Win32 API. If you try out Builder you''ll see it''s pretty good for this (much better than the alternatives IMHO) - imagine something like VB but with a proper language underneath (like Delphi too, IMO . There''s little point doing something the long-winded way (Win32 API) or the utterly moronic way (MFC) or the not-too-well-known way (ATL) when there''s a fairly decent C++ RAD tool to use.

[/End of pointless post...]


Agreed..BTW you can''t compare c++ to Delphi, but you can compare c++ to pascal. Builder rocks for win32 stuff!!!!

Share this post


Link to post
Share on other sites
I will give builder a go...
I remember a couple of years ago I had the free version of C++ Builder 3.0 which without knowing a single thing about C++ (didnt even know what a variable or anything was) managed to make a text editor and stuff, quite good, but I do remember there being stuff specific to is like Application.Terminate() and stuff... I am goind to do anything useful in it I need to know all that stuff...
I remember giving it up because I sent it to a mate who didnt have the runtimes... I dont want to cart big mofo runtimes around with me or expect people to dig around themselves for them, becuase they wont. Is there away to get them to link in with the project or something? any help would be greatfull...

CEO Plunder Studios

Share this post


Link to post
Share on other sites