Is Mono for OSX viable for learning C#? - c#

I need to learn C#. All of my computers are Macs running the latest version of OS X. I do not want to use Windows, but I will if I must.
That being said, as a new programmer, can I learn C# efficiently with this Mono platform on OS X?
Edit I'm looking to learn C# to gain programming knowledge and start indie game development. After a reasonable understanding is achieved I will then look at some gaming frameworks/platforms and or a more OS specific language.

In a word: Yes.
First of all, thanks Jonathan Pobst for updating What Is Mono page. With that said, Mono supports all versions of C# at present, that is 1.0 to 4.0.
Since your plan is to learn the language first before looking into other things, such as frameworks and tools, you should be fine with Mono. Once you start getting into platform-specific development (i.e., Windows GUI), then you might want to consider switching over to a Windows machine.
http://mono-project.com/What_is_Mono
http://en.wikipedia.org/wiki/C_Sharp_(programming_language)#Versions

If you are going to be developing for Windows, then using a Windows machine is your best bet. If you are simply trying to learn the language, Mono should be fine.

You should be able to, but just keep in mind that while most of the example code will work, some may not on the Mono framework as the implementation is not 100% compatible with .NET Framework. Also, of course some things like WPF aren't be supported by Mono.
I have used Monodevelop on Linux and it mostly works but because I also develop on Windows with VS2010, I am put off by using the inferior Monodevelop but as a newbie it shouldn't matter to you much.

Yes that should be fine seeing as MonoMac has come out. http://www.mono-project.com/MonoMac
If your wanting to use it for games with OpenGL, download this repo and look at the openGL stuff to get started. Then go to places like NeHe to learn more about GL ect..
You will need to download & install git to pull the repo:: http://git-scm.com/download
MonoMac Samples:: https://github.com/mono/monomac/tree/master/samples/
NeHe:: http://nehe.gamedev.net/
Code Sampler:: http://www.codesampler.com/

Depends.
To just learn the C# language and CLR core libraries which are not graphics related, C# / MonoDevelop is okay.
To learn graphics programming, game programming for OS X, I suggest you first learn Objective-C, Cocoa and then MonoDevelop/MonoMac. The reason is that the Cocoa API's are designed around the Objective-C language which has fundamental differences to C#. Using Cocoa via C# is easy to begin with, but quickly makes little sense unless you understand Cocoa patterns & Objective-C.

Related

What Game Engine/Platform to use in order to Write Once and Deploy Everywhere?

