Search Unity

Programming languages

Discussion in 'Scripting' started by vipvex, Dec 10, 2011.

  1. vipvex

    vipvex

    Joined:
    Dec 6, 2011
    Posts:
    72
    I'm kine'd of confused about all these programming languages. There are so many but what is the real difference between them ? Is it just the way you type in the code ? Are there languages that better to learn ?
    What is the deference between Javascript and C# ? If there is a difference then witch one is better for making a multiplayer game ?
     
  2. DayyanSisson

    DayyanSisson

    Joined:
    Aug 4, 2011
    Posts:
    623
    Slow down a second. You've never programmed before, so anticipating that you can make a multiplayer game right out the gate isn't very practical. Start slow, and actually learn the language before even starting a small project. As for your real question, it really depends on the person. I prefer C# way over JavaScript (UnityScript), but I find that JavaScript is easier to learn since there's more tutorials/documentation on it. JavaScript and C# are pretty much the same (except C# compiles first) unless in JavaScript, you don't statically type your variables/#pragma strict. There are some syntax differences between them, but they are mostly the same. I find C# cleaner then JavaScript, but JavaScript is easier to learn. My advice would be to learn JavaScript, and then see whether or not to switch to C# once you're good enough.
     
  3. andorov

    andorov

    Joined:
    Feb 10, 2011
    Posts:
    1,061
    The end result is EXACTLY the same as all Unity-supported languages are compiled into something called CIL, which is not something you need to worry about.
     
  4. BotMo

    BotMo

    Joined:
    Mar 2, 2011
    Posts:
    101
    Don't worry about what you can and can't do. Everyone will tell you "you can't make this type of game right off the bat" and it's true you can't, but you can learn to program by trying if you're patient.

    I started with BASIC, moved to php, JavaScript, then to C#.

    To answer your question, different languages are better for different things. Some are better for programs that access the internet or websites, some are better for databases, some connect better with other, older languages. You don't have to worry about most of that in unity.

    JavaScript is probably the easiest of unity's languages. C# is more flexible, but you probably can't appreciate the difference as a learner and it's complexity will be frustrating.
     
  5. DayyanSisson

    DayyanSisson

    Joined:
    Aug 4, 2011
    Posts:
    623
    I wasn't saying he CAN'T do it, but the thing is, if you aim too high, and you don't get there, then you sometimes get discouraged and shy away from game development. Just trying to keep people from making the mistake I made. But if you want to make an MMORPG, go ahead.
     
  6. tonyd

    tonyd

    Joined:
    Jun 2, 2009
    Posts:
    1,224
    Nighthawx is right, start small.

    I've been programming for 30 years, but my first game in Unity was Pong. You need time to learn the Game Engine, the language, and if you've never programmed before, game logic in general.

    When people with no coding experience try to write an MMO, RPG, or first person shooter, it usually goes something like this:

    1. They try to hack together something workable by borrowing code from all the Unity tutorials and examples out there. But soon find out that doesn't work too well, so...

    2. They spam the forums begging people to write bits of code for their game. This works at first, but as they start asking for bigger code snippets, their posts are ignored, or someone suggests they take a programming class.

    3. At that point they realize programming is hard and give up entirely.
     
    Last edited: Dec 10, 2011
  7. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    What they said: First, learn basic programming before even writing a single line in Unity3D. Depending on your time (if you're full-time on or hobbyist) it may take a few months to get a GOOD understanding of the language and be able to write code and having a GOOD understanding of Object-Oriented-Programming (OOP). It may take a few months, probably 6 months or more if you're hobbyist.

    Only then you should start and take a look at Unity3D API, try to understand what it does and start with small scripts and see how it works or how to realize small things (like character moving and rotating based on players input). Once you've experimented enough (3-4 weeks at least), you can have an estimated idea if your skills in programming are good enough to make a decent (or even working) game and then start to make a concept and start with your game.

    If you fail the steps above, then trying to develop a game with no experience, no OOP understanding and no understanding on how the API works, is absolutely pointless and waste of your time.

    Truth is, without the stuff above, the chances of you making an finished (or even working game) are next to zero. Programming is no easy task as copy and pasting 15 scripts into your project, change a few variables and hope it works.


    And I haven't even added practice and experience. Because that comes by developing, so even if you read through all C#/UnityScript tutorials, the code you produce will probably be a really mess, hardly extensible and at some point spaghetti code and you'll find yourself often at a point where you have to scrap big parts of your code and do them from scratch, because they were designed badly and couldn't be extended as you wanted. Next time you make it better or it takes longer until you scrap it. But once you've done it 15 times, you get experience and the code gets better and better.

    If you start he game with no experience, you'll find yourself often in such situation where you have to rewrite big parts of the code which can be very frustrating and finally lead, that you scrap it and wasted days, weeks or months of your time to reach a goal which was unreachable from day one.
     
  8. rausank03

    rausank03

    Joined:
    Sep 22, 2014
    Posts:
    2
  9. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    No need to. You can learn everything in Unity too. That's a complete valid approach that even makes more sense. Since you get immediately a result. Have a look at the Learning section above. And / or grab a book about Unity, and read /look through available tutorials at the net, at Youtube for example.
     
  10. Erisat

    Erisat

    Joined:
    Jan 31, 2013
    Posts:
    88
    I'd agree with Tiles, you can start out in Unity and learn that way. A great place to start imo (besides unity documentation and learning section) would be 3dbuzz.com they have alot of really great material on a wide variety of subjects. Alot of stuff on general programming, 3d in general, and alot of stuff for unity.
     
  11. Limeoats

    Limeoats

    Joined:
    Aug 6, 2014
    Posts:
    104
    I agree with this suggestion. 3DBuzz is a fantastic website to learn all sorts of different skills that will be helpful for game development. I recommend you go there and purchase their C# Tutorial.
     
  12. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    That was an old thread. Time to get an auto-lock function on very old threads :p
     
  13. Cpt Chuckles

    Cpt Chuckles

    Joined:
    Dec 31, 2012
    Posts:
    86
    lel someone bumped a thread from 4 years ago
    ok it's my turn:
    i'm not gonna tell you "dood you shouldn't make a big game you'll die"
    i'm just going to say, learn based c#, play with unity, etc.
    go to MSDN and follow the C# programming guide, and browse unity's tutorials and keep the scripting reference open at all times.
    one thing that actually helped me understand how unity works was GameMaker, which is a completely different piece of software but it's kind of like Unity's 2D little brother. playing around in both of them will eventually impart enough understanding to you to make full games.