Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Delphi vs. Visual C++

Posted on 1998-12-23
12
Medium Priority
?
427 Views
Last Modified: 2010-04-04
I need comparison between Delphi and Visual C++, which is the best
0
Comment
Question by:Motaz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1352710
look in previously asked question for information
0
 
LVL 7

Author Comment

by:Motaz
ID: 1352711
which question, ( Q number ) ?
0
 
LVL 7

Author Comment

by:Motaz
ID: 1352712
I need comparison here
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Expert Comment

by:Madshi
ID: 1352713
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);
            ppf->lpVtbl->Release(ppf);
        }
        psl->lpVtbl->Release(psl);
    }
    return hres;
}

Now my Delphi conversion:

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

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.
0
 
LVL 3

Expert Comment

by:Ronald Buster
ID: 1352714
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.

regards,

Cono
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1352715
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?
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1352716
Hey, Madshi, why don't you start answering questions 'cuz your politeness will get you no where...

Merry Christmas!

-Viktor
--Ivanov
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1352717
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.
0
 
LVL 7

Author Comment

by:Motaz
ID: 1352718
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.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1352719
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.
0
 
LVL 7

Author Comment

by:Motaz
ID: 1352720
I'm awaiting for more comments, but I'll accept your ansower, okay !

Motaz
members.wbs.net/homepages/a/z/z/azzoz.html
0
 
LVL 20

Accepted Solution

by:
Madshi earned 80 total points
ID: 1352721
Thank you, Motaz!

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

Regards, Madshi.
0

Featured Post

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question