• Welcome to Valhalla Legends Archive.
 

Why is it so "heavy"?

Started by Networks, July 12, 2005, 09:38 AM

Previous topic - Next topic

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.

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.
Quote from: Edsger W. DijkstraIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

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.

Eric

#3
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.

K

Quote from: Networks on July 13, 2005, 09:32 AM
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.


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.

Banana fanna fo fanna

Memory management, and (if you're like me and a dirty python user), static typing.

Networks

#6
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!?

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.

MyndFyre

Quote from: Networks on July 14, 2005, 09:27 AM
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!?

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:

#if defined(WIN32)
   doSomethingInWindowsOnly();
#endif
#if defined(LINUX)
   doSomethingInNixOnly();
#endif
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.