Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

Andrew Young
PLUS
Andrew Young
Courses Plus Student 639 Points

C or C# or C++

I was wondering why treehouse doesn't have C++ course?

They said an application should use C++, is they right?

I'm building a desktop client for my web app which language should I use (I'm containing API request and offline edit in my client)?

4 Answers

Raffael Dettling
Raffael Dettling
32,999 Points

With c++ you have more controll above your programm but it needs a lot more time and effort. C# is a lot easier because it already has alot of implementet classes but is a little bit slower(Must be translatet again at the start of the programm).

It depend on what do want to do. Mybe there are librarys which will help you.

Andrew Young
Andrew Young
Courses Plus Student 639 Points

But how is the speed comparison on C# and C++ when i'm export to exe and be used by user?

Will there be a big difference?

Raffael Dettling
Raffael Dettling
32,999 Points

Its around 5% so i donΒ΄t think it will be noticeable.

Andrew Young
Andrew Young
Courses Plus Student 639 Points

Then does treehouse have any API related lesson for C#? since I can't find it

Raffael Dettling
Raffael Dettling
32,999 Points

You can create api with asp.net so there are some lessons. The syntax of c++ and C# are similar but i think you should start with the c# track to test yourself.

Raffael Dettling
Raffael Dettling
32,999 Points

Maybe this will help https://stackoverflow.com/questions/26308167/c-sharp-webrequest-get-post I donΒ΄t remember lessons in c# where get or posts where used so sry ^^

Andrew Young
Andrew Young
Courses Plus Student 639 Points

But it looks like only C++ can cross platform to IOS and android is this right?

Raffael Dettling
Raffael Dettling
32,999 Points

There is the mono project for c# for cross platform but its not an Mircosoft implemantation so there wonΒ΄t be the latest .Net runtime features.

Andrew Young
Andrew Young
Courses Plus Student 639 Points

May I check before I started is C# using <stdio.h>?

Raffael Dettling
Raffael Dettling
32,999 Points

I think you have to use (using System.IO) and the FileStream class

Andrew Young
Andrew Young
Courses Plus Student 639 Points

Then which type of "C" is using <stdio.h> as there basic io header?

James Churchill
STAFF
James Churchill
Treehouse Teacher

Andrew,

If you're relatively new to programming, I would recommend that you focus on learning C# instead of C++. C# runs on a managed runtime which makes things like memory management simpler for developers. As others have stated on this thread, you can run C# cross-platform using Mono or with .NET Core.

Microsoft currently doesn't have a solution (to my knowledge) for creating cross-platform desktop applications. For a Windows only solution, I would recommend that you look at WPF (https://docs.microsoft.com/en-us/dotnet/framework/wpf/getting-started/introduction-to-wpf-in-vs).

Microsoft's Xamarin platform allows you to create cross-platform (Windows Phone, iOS, and Android) mobile applications using C#. See https://www.xamarin.com/ for more information. We also have a course on Xamarin that'll be released in the near future, so keep an eye out for that too.

To make requests against a REST/HTTP API using C#, I'd recommend that you take a look at the HttpClient class:

https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=netframework-4.7

Here's a walkthrough for building a simple REST client that uses the HttpClient class to make requests against an API:

https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/console-webapiclient

I hope this helps!

Thanks ~James

Raffael Dettling
Raffael Dettling
32,999 Points

stdio.h is the header file in the C standard library. It is used for input/output

iostream is the input output class in C++. For C# https://msdn.microsoft.com/en-us/library/system.io(v=vs.110).aspx

Microsoft has already provided the .NET runtime for linux. It's open source now. https://www.microsoft.com/net/download/linux

Ahmed Awadallah
Ahmed Awadallah
5,637 Points

One good example for using C++ is GPU programming and dealing with Graphical Libraries like Open GL on a Linux Machine. That would be an overhead if we used managed code like Java or C# because every Microcode instruction count I second Andrew's request