![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2006
Posts: 19
Rep Power: 0
![]() |
C++ vs Visual C++
I have a quick question, sorry if it's in the wrong area, but it's important to me. Is there a difference between visual c++ and c++? Is the language the same w/ both? Can you create non-windows only programs w/ visual c++? Tanks, I was just wondering since I'm going to be learning it soon, and wanted to use the right one since I'm not creating just for windows.
|
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,206
Rep Power: 5
![]() |
C++ is a programming language. Visual C++ (VC++ for short) is a development environment supplied by Microsoft that supports development of programs targeting windows platforms. One aspect of VC++ is the a set of tools that the user interacts with (eg the user interface for editing and compiling projects) and other aspects include a C++ compiler (invoked behind the scenes by the user tools) which translates C++ source files into object files, and a linker which assembles object files and libraries into executable files.
Depending on how they bundle it, VC++ may also be sold as part of Dev Studio (which is an integrated environment supporting development in multiple programming languages). VC++ is not 100% compliant with the C++ standard, particularly if you're using older versions (recent versions have improved a lot in that regard). If you're using VC++ version 6 or earlier, there are some features of C++ which are poorly supported (at the time those versions were released, Microsoft did that quite deliberately). With version 7, the compliance has improved as a result of a strategic decision by Microsoft to embrace standard compliance; there are some parts of standard C++ that are not supported, but the majority of C++ programs (in the sense of compliance with the C++ standard) will be handled correctly by recent versions of VC++. VC++ also supports vendor specific (i.e. Microsoft specific) extensions (both language features and libraries) that will only work developing applications for windows operating systems. That practice is hardly unique: most compiler vendors supply some vendor specific features. In practice, if you are creating programs with a windows GUI using VC++, you will find yourself using some Microsoft-specific extensions (standard C++ includes no features at all related to GUI). VC++ has options to produce console mode applications (which essentially means a program that can run from the command line under windows, without a GUI). In practice, if you intend to do development for multiple operating systems (eg windows, linux, solaris, etc etc), you will need a compiler and (potentially) a development environment for each platform. Very few people will use only one compiler for every platform they target - although there are some compilers that support multiple platforms, they do that with a series of trade-offs. There will be some things you can do portably using standard C++ (assuming you have a compiler on all target platforms). If you are doing things that fall outside the scope of the C++ standard (eg GUI, database, multithreading, multiprocess, directory listings, the list goes on) you will often need to write code that uses libraries and/or compiler extensions that are system specific and you will need to make trade-offs (eg not use all features offered by windows GUI because there is no equivalent on another platform). That is true whether you write the code for each platform yourself or you employ a multi-platform development feramework. |
|
|
|
|
|
#3 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
I have some answers to those C++ portability woes:
GUI- wxWidgets multithreading- Boost.Threads multiprocess- Boost.Interprocess (Currently only in the CVS version) directory listings- Boost.Filesystem IDE/Environment- Code::Blocks work for Windows and Linux (Mac in progress) with multiple compilers (even the Visual studio ones). See the Boost libraries and wxWidgets for more information. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,206
Rep Power: 5
![]() |
I would describe your "answers" as "options", Game_Ender.
wxWidgets is good, but involves a lot of trade-offs by design. Those trade-offs suit a good range of applications, but would be prohibitive for others. Similar story for Code::Blocks. Code::Blocks is developmental and will need to stabilise more before being adopted for critical applications (by critical applications, I mean ones in which the behaviour of specific configurations of both development environment and compiler need to be formally verified before programs produced using them can be formally verified as correct). Boost is experimental, and is being used to prototype options for potential inclusion in a future version of the C++ standard. Not to mention that windows/linux/mac are not the only operating systems out there. Those of us who have been around for a while have seen a lot of hype on various solutions (the "latest and greatest", "universal solution to all programmer needs", etc etc). Invariably, there is considerable enthusiasm as people follow the latest hype. Later, there is almost a collective sigh as people realises the latest hype is just hype, and then another rush of enthusiasm as the next hyped up solution appears...... Some of those hyped up solutions are really good for some niche areas. Some mature into something worthwhile. Others form a solid foundation for something better to be developed. A lot fail but, in failing, set the scene for something better to be developed. A lot fail simply because they never live up to the promises made. |
|
|
|
|
|
#5 | ||
|
Hobbyist Programmer
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 239
Rep Power: 3
![]() |
Quote:
![]() Quote:
Things will get a lot more complicated what you decide to write applications with a User Interface. Different systems have different features, and because of that they have a different manner of programming their UI elements. There are some multi-platform options, like Qt or the ones Game_Ender mentioned, but, as grumpy said, there are some tradeoffs. My advice: Learn good the standard C++ first, and then, learn the tools and programmng environment that will help you develop applications for the easiest accessible platform from you. For example, if I wanted to develop applications that would be for Windows, Mac and Linux, I would firstly try to develop my application in VC++ using as much portable code as I could. Then, I would see if I could do this in the other platforms.
__________________
Project::Soulstorm (personal homepage) |
||
|
|
|
|
|
#6 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#7 |
|
Professional Programmer
![]() Join Date: Sep 2005
Posts: 419
Rep Power: 3
![]() |
>It is a developer's right to dream and hope, isn't it?
Dream all you want, but don't let it blind you. Developers (good ones) are paid to think. If you muddy your thoughts with biases and propaganda, you hurt your reason for employment.
__________________
Even if the voices aren't real, they have some pretty good ideas. |
|
|
|
|
|
#8 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
I probably should of included all the caveats Grumpy mention in his post, but I felt like he just listed the problems of creating a cross platform C++ code.
For a beginner Code::Blocks is a great IDE (despite being in perpetual Beta) but I don't think IDE project files should ever be the sole build system of a project. I think it would be best to try and maintain a CMake or autotools + make build system as well. Using it just means that when you move code to another platform you don't have to learn another tool to develop in (like you would with the use VC++ first approach). Calling Boost "expirmental" is a little harsh, because it implies the libraries are ready to be used in serious applications. Most are well tested, maintained, and there possible inclusion for the standard library (and there inclusion in the already release std::tr1) is a very good reason to be using them. I hope I wasn't spreading hype, although I probably shouldn't try not to come off as a fan boy for Boost/wxWidgets/Code::Blocks. |
|
|
|
|
|
#9 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,206
Rep Power: 5
![]() |
Quote:
When evaluating libraries for real usage it is necessary to acknowledge both strengths and weaknesses of those libraries. One of the underpinnings of boost is peer review: in other words, it is expected that people will evaluate the offerings with a critical eye. To a lot of people, that seems harsh. My comments may seem harsh to you but, again, you strike me as a low-level zealot. One of the strengths of boost, IMHO, is that they welcome critical review; authors of quite a few of the boost libraries would take my comments more in stride that you have. |
|
|
|
|
|
|
#10 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
For a beginner its just good to be aware that there these cross platform libraries to do more advanced and OS specific things you wish do as you learn more. You don't necessarily need to invest time learning the POSIX, Win32 or Carbon APIs if you want to make more advanced programs. Since windows is a major platform many if not all of cross platform libraries will let you develop with them in Visual C++.
<offtopic> I agree completely with the library evaluation issue and I can have a little to much of that zealousness, but I will blame that on youthful arrogance (which I can I have too much of). To me experimental = alpha software that is fragile and not for use in anything beyond toy projects. I was under the impression that the Boost review process doesn't not allow alpha quality libraries in. Almost all free software licenses (and quite a few proprietary ones) do not offer a warranty or guarantee that the software will do anything or be fit for any purpose. Boost's faq just goes out of its way to state that because they are associated with the C++ standards community and people might think otherwise. In then end if you need some level of assurance I suspect the people at Boost Consulting will be happy to handle any issues you run into. </offtopic> |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compiling Maverik 6.2 (from C) | megamind5005 | C | 16 | May 3rd, 2006 5:41 PM |
| Going Visual..? | hbe02 | C++ | 6 | Mar 20th, 2006 4:33 PM |
| Visual Studio vs Visual C++ | NightShade01 | C++ | 14 | Feb 26th, 2006 9:39 AM |
| visual c++ and .net | tribaldog | C++ | 7 | May 6th, 2005 12:52 PM |