?
Solved

Delphi vs. Visual C++

Posted on 1998-12-23
12
Medium Priority
?
423 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month15 days, 9 hours left to enroll

741 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