![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2005
Posts: 1
Rep Power: 0
![]() |
A Question?!
Hi,
Iam a beginner C++ programmer and I would like to ask about some things: Does C++ support Graphical User Interfaces? Does C++ support programming of scientific applications, e.g., equation manipulation, equation graphing and other science-related application programs? and the two above questions for Python also. If not, can you inform me about languages that are dedicated to scientific programming. thanks... |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,221
Rep Power: 5
![]() |
GUI is beyond the scope of the C++ standard. However, by making use of third party librarys one can do GUI in C++. In practice, depending on what system you want to target, there are usually several choices of library.
You need to be more specific on what you mean by "scientific applications". C++ is a general purpose language, so can be used for most things --- subject to what you want to do being supported by the C++ library or by third party libraries. If you are referring to numerical analysis (eg solving differential equations, matrix manipulation), then C++ can be used. If you are referring to being able to do graphical work (eg display a plot or a 3D plot of a surface), then you are into the domain of third-party libraries (eg if you want to draw a curve on a screen, you probably want some form of GUI support). Being a language that supports object oriented programming (but doesn't force you to do things in an OO manner), it is possible to use C++ for writing significant models or simulations [and, in fact, I have done so]. On Python, I don't know. As to other languages, Fortran is designed from the ground up to support numerical analysis. Some would argue that Fortran 77 does that better than later versions of Fortran (later versions of Fortran include support for techniques that modern computer scientists advocate, but really don't help much with serious numerical analysis). Matlab is designed around scientific work and also supports reasonably sophisticated graphics to render graphs and surfaces (and print those things). Matlab is primarily an interpreted language (which implies some trade-offs related to run time speed), but is heavily optimised around equation manipulation, matrix manipulation, etc etc. The catch with Matlab is that it is proprietary (you have to pay for a licence to use it, and it is not cheap), but it is also somewhat easier to put together significant programs pretty quickly. There are some free systems that emulate matlab out there, but they tend to be less efficient and have less comprehensive functionality than Matlab. [Interestingly enough, a large percentage of the Matlab environment is written in C, so it is a good example of what one can do in C or C++ with the right techniques and use of proprietary libraries]. If you're into symbolic logic (which requires a specific type of scientific application), there are languages (and associated environments) such as Maple. |
|
|
|
|
|
#3 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Of course C++ and Python do. It's the same with almost any language you could care to think of. You just have to write functions to do it. Failing that, you can simply find ones that have already been written on the Internet. For example, if you want to create GUIs, you can use libraries such as GTK+, Qt or wxWindows for cross-platform coding, or the standard Win32 API for Windows, Cocoa for Mac, X11 for Unix (including Mac OS X), etc.
|
|
|
|
|
|
#4 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
With regards to Python, I'd consider it a far better choice than C++ for scientific work (and far, far easier to learn), though not as good as Matlab for mathematical and graphing work. Python is, however, more flexible than Matlab, which may be useful if you wish to create more complex programs. Python also has the advantage of being free to use. As Grumpy pointed out, many languages use libraries to provide functions and frameworks used for GUI design, or for plotting graphs. Python has a not insignificant following in the scientific community, and thus there are a number of python libraries that could be of use to you. Here's a few of them: Python also supports several GUI systems, including GTK, TK, QT and wxWindows. If it's a straight choice between C++ and Python for scientific work, I'd advise going with Python. It's easier to learn, and has a fair few graphing and mathematical libraries. If you want speed, then C++ may be more your thing. It'll take longer to program in, but you'll get a faster program out in the end. It's debatable whether this speed increase is worth the extra work involved, however, and there are quite a few Python based programs that have no notable speed problems. The official Bittorrent client, for instance, is programmed in Python. |
|
|
|
|
|
|
#5 |
|
Programming Guru
![]() Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5
![]() |
c++ can support "taking a dump in the woods" if you write the code for it. if you're asking about libraries that others have written i'm not sure. from these other guys it sounds like there are python libraries for it, i don't know the STL very well, so i couldn't comment on this specifically. i'm not exactly sure what you're trying to do, but the SIMPLE answer is--->yes, C++ can do anything. can it do anything EASILY is something for you to find out.
__________________
i put on my robe and wizard hat... Have you ever heard of Plato, Aristotle, Socrates?...Morons. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|