Poll

Which API do you use?

C/C++
89 (22.2%)
Delphi
175 (43.6%)
Visual Basic
103 (25.7%)
other
34 (8.5%)

Total Members Voted: 395

Author Topic: Which API do you use?  (Read 71454 times)

RevG

  • Posts: 454
Re: Which API do you use?
« Reply #50 on: 10 Jun '03 - 18:47 »
One of the biggest factors that you should weigh before choosing a programming language is what type of user interface are you going to implement and how does the programming language you choose meet your ui needs.

I use MFC and I have a really slick design to implement. Unfortunately it is basically impossible to skin a listview or CListCtrl. The scrollbars are impossible to skin or hide so I have to create my own list control using the GDI, bitmaps, and an array. This will eat up a lot of my time to create this list, but I am too far in to turn back now.

Had I known these limitations of MFC I would have probably went with Delphi.

Just something to think about.
Greg

DanaPaul

  • Posts: 335
Re: Which API do you use?
« Reply #51 on: 11 Jun '03 - 04:38 »
Quote

Is it possible for someone to post an ASM code for displaying "Hello World!" in a message box?


Here's a variation that works in Delphi. Constants have been used to make it more readable...

function asmMsgBox(hWnd: DWord; lpCaption, lpText: PChar; uType: DWord): DWord;
 { REF: MessageBox(hWnd, lpText, lpCaption, uType); }
 asm  
   push uType
   push lpCaption
   push lpText
   push hWnd
   Call Windows.MessageBox
 end; { asm }

procedure TForm1.Button1Click(Sender: TObject);
 const uType = MB_TASKMODAL or MB_YESNO;
       pTitle = 'ASM Test' + #0;
       pMsg = 'Hello World!' + #0;
 begin
   if asmMsgBox(Application.Handle, pTitle, pMsg, uType) = IDNO then Abort;
   end;
« Last Edit: 11 Jun '03 - 05:20 by DanaPaul »

Torkell

  • Posts: 1169
Re: Which API do you use?
« Reply #52 on: 12 Jun '03 - 21:16 »
I'm guessing Seb meant something more like MASM (ms Macro ASseMbler) than inline assembler. I don't know where to get hold of MASM, but Steve Gibson's Small is Beautiful page might help.

DanaPaul

  • Posts: 335
Re: Which API do you use?
« Reply #53 on: 12 Jun '03 - 23:17 »

Quote

I'm guessing Seb meant something more like MASM (ms Macro ASseMbler) than inline assembler. I don't know where to get hold of MASM, but Steve Gibson's Small is Beautiful page might help.


Hmmm, ok, but MASM is a compiler that will accomodate the previous ASM example as well as its own syntax...


.data ; Section reference

szTitle db "ASM Test",0
szText db "Hello World!",0

.code ; Section reference

invoke MessageBox, 0, ADDR szText, ADDR szTitle, MB_YESNO
.if eax == IDNO
return 0
.endif

Luckie

  • Posts: 16
Re: Which API do you use?
« Reply #54 on: 10 Jul '03 - 03:55 »
All right here we go:
Quote

VB makes easy things easy while Delphi makes hard things easy.

And now all you people using VB, come and catch me. ;D

DanaPaul

  • Posts: 335
Re: Which API do you use?
« Reply #55 on: 10 Jul '03 - 06:25 »

Quote

VB makes easy things easy while Delphi makes hard things easy


Actually, VB is dumbed down so that any unsuspecting consumer, or entry level programmer, can slap together a poor imitation of a useful application.  VB's limitations are realized at the novice or entry level respectively.

DIM DanaPaul as String :)

Luckie

  • Posts: 16
Re: Which API do you use?
« Reply #56 on: 10 Jul '03 - 07:04 »
Code: [Select]

DIM DanaPaul as String

If you switch of the compiler restrictions even your line of code is not needed.  ;)

Urban

  • Posts: 5
Re: Which API do you use?
« Reply #57 on: 20 Jul '03 - 03:54 »
Did someone just select MASM for fun?

1 Percent - thats sad

Torkell

  • Posts: 1169
