Valhalla Legends Forums Archive | C/C++ Programming | Why is it so "heavy"?

AuthorMessageTime
Networks
Lot's of people say C++ is a language that takes long to code simple applications (ie: Calculator). Why is this? I don't understand why it would take so long. If someone could please clear this up thank you, it's something that's been troubling my mind for quite some time.
July 12, 2005, 2:38 PM
Dyndrilliac
It depends on if you want it to be programmed well or not so well depending on how fast you want it. C++ gives the programmer more control by forcing him/her to dictate everything the Application does. Simpler languages like VB do most of these tasks (I.E., handling threads/memory allocation) automatically. That's why VB is RAD, and C++ is not. VB and languages like it are meant for the rapid creation of programs. This is most useful in an office setting. C++ is designed to create planned precise programs that have been pre-designed.

C++ does have ways though that this can be overcome to a degree. One of it's more  redeeming features in the aspect of rapid program creation is it's extensive OOP capabilities (reusing pieces of old programs in new programs). Also, you can easily make a reusable application skeleton to speed up the process.
July 12, 2005, 3:03 PM
Networks
The only extra thing I see are prototypes for functions. Is the GUI stuff not as RAD like BASIC languages such as Visual Basic. It all seems like any other language I've studied.
July 13, 2005, 2:32 PM
LoRd
One of the most important things you need to learn in life is that when listening to the public, keep one ear open and the other closed--you have to leave enough room to form your own thoughts and opinions.  You'd be surprised at the number of people who have yet to learn this.
July 13, 2005, 11:13 PM
K
[quote author=Networks link=topic=12185.msg120495#msg120495 date=1121265137]
The only extra thing I see are prototypes for functions. Is the GUI stuff not as RAD like BASIC languages such as Visual Basic. It all seems like any other language I've studied.

[/quote]

Technically, there is no C++ "GUI stuff," which is probably the major reason people have been telling you it's heavy.  You have to use whatever platform you're programming for's native GUI creation functions or some wrapper, like MFC, WTL, WxWindows, Qt, etc. This isn't a big deal if you don't need much of a GUI.  I think a console interface works just fine.
July 14, 2005, 12:14 AM
St0rm.iD
Memory management, and (if you're like me and a dirty python user), static typing.
July 14, 2005, 4:12 AM
Networks
There are a lot of inner functions in C++ like connect(), or some more. Where can I find more of these? I am sure a lot of them would help in the future. Or you can all just provide some of the important ones.

Also, I am guessing if you encoporate windows API it wouldn't be portable for platforms like Linux? So would the library for WSAData not be portable for a Linux platform? I'd like any information on how to make things completely portable between platforms.

Also, Any good tips to know when learning C++, anything you guys didn't know when you were starting that could've helped out, anything!?
July 14, 2005, 2:27 PM
Mephisto
You can't in a direct sense port Win32 API to Linux.  You'd have to use API's in for Linux which often means changing a lot of your code and your control routines.

For anything on the Win32 API MSDN is your friend.  Often times you can just type the name of the function and it will bring up the document you seek.  If it's a common name for a function (like connect) then just add MSDN in your search.
July 14, 2005, 2:42 PM
Myndfyr
[quote author=Networks link=topic=12185.msg120676#msg120676 date=1121351252]
There are a lot of inner functions in C++ like connect(), or some more. Where can I find more of these? I am sure a lot of them would help in the future. Or you can all just provide some of the important ones.

Also, I am guessing if you encoporate windows API it wouldn't be portable for platforms like Linux? So would the library for WSAData not be portable for a Linux platform? I'd like any information on how to make things completely portable between platforms.

Also, Any good tips to know when learning C++, anything you guys didn't know when you were starting that could've helped out, anything!?
[/quote]

We've talked about wxWidgets here before.  It's designed to be a GUI library that is cross-platform (source code) compatible; it's roughly similar in design and architecture to MFC.  Writing code for wxWidgets should let you be cross-platform compatible, provided you don't make your own calls to the Win32 API.  And yes, wxWidgets has a socket class.

Something else you might consider is your design environment.  For Linux you might define (in your build options) constants like LINUX, KDE, or GNOME, whereas in Windows you might define WIN32.  Then you would do something like:
[code]
#if defined(WIN32)
  doSomethingInWindowsOnly();
#endif
#if defined(LINUX)
  doSomethingInNixOnly();
#endif
[/code]
July 14, 2005, 8:16 PM

Search