C# Should Undergrad Physics major learn C#?

AI Thread Summary
Undergraduate Physics majors interested in research in photonics are advised to focus on learning programming languages that will enhance their research capabilities. C++ and C# are both suggested, with C# being noted for its marketability and ease of learning, particularly for beginners. However, C++ is favored for its robustness in numerical algorithms and its prevalence in academic settings. It is recommended to avoid learning both languages simultaneously due to potential confusion. Proficiency in one language, preferably an object-oriented one, is emphasized as it lays a solid foundation for future learning. Ultimately, the choice of language may depend on the specific curriculum and the preferences of research advisors, as practical programming skills are often prioritized over mastery of a single language. The focus should remain on achieving research results rather than perfecting programming skills.

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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.

Similar threads

Replies
17
Views
4K
Replies
4
Views
112
Replies
16
Views
2K
Replies
15
Views
3K
Replies
2
Views
2K
Replies
4
Views
2K
Back
Top