What computer science class should I take for my math degree? C or C++?

Click For Summary
SUMMARY

The discussion centers on the choice between introductory courses in C and C++ for students pursuing a math degree. Participants argue that C is simpler and more suitable for beginners, particularly for those with a math background, while others advocate for C++ due to its object-oriented programming (OOP) features. The consensus suggests that if only one course is to be taken, students should consider MATLAB or C++, but if two courses are feasible, starting with C and then progressing to C++ is advisable. Ultimately, the effectiveness of either course hinges on the syllabus and the specific topics covered.

PREREQUISITES
  • Basic understanding of programming concepts
  • Familiarity with object-oriented programming (OOP)
  • Knowledge of data structures and algorithms
  • Awareness of MATLAB as a programming tool
NEXT STEPS
  • Research the syllabus for introductory C and C++ courses
  • Explore MATLAB programming fundamentals
  • Learn about data structures and algorithms in a computer science context
  • Investigate the differences between procedural programming (C) and object-oriented programming (C++)
USEFUL FOR

Students pursuing a math degree, educators advising on computer science courses, and anyone interested in understanding the foundational differences between C and C++ programming languages.

  • #31
AlephZero said:
It never became one. it was one, right from day one. It was designed as something "better than assembler code", for writing system software and operating systems. For scientific computing, it isn't even as high level as Fortran IV.

C still meets the definition of a high level language, does it not? Or am I just totally lost here.
 
Physics news on Phys.org
  • #32
The whole notion of high level and low level languages are relative.

Its a matter of opinion but and I hate quoting a wiki page but even the wiki page on "high level language" has

"The terms high-level and low-level are inherently relative. Some decades ago, the C language, and similar languages, were most often considered "high-level", as it supported concepts such as expression evaluation, parameterised recursive functions, and data types and structures, while assembly language was considered "low-level". Today, many programmers might refer to C as low-level, as it lacks a large runtime-system (no garbage collection, etc.), basically supports only scalar operations, and provides direct memory addressing. It, therefore, readily blends with assembly language and the machine level of CPUs and microcontrollers."

which has stood unedited despite the high visibility of a page for such a simple term which would make it susceptible to correction if it was a controversial statement.

High level language is a term not a mathematical theorem which means its only defined by humans and their majority opinion of the term.
 
  • #33
I agree with Student100; the level is calculated by it's level of abstraction and in that sense, C and C++ are not low level. Fully relative comparison lacks in accuracy.
 
  • #34
Crager,

The underlying implication here is what you want to do with the course, and if that's take it, ace it, and forget it, it doesn't really matter.

At the level of learning basic high level programming syntax the choice between C and C++ is superficial. You probably won't be exposed to the situations that emphasize the advantages of using one over the other. For simple, procedural programming, the syntax is mostly the same, barring some compiler overhead you won't get into until data structures anyway.

As someone who completed an Applied Mathematics degree and now works as a Software Engineer I advise choosing the class that gives the broadest focus in the subject. Choose the class that, while emphasizing procedural programming, exposes the student to binary math, basic data structures, basic memory management, and introductory search/sort algorithms. You won't learn the conceptual knowledge you need for awareness or debugging if the C++ class emphasizes Object-O over the aforementioned subjects. If the choice is purely between compiler extension (C or C++), I'd choose C. Less bloated code == greater awareness.

And for anyone who wants to learn more about programming and the extent of their technical knowledge ends with Ctrl-Alt-Del I'd recommend looking into the aforementioned content, and focus on a strongly-typed, compiled language like C first, move into a Object-O scripting language like Python next, spend some time on Data structures, and then consult texts on assembly or systems specific (API's for Linux/Unix/GNU, Cocoa, or Android) after getting your feet wet first.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 32 ·
2
Replies
32
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 21 ·
Replies
21
Views
4K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 7 ·
Replies
7
Views
996
  • · Replies 4 ·
Replies
4
Views
746