Learning C# for Data-Science?

A quick thing about my history: I am german and studied math and philosophy for teaching. After getting my degree and started working at a school, I had to realize that dealing with children isn’t one of my strong suits. So I quit and began learning coding in hopes of getting something math-heavier to earn a nice living.

Right now I’ve learned a lot in Python and did the FCC courses on Tensorflow, as well as a Udemy course going more in depth on all the juicy math and statistic stuff.

So I’d say I am semi-proficient in Python.
Now I am wondering, is it worth going into C#?
Python has so many powerful libraries and nice tools like GoogleCollab. I’ve read that C# offers more efficient code but I haven’t looked into it’s libraries yet. SciKit-learn, matplotlib, numpy, pandas, tensorflow - Python has so much good stuff. Is there similar stuff in C#?

Also, can someone recommend good resources to learn C#?

I don’t know of any particular connection between C# and data science. If anything I would suspect that C# would be used to write an application wrapper that provides access to more powerful datacentric tools.

If you want to learn C# though, just look for resources about Java. As languages they are nearly identical, but there are a lot more resources available for Java.

1 Like

I you want more efficient, low level code for scientific applications, that would be C/C++, CUDA. The fast code that Tensorflow’s Python interface calls down to is all C++ and CUDA.

1 Like

Good to know.
Met a guy when I started my career change about 2 years ago who recommended C# for data-science / data analysis. But yeah, it doesn’t come up often. I’ve read some articles about it, but nothing there seemed really convincing there either. So I thought I’d ask.

Just got reminded about it because some recruter wrote me on Xing the other day and mentioned C#. But maybe that’s just a standard message, as I didn’t update the profile for quite some time, as I am currently in a company learning coding so looking for jobs wasn’t necessary ^^°

Though since I am getting closer to the end of my education, I am starting to look as to where to go. Got a lot of free time in my current company to learn stuff, but they don’t have a position where I could use it once I finished my education…

You probably should install Visual Studio. Note that Visual Studio and Visual Studio Code are totally different. There are portable versions of C# and you probably can use an IDE such as Eclipse for C# so it might help to know what IDE you are familiar with. Also it helps to know what kind of application. You can use C# to make websites and you can use it to make console (terminal in Linux and Unix) applications. And then there is Xamarin that allows creating applications that work in most environments but Microsoft is about to release something to replace Xamarin.

Yes, C# has many libraries.

I am not sure about efficiency. I do not know much about Python but I assume that for most applications programmer efficiency is more important. For the computer the difference in efficiency is likely negligible.

As for learning resources, they are abundant.

The languages might seem very alike but the build and execution of the programs are quite different. I do not know much about Java but I think that C# is as much like Java as it is like C++.

C# gets converted (they call it compiling) to machine code or something close to it so for most applications the efficiency is good enough.

C++ would be a good choice, especially if you do not need to develop a website. Familiarity with C++ will help with learning C# and Java.

My concern with using C# is less a matter of efficiency of C# and more a matter of what the common languages in the domain are for efficient low level code.

C# could be used for some Data Science Task. But currently, the time learning it for that purpose, would not be so efficient. Instead, I would recommend you to learn R if you want to add value to your profile, or Scala (If you seriously want to work with Apache Spark.)
If none of these options appeal to you, you can also learn some Data Wrangling Tools; programs like Knime or Weka for example.
Hope it helps.

You can use C# for data science, but nobody really does it. It makes it harder when you use languages that are not popular in the domain.

Personally, I’d use Python over R in general.

I’ve worked in both and the syntax and structure is nearly identical, so when it comes to learning the foundations of the language you can learn one and then transition to the other almost seamlessly. C# has some nice additional language features, but it started off as a deliberate copy of Java (because of licensing issues).

1 Like

The same can be said about learning C++ and transitioning to C#. A major feature of C# and Java that the C++ standard does not have is garbage collection. I agree that familiarity with Java will make learning C# easier but the same can be said for C# and even C++. I mainly disagree with C# and Java are nearly identical. And since I am repeating myself I will let you have the final word, I will not respond if there is nothing new to say.

C++ and C# are very different languages with far more differences in the syntax than C# and Java.

FWIW, modern C++ can have garbage collection. It was introduced into the standard with C++11.

Yes, C++ supports garbage collection but supporting a feature is not the same as having it built-in (automatic as in Java and C#). See C++11 Standard Library Extensions — General Libraries, C++ FAQ; it says:

C++11 provides a definition of what a GC can do

The implementation of garbage collection by an implementer (compiler) is optional.

See Slashdot | Interviews | C++ Answers From Bjarne Stroustrup; Bjarne Stroustrup, the original designer of C++, says that:

when auotmatic garbage collection becomes part of C++, it will be optional

And P2186R0: Removing Garbage Collection Support is a proposal to remove it.

You said the C++ standard does not include garbage collection. I was just pointing out that it is in fact part of the standard. I make no claim to how common it is to use the feature or to its continued existence. I just pointed out that it is in the C++ standard.

Relevant to someone that wants to learn C# it is critical for them to understand that C++ does not use automatic garbage collection like C# does.

That is certainly true. I would not really use C++ as a way to learn C# though. They are very different languages; much more so than C# and Java, for instance.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.