Re: Which API do you use?
« Reply #58 on: 25 Jul '03 - 09:54 »
Quote

Actually, VB is dumbed down so that any unsuspecting consumer, or entry level programmer, can slap together a poor imitation of a useful application.
VB's limitations are realized at the novice or entry level respectively.

I can't think of a single program that I've written in VC++ that I couldn't have done in VB.

Wait... I've thought of a couple. I could have done them in VB by putting together a little C++ DLL to encapsulate a couple of function in the CRT. VB's only limitations are the dependency on the runtime DLL, and the fact that it only copes with one type of function call (__cdecl, I think). You can actually produce smaller executables with VB by using P-code instead of native compilation, and they compile an awful lot faster at a small cost of running speed (but who cares with 2GHz P4s).

Recently I've been working on a program, and I decided to experiment with COM and polymorphism. After a couple of mistakes which were mainly my own, coding the classes has been very simple. I've spent a few days on it, and already there's more in it than the C++ version I was originally writing. There's one class that just defines an interface, but I could put code in that and use delegation. Two other classes implement it's interface, and there's not much code in them. What I've ended up with I could probably do in C++ (with a lot of work - COM's very nasty in C++), but it's a lot eaiser in VB as all the COM stuff is hidden behind a Set statement and the CreateObject function.

Code: [Select]

Dim Bloke As Person
Set Bloke = CreateObject("People.BoggyB")
Debug.Print Bloke.Age
Set Bloke = Nothing

Anyone care to give me the C++ variant for doing that, considering that People.BoggyB is in a separate DLL?

VB_Guy

  • Posts: 17
Re: Which API do you use?
« Reply #59 on: 2 Aug '03 - 00:27 »
I agree VB6 and older are dumbed down, and more or less useless for advanced functionality, but VB.NET totally turns the tables. It has the same abilities as C++, and C#, and the runtime is the same; the .NET framework.

So all you people raggin on VB, should take a look at the newest.

VB Guy

maxxnostra

  • Guest
Re: Which API do you use?
« Reply #60 on: 12 Aug '03 - 20:29 »
The best language to use is the one that will do the job for you in the manner that you like most and fits the purpose of creating that software.  ;)Some people prefer speed of the appicaton versus richness of functionallity, but no matter what you prefer the language you use is the tool that you decided to use to get your software done. In many cases VB has been proven as natural (BASIC human readable format and syntax) choice for beginers. During the years it has emerged to equal and in some cases better then what were considered the best languages (C family). Why do you think Microsoft choose VB(A) as integral langauage of all their software products (starting from Office, then advancing to ASP/VBScript, and now VB.NET). Because it was easy to learn and they knew that most people will accept expanding their bussines capabilities by using some kind of scripting in their applications. Like it or not Microsoft is a leader in the software industry. They have the only OS for PC that has adopted to each single desktop at home and at work, and their application and their OS is forcing BASIC style of scripting and programming.
Not to mention that if true .NET server (platform not framework) arises in the future, you may all forget about the fight of what language you are going to use, because they will all compile to JIT and they will all have the same speed and functionality because theay are just language that is spoken to develop the application , not the language that drives the application it self.
:)

scarnie

  • Posts: 1
Re: Which API do you use?
« Reply #61 on: 7 Sep '03 - 05:13 »
You can use C++ or C object code in Delphi.  Close enough, all you are doing is letting the C++ compiler generate the object code, and then including it in your Pascal unit.  

Cheers,

Stu
Quote


Definitely you can't include C++ code into delphi. You can include delphi units into C++ Builder, and you can use libraries or dll's (coded in C++ or whatever) in delphi. But you can NOT use C++ code in delphi.

:P

Jason

  • Guest
Re:Which API do you use?
« Reply #62 on: 10 Oct '03 - 16:10 »
I'm using a Microslop J/Direct wrapper around the C/C++ API so I can use BASS from VJ++ 6.0!  Muahahahahaha...

Derek Wildstar

  • Posts: 29
Re: Which API do you use?
« Reply #63 on: 2 Nov '03 - 13:46 »
I use VB but I agree that Delphi will win. Probably because it bridges the gap between cryptic C/++ and user friendly VB.

