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 trialjon kelson
5,149 Pointsswift vs c# ?
Hi all, ive been learning swift (in mind to create apps in xcode/sprit kit etc) which is great. But now i've started looking at c# language for using on unity gaming as i'm quite impressed with the video graphics plus (I think ? correct me if i'm wrong please) you can also use this for creating games for apps on apple ipads etc.
I know it might be personal opinion, but what are the pro's and cons of between these two languages? is the c# a bit old now ?
5 Answers
Michael Hulet
47,913 PointsIt really depends on what you wanna do. If you want to be able to create any kind of iOS app, go with Swift. You'll still be able to make games with SpriteKit/SceneKit, but you can make any other kind of app you want with any kind of features you want, too. If you want to do solely game development, Unity/C# is probably the way to go. Unity can build games for iOS, as well as almost any other platform you can think of
Jason Anders
Treehouse Moderator 145,860 PointsHey Jon,
I haven't fully researched yet, but I do know that the two main languages for iOS development are Objective-C
and (the newer) Swift
.
C# (I believe) is related to the .NET language (which is part of Microsoft). I have read, however, in some blogs that one can code iOS apps with C# using Visual Studio
on a windows machine. Again, I haven't really looked too deep into this, but I suggest that you try Google and see which direction that takes you. :)
Jennifer Nordell
Treehouse TeacherC# is Microsoft's native programming language. Java is Android's native. And Swift (formerly Objective C) is iOS's native language. Now the interesting thing about C# is that with the Microsoft .NET libraries you can use C# to access iOS/Android native UI elements.
Now, I've never done a big app that's been released on any store and I don't know what EXACTLY is required to make them cross-platform compatible. But if you're going to look into C# and Unity, you might also want to look into Xamarin. You can find it https://www.xamarin.com/. Xamarin is specifically used to make apps cross-platform compatible with C# using Visual Studio. You can either use it in its own stand-alone studio or as a plugin to Visual Studio.
Keep in mind though that if you're planning on doing an iOS app in C# you will still need to have a Mac. I have tried to run a "hackintosh" from a VM on a Windows system. And when they say Xcode isn't supported in such a setup... they mean it. While I did manage to make it run, anything more than a simple "Hello, World!" would generate errors and try to make me debug threading processes. And... it was slower than snail snot.
Steven Parker
231,236 PointsThese languages have different primary uses. Swift is the latest language used primarily to develop apps for iOS-based client devices (iPads, etc). And while C# may be used for client-side development, it is also extensively used for developing server-side applications. C# has been around longer, but it has continued to evolve and is certainly not approaching obsolescence. It also has support on a wide variety of platforms, which Swift will likely never have.
While Swift may be intended to replace Objective-C, an older iOS-specific development language, it is not a replacement for C#.
Michael Hulet
47,913 PointsTo be clear, C# is used for way more than server code. It's Microsoft's language (in much of the same way that Swift is Apple's), and it's used greatly to develop Windows and Windows apps. It's also used in a lot of game engines, such as Unity. Web servers are one of the things it can do, not what it's made for
Steven Parker
231,236 PointsNo, not made for, but widely used for. Actually, I think it was originally created to be competition for Java.
jon kelson
5,149 PointsThanks everyone , I've looked on App Store on the iPad and if you type in unity games it comes up with games . Are some/ all of these games written in unity ?
I guess what I'm asking is if I learn how to build games in unity and c# , will I be able to upload them onto the apple App Store ?
Michael Hulet
47,913 PointsYes, if you have an Apple Developer account, which is $99/year
Jennifer Nordell
Treehouse TeacherYup! For a more complete list of games made with Unity... I'll leave that to Unity themselves. http://madewith.unity.com/games