Should Undergrad Physics major learn C#?

Click For Summary

Discussion Overview

The discussion revolves around whether an undergraduate Physics major should learn C#, C++, or both, particularly in the context of preparing for research in fields like photonics. Participants explore the implications of learning different programming languages and their relevance to research and marketability.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Exploratory

Main Points Raised

  • One participant suggests learning both C# and C++, emphasizing that C# is more marketable and easier to learn initially.
  • Another participant argues that the choice between C# and C++ should depend on the curriculum and whether there is an introductory class for non-computer science majors.
  • A different viewpoint states that C# does not offer significant advantages over C++ for numerical algorithms, and learning both simultaneously could be confusing for beginners.
  • Some participants highlight that C# is easier to learn due to its object-oriented nature and strong typing, which may help in developing good programming habits.
  • One participant shares their experience of focusing on one language to build a solid foundation, noting that researchers often learn just enough of a language to achieve their goals rather than mastering it.

Areas of Agreement / Disagreement

Participants express differing opinions on the merits of C# versus C++, with no consensus reached on which language is definitively better for an undergraduate Physics major. The discussion remains unresolved regarding the best approach to learning programming languages in relation to research needs.

Contextual Notes

Participants mention various factors influencing language choice, such as marketability, ease of learning, and specific research requirements. There is also an acknowledgment of the variability in programming languages used across different research groups.

Learn C#, C++ or both?

  • Learn C#

    Votes: 0 0.0%
  • Learn C++

    Votes: 4 50.0%
  • Learn C# and C++

    Votes: 4 50.0%

  • Total voters
    8
Kuhan
Messages
46
Reaction score
0
I'm an undergraduate Physics major. I'm interested in doing research, right now I'm aiming to do undergraduate research in photonics (I'm just a freshman).

After a conversation, I learned that I should learn C++, mathlab, AUTOcad and labview to use in my research.

My question is:
Does it make sense to
learn C#, C++ or both?
 
Technology news on Phys.org
Learn both. Pick up C# first. It's more marketable these days, easier to get into, and will help you learn good habits before you pick up C++ (and invariably, C). Personally I recommend pascal (and object pascal / delphi) as the best there is for teaching good programming habits, but through a comedy of marketing errors, that language is almost dead today.
 
Depending on the student price, get MATLAB first, since you'll be able to use it very quickly if you're already doing research. As for C# versus C++, I think it depends more on the class curiculum (is there a intro class oriented towards non-computer science majors?) than the language.
 
Unless you want to use Microsoft's ".net" framework to make your software communicate with other MS products and network services, I can't think of any reason why C# is "better" than C++.

C# has all the problems of C++ for writing numerical algorithms - except there are some fairly good workrounds in C++ which don't exist in C#.

Trying to learn C++ and C# at the same time would also be a bad idea IMO, because for a beginner they are similar enough to be confusingly different, if you see what I mean.
 
AlephZero said:
Unless you want to use Microsoft's ".net" framework to make your software communicate with other MS products and network services, I can't think of any reason why C# is "better" than C++.

I gave a few reasons.
1. More marketable.
2. Easier to learn (entirely OO, no chances of picking up procedural habits from examples)
3. Learn good habits (again, all OO. Strongly typed. Etc.)

Many of the same sorts of things that make Java appealing as a first language.
 
My two cents.

I would focus on becoming proficient in one language. That will give you a good foundation if you need to learn another language. I recommend something object oriented so that you get both the structural exposure as well as the object oriented concepts.

I studied C++ and when I arrived at graduate school we used FORTRAN and C. In my experience the language predominately used by the group is usually what the adviser is most comfortable with or whatever is the currently working program language. My group worked with C. The other two groups on my floor used C++ and FORTRAN. No one wants to redo code as long as it works.

My own personnel experience is often you do not master anyone language as a researcher. You just learn enough to make it work. The focus is on getting results. A good grasp of programming concepts will enable you to get it done more efficiently regardless of the language used.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 17 ·
Replies
17
Views
5K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 21 ·
Replies
21
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K