1. You can cleanly Multithread in Delphi. In VB you end up with a big headache and lots of GPFs.

2. Microsoft has chosen to go the wrong way with VB.NET which now seems more suited to programming business Apps (no more general purpose programming).

3. Of course C/++ is the king of them all but I shudder when I think of the learning curve!

I am seriously considering a move to Delphi and C++. Then I'll only be using VB6 for rapid prototyping at the concept stage.

Rgds.

I 100% confirm your words and i would like to suggest: DELPHI, DELPHI and DELPHI!!

This is THE language!

See it (my project)
http://www.wildstarcorp.kit.net/scr.html

Aux

  • Posts: 91
Re:Which API do you use?
« Reply #64 on: 12 Nov '03 - 18:15 »
About maxxnostra's post - even without JIT nowadays EVERY program compiles (but not BASIC) into ASSEMMBLY language. It is the same for ALL of 8086 PCs!!! Just like JIT will be for ALL PCs in the world (like MS think). Nowadays there's nothing impossible with pascal (delphi) or C - good optimizer will build good code. It all depend on COMPILER not on a language! Am I wrong somewhere?

shadow

  • Posts: 11
Re:Which API do you use?
« Reply #65 on: 2 Dec '03 - 23:49 »
 ;D
Of course I use C/C++.

Antony

  • Posts: 4
Re:Which API do you use?
« Reply #66 on: 3 Dec '03 - 02:54 »
Yep, another C++ here 2  :D

da18

  • Guest
Re:Which API do you use?
« Reply #67 on: 4 Dec '03 - 14:31 »
The Vb is too pretty good!

shadow

  • Posts: 11
Re:Which API do you use?
« Reply #68 on: 4 Dec '03 - 22:09 »
About BoggyB's Challenge...
Quote
...since C/C++ is (I think) the most common programming language, and VB is second as it's so easy to start programming with. To prove that, I will set this challenge:

Make a program with a button which pops up a message box that says "Hello World" with just three lines of code!

I seriously doubt that anybody will be able to do that in C/C++, or most other languages for that matter. But in VB, it's easy. Create a new project, add a command button to the form (accept all defaults), and paste in the following code:

Private Sub Command1_Click()
MsgBox "Hello World!"
End Sub


Volia! Compile, and execute, and you be amazed at what you can do with 3 lines of code!

Maybe I should stop bragging about VB now...

Maybe BoggyB Hasn't seen C++ Builder.  Just one line of code and its c++!

void __fastcall OnButton1Click(TObject, Sender)
{
   Application->MessageBoxA("Hello World!","Hello",MB_OK);
//The line above this one is the only one you code

}

C/C++ can be very low level or very high level.

As a matter of fact, the Windows API and the DirectX API(BASS is a high level wrapper for DirectSound) are
C functions.  And judging  the structure of BASS itself it seems to be coded in C++.

I could be wrong.  But this is one of the most powerful languages out there and it has withstood the test of time.

By the way, those strange looking parameters in the event handler prototype are JUST a hint at it's immense power.

Also, this code uses the VCL framework which is the exact same framework that Delphi uses.(Object Pascal).

What a joy it is to have these modern day tools!!! ;)

And as far as JIT...

Assembly and C were around long before Microsoft and aren't  going anywhere anytime soon...  as far as their original purpose that is because there will always be a need for a SYSTEM level language.

I dug up some  C code I wrote for an Atari 65XE 8 bit computer about 17 years ago, typed it back in, compiled it to the ANSI standard, and lo and behold, 17 years later that same code runs on a 80786 class computer in Windows and Linux.  Very portable indeed!!!
« Last Edit: 5 Dec '03 - 01:31 by shadow »

Pablo

  • Guest
Re:Which API do you use?
« Reply #69 on: 22 Dec '03 - 17:10 »
I programming in delphi. It's my favourite develop software. I programming also in C++ and VB, but delphi is the best.


Werdok

  • Posts: 4