Basically, I want to design a strategy game, where most of the game will be spent in menu areas and making "decisions" (like a Tycoon style game), however, there will still be some graphics, and I would prefer 3D, but if not possible, can resort to 2D. The graphics aren't user controlled, but the moving objects will be the result of the "decisions" the players make.
I really just want to write it once, and have it run on the following Platforms:
Windows Desktop
iOS (iPhone, iPod, iPad)
Android Phones (not strictly required)
(any other platforms would just be a bonus, but at the absolute minimum, all i really want is Windows Desktop and iOS [iPhone, iPod, iPad]).
Now, I don't want to learn objective-c or any other languages which i may have no use for in the future, I really just want to be able to program in Visual Studio (VB.Net or C#, since I can convert from vb.net to c# I will just be writing it in vb.net).
Is it possible to write in vb.net/c# and deploy to all these platforms? I heard of MonoTouch, so i can convert from vb to c# but is this seemless or difficult to do? Do I have to learn and write in another language in order to make tweaks to make it work on the iPhone or Android? So, with MonoTouch, can I still use XNA or is there a different engine that I need to learn/use with Visual Studio?
Alternatively, if I cannot do this all in VB.NET or Visual Studio, what programming language and/or graphics engine should I learn in order to be able to write once and deploy everywhere that is relevant? (So, not fussed about Linux, Mac's or other less used OS's).
Right now, I haven't learnt XNA but am wondering if I should or need to, or if i should learn another engine & language. Basically, I don't really know what I need to learn/know in order to be able to write once and deploy on Windows Desktop, iOS (iDevice's) and maybe Android. So, my question really is, what do I need to learn in terms of both the programming language and game/graphics engine. Right now I know VB.NET and would prefer to use what I know, but if not possible, then am prepared to learn another language & engine combination to be able to achieve what I want, if this is what I need to do, I would like to know what language & engine I need to learn.
A good option for this is Unity3D. It allows you to develop a game, and from a single source, publish to PC, Mac, iOS, Android, and other platforms.
It does support C# development (which was one option you listed), though it typically is handled via their own editor instead of within Visual Studio. That being said, they do support Visual Studio as the code editor for projects.
I never tried it out (but I tried MonoTouch - and it worked like a charm), but MonoGame could be the solution for you.
It's C# with XNA for deploying everywhere. For MonoTouch there was a rather hacky way to work with VisualStudio - but for my part it was a good way to work with MonoDevelop (a really good OpenSource-IDE btw.).
C# was invented by Microsoft for use on their products and XNA and Visual Studios are again microsoft development tools, if you're looking to place this across several platforms it might be less headache to consider Java or C++. also as said above, go look for this info it is more then readily available after some 5 minutes of search

iOS games development

I have just finished studying C with some website, and I covered most of the basic-intermediate things.
Now I want to develop iPod\iPad apps, using Objective-C as I understood it's the best option.
But from reading many guides, I still haven't came across one sure answer - Can you develop iOS applications using Objective-C on a PC, Windows? I know you have to pay these 99$ to be allowed to develop and to be given access Apple classes, but it's okay with me.
If you can not do it on windows, what will be the next best option? I know you can create iOS games using Unity and C#, I have it installed but I still didn't find out how to create an iOS project. And I couldn't find a simple guide for iPod apps with unity, that would be nice, too.
If the best option is not unity, what will it be? I have intermediate-high knowledge in .NET (Thats the way it seems in the forums I'm usually at... here I am a simple beginner) and I know C# syntax the best, but I know VB too. And C, and a bit C++.
Thanks :)
the short answer is no. but there are ways around it if you don't want to put the app in the marketplace
You can code Objective-C in Windows, however you will not be able to compile. http://kdevelop.org/, http://code.google.com/p/objectiveclipse/ and http://www.bloodshed.net/devcpp.html Dev-C++ are compatible with Objective-C, for example. I haven't had any experience with them, however.
XCode is still the best for this task, and I'm not sure if you would call this being able to "develop iOS applications on Windows", but I tend to code quite a bit in Notepad / GEdit anyway, so the answer is "kind of". You'll need a Mac to go anywhere further than coding though, like being able to debug.
The Unity iOS development does not come with the free version of Unity. Instead, you would have to purchase a separate license (in addition to the $99 that Apple will charge you to become a developer, I believe.) I myself have never used Unity to develop iOS games, so I don't know how well the process works.
Ideally, however, iOS development really is meant to be done on a Mac. XCode is the primary IDE used for iOS development and it is Mac-only.
Another option is to generate iOS game with Flex 4.5, which allows you to write and test code on windows and you can package it for iOS. But you have to learn ActionScript and MXML for it.
From Adobe's Website
Flash Builder 4.5 includes full support for building ActionScript® applications for Apple iOS. Flex support is planned to be available later in 2011
You can check out
Corono -- http://www.anscamobile.com/corona/
Unity -- http://unity3d.com/
Cocoa2d -- http://www.cocos2d-iphone.org/
Depending on what you are looking, all of them has nice docs that you can go through about their capabilities.

Using C# to make Application for Maemo (convert code to QT)

I want to make an application for my phone (Nokia N900) It uses the Maemo Platform, which is a Linux variant. Most applications are made with either QT or Python, i only have experience in C#, and am wondering if it is at all possible to convert C# to QT, or would i have to use something like Mono or Vala to write the code in C# and create the applications for the N900??
Cheers,
Brendan
About "converting C# to Qt": they're not comparable: C# is a language, while Qt is a UI framework.
Mono does run on Maemo and while there are Qt bindings for .Net/Mono, Mono uses Gtk# as the default/recommended/supported UI framework.
If you are already confident with C#/programming in general, then it should not be too much trouble to pick up a new set of tools. One size does not always fit all!
I do not think that exist a tool for convert C# code to the equivalent Qt/C++, Qt/Python, is something that is best done manually. It's best developed on a platform like a Mono for the N900 or find someone with knowledgeable in Qt able to carry out the work.
Note that Qt is the default platform for Nokia, if you want to install this application on other devices easily best using Qt.
C# as a programming language is controlled by Microsoft. While Microsoft has stated that they will provide a "patent convenant" regarding C#, it is hard to believe them since they have been so eager to sue in the past. ;)
If you want to "convert" your C# app, you'll need to incorporate it into Mono. Mono is a 'cross-platform, opensource .NET development framework." http://www.mono-project.com/Main_Page
Once you've got your app working in Mono, you'll need to interface into Maemo. There are a couple of routes to do this, but Qt is the most likely one to choose. It might be so much work to port your app to Qt that you decide to re-write it, fortunately Qt supports a number of programming languages so you may be able to find something similar to Mono if not Mono and C# itself.

C# GUI programming for beginners: Where to start? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm a C++/Java developer and have no idea about .Net or GUIs. I need to develop a windows app for 2000/XP/Vista/7.
I think I've come to conclusion that C# is the best and the fastest way to go (please correct me if I'm wrong). What do you recommend? Which GUI approach should I learn? (Forms? Any other stuff?)
Is it the best way to compile in .Net 2.0 mode? It's going to be an application for the public to download.
For desktop applications there are basically two options; WinForms and Windows Presentation Foundation (WPF).
WinForms is more traditionally built and hence easier to learn. WinForms might therefore be a simpler start, but if you plan on actually using your gained knowledge in GUI development for .NET I'd say you're better of diving into WPF from the start. It's a much richer framework, and where Microsoft is putting their effort for desktop applications. It is also similar to Silverlight, meaning you can easily get into Silverlight too when you know WPF.
This other question gives some useful resources when getting started with WPF.
Also check out this tutorial at MSDN.
WpfTutorial obviously has a few nice hints for you too!
Good luck!
In my personal development experience Windows Forms is just about as easy as it gets when it comes to rapidly deploying a GUI application on Windows. WPF is of course another option, but using it would likely require you spend some time familiarizing yourself with XAML. Windows Forms look and feel like a lot of the available GUI options for Java, it's just much better than the majority of them, in my opinion.
If you want the fastest possible GUI development time in .NET, Windows Forms is it.
Yes. C# is the language of choice when it comes to .NET development. Since you've programmed in Java, you'll find that the language looks very familiar (it looks a bit cleaner though and has some very nice features like delegates and you can even use pointers if you really want to, although you won't need to in most circumstances).
It's SWF (System Windows Forms) or MWF (Managed Windows Forms - a lightweight version of SWF written in managed Code using System.Drawing - it frees you from the WinAPI that's underlying classical SWF) all the way.
There's also GTK-Sharp, a GTK+ binding for C-Sharp, but since you're developing for Windows, users will find it strange to install a third-party GUI framework for your application.
I wouldn't recommend using WPF though. It makes direct calls to the underlying graphics hardware, which means it's quite fast, but not portable at all. It will only run on x86 systems (not SPARC, etc.) with DirectX compliant hardware rendering units (graphics cards) and it will not run on a system with strong hardware abstraction (like most Unices like BSD or Linux or Solaris).
Novell also stated that they will never implement WPF in the near future due to it's strong hardware dependencies (Novell wants Mono to be portable across many processor platforms). Don't use WPF. Software is no longer just a throw-away-product and when it comes to operating systems we're in the age of spin. The platform you're running today isn't necessarily the platform you're gonna run tomorrow. WPF is a proprietary and patent-encumbered technology developed by Microsoft and Intel. If you use it, you'll find yourself in a very nice Win32-on-x86 vendor lock in. And this means that you'll most definitely find yourself completely re-writing your application sooner or later. Just write portable software from the beginning, even if you don't need that portability today. I'm telling you from experience, you will need portability tomorrow. Definitely!
You could use Windows Forms or Windows Presentation Foundation to develop your GUI; although, Windows Forms might feel more familiar to you. If you search on Google for Windows Forms tutorial, you will get many options for getting started.
If you need to use .NET 2.0, you will be limited to Win Forms. WPF requires .NET 3.5.
I would suggest downloading Microsoft's free Visual Studio Express Edition to use for developemnt. it includes an excellent drag-and-drop GUI design tool.
I would recommend learning Winforms first, then move the WPF. Winforms is easier to learn and get something working quickly. The future however is WPF, so I wouldnt leave that in the dark. I posted some good books and links for GUI development work.
Books
Design of Everyday Things A really good book about design of interfaces. It's not software specific but a must read for GUI designers.
Coding Horror. He recommends a lot of development books on his book list, but these ones are specifically interface-related:
Don't Make Me Think
About Face 3.0
The Inmates Are Running the Asylum
GUI Bloopers
Web Links
Are Confirmation Dialogs Harmful? A blog entry by Guido van Rossum (creator of Python)
GUI Articles A few articles about GUIs by Joel Spolsky (joelonsoftware.com)
Interfaced Systems International Has a lot of resources, especially on their UI References page
User Experience Guidelines for Windows Vista
I disagree with all the WinForms advocates. It's not easier. It may be easier for someone who has traditional experience with GUI programming, but this poster doesn't have that.
WPF has a better design story and the databinding is much, much better than WinForms. You can get up and running on WPF at least as fast as WinForms, and then go much further without running into the limitations that WinForms has. Couple this with the design-time databinding in VS 2010, and I'd say that anyone starting out on GUI development should completely bypass Winforms.
C# WinForms will be the fastest in terms of getting a practical GUI working rapidly. Though if you think on making a complex GUI, with animations, 3D etc, WPF would be better.
You can use CodePlex to find some good working projects to learn from in terms of best practice, both for WinForms and WPF.
You can also look here for some good books on both WPF and WinForms.
C# for sure. Use Winforms for line of business app / classic GUI.
read petzold 'programming windows with c#'
Or just dive in with visual studio. Creating GUI with VS is really easy - you will like it
You will find the langauge transition from java to c# pretty simple (not the gui bit tho)
I think I've come to conclusion that C# is the best and the fastest way to go (please correct me if I'm wrong). What do you recommend?
Personally, I would stick with Java. We (meaning OffByZero, the company I co-founded) have released an encrypted text editor called OBZVault, which is written in Java.
We originally wrote it in Linux, and then ported to Mac OS X and Windows. We found that the Windows port provided a perfectly acceptable look & feel - almost (but not exactly) like a native Windows app.
We used InnoSetup to build a native Windows installer, and found that quite good as well.
Bottom line: unless you want to learn a new language & platform, or you have a specific need for functionality provided by a different platform like .NET, stick with Java for your Windows development too. You'll need to learn a Java GUI framework, but then you'd have to learn WPF or WinForms if you switched to .NET anyway.
It may be faster for an experienced .NET developer to build a Windows app in WinForms or WPF, but if you're already well versed in Java I say stick with the tools (language, libraries, IDE) that you know.

