Delphi vs. Visual C++

I need comparison between Delphi and Visual C++, which is the best
Who is Participating?
Thank you, Motaz!

You should wait some days with accepting the answer. So perhaps you'll get some new comments...

Regards, Madshi.
look in previously asked question for information
MotazAuthor Commented:
which question, ( Q number ) ?
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

MotazAuthor Commented:
I need comparison here
Ok, let's do it again...

IMHO Delphi is much better for real win32 application designing/writing. Some facts:
- Delphi's strings handling is much better (better syntax and automatic allocation/deallocation)
- Delphi's COM implementation (version 3 or higher) is much better (automatic release and all that stuff)
- Dynamical arrays (version 4; automatic allocation/deallocation)
- Compiler is 1000000000000000000000 (ok, almost :-) times faster

There are probably other advantages that I do not use (databases and such stuff).

But if you want to write very small graphical applications (<30 KB) or even drivers, C++ is the better choice.
Also, if you need cross-platform code, C++ is probably better, because in C++ all the object stuff is ANSI standardized, while Delphi's object extensions to pascal are Inprise-specific.

Program speed/optimzation is equal between C++ and Delphi.

Perhaps a little source example (It's not the first time, I'm posting it in a discussion like this...):

Here's an original C++ Microsoft example about how to create a shell link:

HRESULT CreateLink(LPCSTR lpszPathObj, LPSTR lpszPathLink, LPSTR lpszDesc)
    HRESULT hres;
    IShellLink* psl;
    hres = CoCreateInstance(&CLSID_ShellLink, NULL,
        CLSCTX_INPROC_SERVER, &IID_IShellLink, &psl);
    if (SUCCEEDED(hres)) {
        IPersistFile* ppf;
        psl->lpVtbl->SetPath(psl, lpszPathObj);
        psl->lpVtbl->SetDescription(psl, lpszDesc);
        hres = psl->lpVtbl->QueryInterface(psl, &IID_IPersistFile, &ppf);
        if (SUCCEEDED(hres)) {
            WORD wsz[MAX_PATH];
            MultiByteToWideChar(CP_ACP, 0, lpszPathLink, -1,
                wsz, MAX_PATH);
            hres = ppf->lpVtbl->Save(ppf, wsz, TRUE);
    return hres;

Now my Delphi conversion:

function CreateLink(pathObj, pathLink, desc: string) : HRESULT;
var sl : IShellLink;
  sl:=CreateComObject(CLSID_ShellLink) as IShellLink;
  result:=(sl as IPersistFile).Save(PWideChar(wideString(pathLink)),true);

Note these 3 facts:
(1) Delphi converts the string from ansi to multiByte for me.
(2) Delphi calls QueryInterface for me.
(3) Delphi releases the COM objects for me.

Regards, Madshi.
Ronald BusterOwnerCommented:
You need a comparison why ?

Delphi has a better native compiler than visual C hence I even work sometimes with visual C/C++ and I find working with Delphi is far more easier than doing the same thing with
Visual C. However there are some benefits handling and creating com objects in visual c is some way better then in Delphi.

So it depends what you want to do, if I could give some advise I would prefer Delphi.


So cono, why should handling of COM objects be better in C++ than in Delphi? Have you looked at my comment before answering the question?
Hey, Madshi, why don't you start answering questions 'cuz your politeness will get you no where...

Merry Christmas!

You're right, Viktor...   :-(

There's a German song which sounds like "You have to be a pig on this world (if you want to be successful)".   :-)

I thought about answering this question. But it's only 20 points, so I can live without that...

Merry Christmas!

Regards, Madshi.
MotazAuthor Commented:
Hi cono, I neet this comparison because here in Sudan university we study Visual C++, but I and some of my friends decide to write our projects by Delphi (  we study computer system and information technology in Sudan uni. Last year )

Thanks Madshi for your nice comment. I'll increase the points, but points is not all the matter, help people is the important.
Hi Motaz, you're right. Points are not so important, just a little bit motivation...

Hmm. I'm not sure. Are you satisfied with my comment? Do you want me to answer the question or are you waiting for more comments?

Regards, Madshi.
MotazAuthor Commented:
I'm awaiting for more comments, but I'll accept your ansower, okay !

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.