Re: Which API do you use?
« Reply #70 on: 29 Feb '04 - 11:18 »
Quote
You can actually produce smaller executables with VB by using P-code instead of native compilation, and they compile an awful lot faster at a small cost of running speed (but who cares with 2GHz P4s).

   When it comes up to software mixing and 3D VB is smoking nervously outside. For reasons of efficiency Impulse Tracker eas written in ASM completely (ooh, God!) modplug bunch of software in VC++ (or so). Plus ASM code was encapsulated where the compiler really sucked.
    Still I find VB quite handy for little office apps. When performance is not of your main concern VB works just fine.

Atilla

  • Posts: 26
Re:Which API do you use?
« Reply #71 on: 14 Mar '04 - 00:18 »
SOmebody said somewhere that VB was user-friendly ... Now i don't want to criticise opinions or something but .... VB User Friendly ?!?! Come on - give us a brake. I am actually amazed how amnny wannabe programmers (I exclude the people from this forum) can actually get how to do things with this.

Now C++ holds amazing power, by allowing you to do anything - something thet people from Software engeneering do not like.

The again i've always preffered Delphi, though recently it's become easier for me to develop in C++, cause i use lots of classess and inheritance etc.. However Delphi has things that make life easier and stuff like interfaces and good exeption handling, very simmilar to JAVA. If you strip off the RAD functionality it still remains an amazingly good choice. If you stick to the coding conventions you can produce a masterpiece that you can READ out in natural language.

Only an opinion though :+)

Of course if you consider yourself more a machine than human you can always go ahead of every1 and use ASM :+)
« Last Edit: 14 Mar '04 - 00:20 by Atilla »

Torkell

  • Posts: 1169
Re:Which API do you use?
« Reply #72 on: 15 Apr '04 - 20:22 »
About BoggyB's Challenge...
Quote
...since C/C++ is (I think) the most common programming language, and VB is second as it's so easy to start programming with. To prove that, I will set this challenge:

Make a program with a button which pops up a message box that says "Hello World" with just three lines of code!

Private Sub Command1_Click()
MsgBox "Hello World!"
End Sub

Volia! Compile, and execute, and you be amazed at what you can do with 3 lines of code!

Maybe I should stop bragging about VB now...

Maybe BoggyB Hasn't seen C++ Builder.  Just one line of code and its c++!

void __fastcall OnButton1Click(TObject, Sender)
{
   Application->MessageBoxA("Hello World!","Hello",MB_OK);
//The line above this one is the only one you code
}
That actually beats mine, as the curly braces can be on the same line as the function call! I assume it defines everything for you, much like the way the VB runtime is always referenced? In VC++ you'd need to either include windows.h or create your own definition.
Quote
As a matter of fact, the Windows API and the DirectX API(BASS is a high level wrapper for DirectSound) are C functions.  And judging  the structure of BASS itself it seems to be coded in C++.
With DirectX 7 and 8, M$ did VB classes (COM objects that used native VB datatypes and were designed to be used from VB). This was dropped in DirectX 9 (IIRC), and replaced with .NET versions.
Quote
By the way, those strange looking parameters in the event handler prototype are JUST a hint at it's immense power.
In VB you can get away with defining variable types - in fact, if you remove the Option Explicit statement you only have to define arrays (unless of course you use the Array() function - VB is wonderful for quick 'n' dirty programming!)
 I've yet to see anyone post anything about the other sorta challenge (involving inheritance and polymorphism). As far as I know it isn't possible to do that in C++ in as few lines (again, this is using COM). Still, someone may once again prove me wrong... ;D

bigjim

  • Posts: 232
Re:Which API do you use?
« Reply #73 on: 19 Apr '04 - 07:44 »
I've yet to see anyone post anything about the other sorta challenge (involving inheritance and polymorphism). As far as I know it isn't possible to do that in C++ in as few lines (again, this is using COM). Still, someone may once again prove me wrong... ;D

^^Dont tempt me im too busy ;D

CodeMonkey

  • Posts: 12
Re:Which API do you use?
« Reply #74 on: 29 Apr '04 - 17:56 »
I currently use C++ only because there is no .NET native version.  Once there is, I will be using C++ and C#.
« Last Edit: 29 Apr '04 - 17:57 by CodeMonkey »