How toI run a game made with XNA on the iPhone/iTouch?

How could I run a game made with XNA on the iPhone/iTouch? Which steps/tools (existing ones or imaginary...) should be used?
Note: The goal is to avoid modifying existing C# code
UPDATE :
If I understand correctly, I must be able to:
Run my XNA code on Mono (monoxna or SilverSprite, promising?)
Run Mono on iPhone (MonoTouch)
Not only is it possible but here is a video of someone doing XnaTouch on MonoTouch: First game to IPhone build with XnaTouch (XNA for IPhone)
Here is the mono article about doing it http://www.mono-project.com/MonoTouch
I don't believe there is a good answer to your question. XNA doesn't target the iPhone, so the chances of being able to effectively port an XNA game without modifying the C# source code isn't likely to happen.
Instead, I'd recommend that you take a look at the various frameworks that exist to help you craft cross-platform games. Unity often comes up in these discussions, but it isn't free.
If cross-platform isn't your goal, but free iPhone development is, then I'd recommend looking at Cocos.
Edit: The MonoTouch project may be able to assist you in the future, but doesn't help you out right now. Still, it's something to keep an eye on.
Edit: The landscape has changed a lot in the ~5 years since this question was posted. If you have an XNA project that you want to get running on iOS, then Xamarin.iOS (formerly MonoTouch) plus MonoGame is a near-perfect fit. MonoGame is missing a huge chunk of the XNA content pipeline, which means you'll either have to abandon it or have a VS2010 instance somewhere compiling your assets.
The MonoTouch project may eventually help here, since it allows you to write C# targeting the iPhone (it is statically compiled to native code).
MonoGame is a free OpenGL implementation of the XNA 4.0 Framework. It is built upon the excellent range of Mono compilers and is compatible with MonoTouch (iOS), Mono for Android (Android), MonoMac (Mac OS X), Mono for Windows and now Linux!
A list of 12 games currently using MonoGame that are on the Apple iOS App Store can be found #
http://monogame.codeplex.com/
https://github.com/mono/MonoGame/wiki/Released-Games
I believe XNA depends on Direct3D 9 (see http://msdn.microsoft.com/en-us/xna/aa937793.aspx), which may hint at the hurdles one might encounter in both porting to mono as well as having sufficient graphics horsepower on iPhone.
Everyone saying this is possible because there are CLR libraries for Mono, does not even think about the fact that XNA is a WHOLE DIFFERENT set of frameworks:
"The XNA Framework class library is a library of classes, interfaces, and value types that are included in XNA Game Studio."
As another responder noted, this is so far from happening it's not even funny. If you really want to write a game I'd check out Unity. It's commercial, but it looks utterly impressive and you can script your game logic in Javascript or (here's the funny part) C#!
Yes, instead of going through a ton of work to port a whole framework because you want to write a game in C#, why not just use a framework that lets you do that today?
From the horse's mouth:
MonoTouch + SilverSprite = XNA 2D
games on iPhone? :)
What Bill means is that it will eventually be feasible to write a 2D XNA game, then use SilverSprite to run it on Silverlight, then use MonoTouch to run it on the iPhone
This space is definitely heating up. There is now an XNA Touch project on codeplex that aims to bring the XNA API onto the iPhone/iPad platform:
http://xnatouch.codeplex.com/
'Maybe' you could just change XnaTouch's namespace to match those of existing Xna code (i.e. Microsoft.Xna.Framework.*), when developing a MonoTouch project? This could be done on a vendor fork (copy) of the XnaTouch code, easy to manage using Git, Mercurial or Piston etc.
I'm unsure as to whether the XnaTouch team would undertake such a change on its own codebase, so this is probably best done on your own, personal, code branches (interestingly, the Mono.xna project uses the original Microsoft.Xna.Framework.* namespaces, I'm unsure why XnaTouch chose not do so).
JFYI, the current XnaTouch (v1.0) follows Xna 4.0 quite faithfully. I've found a [small] few missing method calls, which I've 'implemented' to throw not implemented exceptions (?). The original-xna4-and-modified-xna-touch code does compile, now I need to implement iphone-specific gui and handling etc.
Hope this helps someone.
Cheers
Rich
For starters you would need a CLR implementation on the iPhone, which doesn't exist at the moment, but it seems someone is trying: MonoTouch.
A friend of mine is developing an architecture port of XNA 4.0 for the iOS platform. It's of course written in Objective-C, but it has the feel of XNA. He has published the source under LGPL at http://code.google.com/p/xni/.
Xna is not officially supported on iPhone; however, you could use ExEn (http://exen.codeplex.com/) or MonoGame (http://monogame.codeplex.com/) to port your Xna games. A bonus for using either of these is that they support Mono for Android.
If you're looking for a free cross-platform sort of thing, you could check out phonegap. I don't have any experience with it but it looks cool.
http://phonegap.com/

Categories