Want to learn C# - advice please (1 Viewer)

robbo100

Retired Team Member
  • Premium Supporter
  • May 5, 2009
    1,290
    309
    UK
    Home Country
    United Kingdom United Kingdom
    Hi there,

    For a while I have been thinking of learning C# so that I could have a go at writing my own plugin for MP. I have two problems though:

    1) I don't know what plugin to write - need some inspiration.
    2) I have absolutely no idea how to write C# code.

    Clearly I have plenty of time to figure out number 1 whilst I sort out number 2! Would anyone be able to give me some advice as to where to start with C#. I was probably going to just buy a book like this: Pro C# and The .NET 4.0 Platform, but it is a lot of money and I wanted some reassurance that it is the right version of C# to learn for MP.

    I have not written any form of programming since the days of BBC Basic and STOS (Atari), so I am expecting it to take me years to really get to grips with it, but I really want to have a go.

    If anyone knows of any other good books which will start me right at the beginning, or can point me in the direction of a good internet resource it would be very useful.

    Finally, I was going to download Visual C# 2010 Express Edition, but am I better off with something else? Both of my Windows PCs are being used as MP server and/or clients, so is it possible to use my MacBook to write the code and then test it using my PC (so that I don't have to type code whilst sitting in-front of my TV and can do it in more comfort) - or is Parallels the only way to go if I want to do that?

    Thanks (and sorry for such basic questions - everyone has to start somewhere I suppose!

    Robbo100
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,257
    2,533
    Birmingham
    Home Country
    United Kingdom United Kingdom
    I am not aware of anyway of coding C# on a Mac. it needs the whole .NET framework stuff and I think you are stuck with Windows.

    As for learning then as you say you have two issues, one is MP and the other is C#. C# is pretty much the same syntax as C, Java, PHP etc (but nothing like BASIC)

    If you are really starting from scratch and going to want know about if statements, case statements, for loops, while loops then I would really start by taking C# out of the equation. There are many good online resources that teach JavaScript. This is very different to C# but it is the same structure which you really need to understand first.

    IIRC an earlier version of JavaScript: Visual QuickStart Guide Visual QuickStart Guides: Amazon.co.uk: Dori Smith, Tom Negrino: Books was pretty good.
    Next step up is probably Object Orientated stuff but I am 50/50 as to whether you should understand that first or .NET/C#. To do it properly yes you should learn about OO stuff first but to write something you would not need to totally understand this (would work but not be as good code as it might)

    The MP side is probably one of the hardest bits in this jigsaw.

    You might be better off digging around some of the source code lying around for various plugins as this will really point you in the right direction.

    The best thing really is having something to work on. Knowing what you want to do and having enthusiasm will get you there a lot quicker
     

    robbo100

    Retired Team Member
  • Premium Supporter
  • May 5, 2009
    1,290
    309
    UK
    Home Country
    United Kingdom United Kingdom
    Thanks Jameson_UK.

    I really am starting from scratch, so it is going to be a long journey (which I may never complete), but I am really interested by what can be achieved so it should be worth the effort.

    Cheers

    Rob
     

    KayDiefenthal

    MP Donator
  • Premium Supporter
  • July 18, 2006
    1,161
    93
    48
    Germany - Bonn
    Home Country
    Germany Germany
    AW: Want to learn C# - advice please

    books are good for the beginning
    But then I learn the most about Internet resources for example one of my favorites was then functionx.com
    ok the most was try and error in windows form but with this have i learnd ways this not work
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    If you really want to use a Mac, you can use Mono and MonoDevelop (free).

    But, if you are decided for C#, I would really try to do this on Windows.
    If you just wanna learn to program, and wish to stick to the mac for now, start out with Java (not Javascript IMO). Java is (on the surface) very similar to C#, and once you can program in Java a bit it will be very easy to switch over to C#.

    Unless your really sure you are going to stick to this (or have money to burn), I wouldn't buy a book right away. There are plenty of online tutorials available, and the bottom line is you just have to practice. See if it is for you. So do a few tutorials to pick up on control structure, understand what classes and mehtods are, but then pick a small project you would like to do and stick to it. If you are stuck, ask, don't give up (Stackoverflow is a good site for this). Lastly, be aware that not everybody can learn to program (not trying to be decending). But since you have some Basic expirience your probably not one of those people. But it will take time. Programming (or better Software Engineering) is mostly experience. Practice practice practice :)
     

    robbo100

    Retired Team Member
  • Premium Supporter
  • May 5, 2009
    1,290
    309
    UK
    Home Country
    United Kingdom United Kingdom
    Thanks all for the advice.

    Lastly, be aware that not everybody can learn to program (not trying to be decending).
    - don't worry, I don't take your point as insulting, you are completely correct. Everyone's brains are wired differently. My wife can speak about 4 languages and I struggle just with English, but when something technical needs doing I come into my element (and she doesn't have a clue).

    I am fairly confident that I have the right mind for writing code. I have a degree in Engineering, but so far I have not chosen a career route that required any coding (although I have generated a fair number of mathematical models using Matlab Simulink - which although not coding as such must share some similar skills). I just need a new hobby as MP is so reliable now I don't have to fiddle with it as much ;)

    So the message I am getting is "Practice, practice, practice" and to pick a good project to work on. Has anyone got any ideas of the sort of first timer projects that I should try to work towards?

    Thanks

    Robbo100
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    52
    Berlin
    Home Country
    Germany Germany
    On a Mac just install Win in a VM. Doing the same here. Work for must stuff you do. Only exception is DX10 or newer. VMWare and Parallels only offer hardware acceleration for DX9. Bummer, but that's across all platforms. So for some stuff you need to boot into Win directly for testing. But no biggie.

    You can find tutorials on the net to get you started. Never needed a book for any programming language. And you will lookup APIs all the time away. At least I have to do for most stuff.

    I usually run OSX on one screen, a Dev Win on another and a third one for movies, music or anything else. Just my way of working...
     

    Wo0zy

    Retired Team Member
  • Premium Supporter
  • April 30, 2008
    394
    134
    Home Country
    United Kingdom United Kingdom
    Hi Robbo,

    If it's a very basic starting point you're after have a look at http://www.homeandlearn.co.uk/csharp/csharp.html

    It won't get you anywhere near starting to program an MP plugin but it's a very gentle intro that will start to get you thinking.

    Good luck! I'm a few months into a fimilar journey and it is hard going. I'm an IT pro with over 20 years experience but I haven't tried coding until recently. It's frustrating, fun and challenging all at the same time :).

    If I never complete the journey the one thing I have learned is that the guys behind MP deserve more credit than the average user could ever fully appreciate!

    All the best,

    Mick
     

    Users who are viewing this thread

    Top Bottom