Scientific Programming: C, C++ & Mathematica Explored

Click For Summary

Discussion Overview

The discussion revolves around the value and application of programming languages C, C++, and Mathematica in scientific programming, particularly from the perspective of an undergraduate student in Pure Mathematics. Participants explore the strengths and weaknesses of these languages in various contexts, including numerical evaluation and performance in computational tasks.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Conceptual clarification

Main Points Raised

  • One participant expresses curiosity about the utility of C and C++ compared to Mathematica, suggesting that Mathematica seems superior for mathematical evaluations.
  • Another participant emphasizes the importance of learning a programming language, noting that there are scenarios where Mathematica may not suffice, and having custom code allows for adjustments and optimizations.
  • A different participant points out that in contexts like massively parallel programming, C and C++ are preferred due to their speed, especially on supercomputers.
  • One participant mentions that while C and C++ are widely used in the real world, they suggest considering Python for its numerical and symbolic capabilities, highlighting its free availability.
  • Another participant reflects on the historical context of using C, noting the ability to embed assembler for performance improvements, and mentions a shift towards C++ in recent years despite potential overheads.

Areas of Agreement / Disagreement

Participants generally agree on the relevance of C and C++ in scientific programming, particularly for performance-critical applications. However, there are competing views regarding the relative merits of Mathematica and Python, and the discussion remains unresolved regarding the best choice of language for different scenarios.

Contextual Notes

Some participants reference specific applications and performance considerations without providing detailed comparisons or definitions, leaving certain assumptions and contexts implicit.

Barioth
Messages
47
Reaction score
0
Hi everyone, as an undergrad in Pure math I have to take two classes of C and C++ programing.


I also have to take a mathematica class. I really donMt mind because I love programing and I'll probably get more class like this. But I'm wondering what good is C and C++ when one can use mathematica witch seem to be better at evaluating mathematical and numerical stuff.


What do you think?

Thanks for passing by!
 
Technology news on Phys.org
Re: Scientific Programing

To me it is very important to study a programming language . Sometimes you need to evaluate things that Mathematica can't or computation time exceeded. If you have your own code then you can adjust it the way you want and improve it as much as you can. For example ,you can easily implement series and evaluate an approximated value.
 
Re: Scientific Programing

As a note: in some situations, such as massively parallel programming, C and C++ are the only languages used, because they run much faster than Mathematica or anything else. C and C++ are typically the tool of choice on a super-computer. Anything you can do on a computer, you can do in C++. It's not always the best tool, but often it is.
 
Re: Scientific Programing

That make a lot of sense!

Thanks!
 
Re: Scientific Programing

In the real world it's not all math or mathematica.
A programming language like C/C++ is used a lot however.
 
Re: Scientific Programing

I like Serena said:
In the real world it's not all math or mathematica.
A programming language like C/C++ is used a lot however.

Maybe you should consider Python, it has extensions to give it the numerical power of Matlab (numpy, scipy and matplotlib), and to give it symbolic capability (sympy) while still being a GP scripting language. Also it is free ...

.
 
I may be dating myself (think 2 decades ago), but one thing I liked about C was the ability to embed assembler in the code for bottlenecks. But, this was in the days when memory was at a premium. (Happy)
 
MarkFL said:
I may be dating myself (think 2 decades ago), but one thing I liked about C was the ability to embed assembler in the code for bottlenecks. But, this was in the days when memory was at a premium. (Happy)

Ten years ago we wrote DSP code in plain C, today the default seems to be C++ (when we aren't using domain specific tools) despite the overheads.

.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 31 ·
2
Replies
31
Views
3K
  • · Replies 17 ·
Replies
17
Views
5K
  • · Replies 21 ·
Replies
21
Views
4K
Replies
3
Views
4K
  • · Replies 29 ·
Replies
29
Views
8K
  • · Replies 26 ·
Replies
26
Views
5K