or Connect
AppleInsider › Forums › General › General Discussion › C,C++,C#,Java?
New Posts  All Forums:Forum Nav:

C,C++,C#,Java?

post #1 of 5
Thread Starter 

Hi, I have done my research, and have been reading around abit for four or five months. 

I own an intel based mac, but also own a windows pc and I'm looking to take up programming as a hobby, nothing crazy like university courses or commercial design, just exploration and a hobby.

 

I've worked with python briefly, and I can understand it rather well but I'm also comfortable with trying something completly new. My goal is to find a solid programming language that is (as close as can be) cross platform friendly. If that's not a realistic goal, I'd like to stick closer to programming with mac. 

 

I'm looking at small apps design I think. What I have been looking at as an example is the popular pc game "Mine Craft", reading through the forums it sounds like it was written in mostly Java, while a similar game "Terraria" was written in C#. Is that simply because the creator of the game was familar with C#, or is it because that was a suitable language. I'm still trying to figure out if Java is a strong enough language to accomplish large goals, and I realize creating those games before mentioned was no small task, but it's a useful comparision to me. A couple months ago I found a tutorial that showed making a small program that basically guessed your gender, very simple. I really wish I saved it. It would ask you a bunch of questions (i.e do you wear dresses? if yes= true Print:.... blah blah blah).

 

So, summary of my question, Please recomend a language that is: 

 

1) Cross platform(give or take)

2) Suitable for program and application design(?)

3) Does not require a massive amount of knowledge about prior languages. Since this is my first one.

 

I'm not worried about difficulty, please don't recomend Java just because it's famously easy.

 

Thank you in advance, and Sorry if any of what I'm saying is incorect. I hope you guys get what I mean

post #2 of 5
Learn C or C++. Either of them then lets you learn Objective-C.

Python's all right to start off, as well. Don't waste your time with Java. It'll be dead before you're done learning it.

As for languages and suitability, it's often the case that developers will use languages with which they're familiar. RollerCoaster Tycoon I and II, for example, were written in machine code.

It's also often the case that a different language than the one chosen would have been better.
post #3 of 5

It depends.  I would pick either Java or C#.  Both are (semi) modern high level languages. I know some folks swear by python but IMHO it doesn't quite give you what Java and C# can.

 

For you, the higher the level of abstraction the better off you are.  That pretty much eliminates C and C++.  As a former C++ dev I know all about Boost, STL, yadda yadda yadda.  C# and Java are still cleaner and have less ways of shooting yourself in the foot. 

 

For cross platform you lose ObjC as an option.

 

For general small app development on Windows and OSX the first decision is based on one and a half criteria:  Cocoa and Mac App Store.

 

1) If you want to learn Cocoa there's no access to any Java Cocoa bindings any more.

 

And a half) Java apps will never be approved on the Mac App Store.  MonoMac/Cocoa# project are translated and compiled under Xcode and can be approved.  A dev at Oracle believes that if you bundle the JRE with the app that it could get approved but I've never heard of anyone succeeding.  Or trying for that matter.  I'm 90% he's wrong.

 

If you really care about either then Java is out.

 

If you don't then these are the things I would think about:

 

1) If game development is what will keep you coding then your language choice will be based on the game engine most easy for you to learn, understand and use.  

 

  • Unity (C#, Javascript, Python scripting) is a powerful one with a free option.  It comes with the MonoDevelop tuned for scripting and debugging.  There's a decent amount of tutorials but you need to play with them to see if they are too advanced for you.  It has a 3D focus which makes it harder...but there are starter packs and assets you can buy...although those might require owning the $1500 pro version.
  • jMonkeyEngine is an open source java engine that is popular, has tutorials, etc but is also 3D focused
  • Ardor3d was developed to be easier/better than jMonkeyEngine by the original jMonkeyEngine devs.  Fewer tutorials and documentation.  Also Java
  • Axiom 3D engine - a C# engine with XNA, etc bindings. Cross platform I think
  • Slick2D is a 2D java game engine.  Never even looked at this but 2D art assets and development is far easier than 3D
  • JGame - 2D java and flash engine

 

You probably don't have the time nor desire to code from scratch.  You could but it's a lot easier to dip into coding starting with an engine and see what you can do with the Python or JavaScript scripting language.

 

You'll want lots of incremental successes to keep you motivated vs throwing up your hands...it's not a matter of difficulty but human nature.  

 

If you were serious about coding then there is no real substitute for a firm foundation in computer science basics (data structures, control, oo theory (encapsulation, abstraction, polymorphism, yadda, yadda, yadda), and so forth) that you want to skip.  You don't have to go to university to learn these but you gotta pick these up somehow...most programmers without a CS background learn as part of a team.  For you, there isn't a senior dev mentoring you along and frankly for small app development you'll be mostly fine.

 

Finally, if you still want to do C++/C I would take a look at the Torque Game Engine.  Still alive but getting (IMHO) dated but for an indy game dev it's decent.  You can start with just TorqueScript (LUA based I think...it's been sooo long I forget).  $150ish to start but I think there is a free demo.  What really helps are the starter kits.

 

http://www.garagegames.com/products/browse/genrekits

 

There are unity ones too.  Haven't tried any.

 

2) For general development were you code once and run on either windows or mac then Java is better than C#.  While it is good practice anyway to have a high degree of separation between business logic and UI you can be sloppy in Java because the UI rendering is inherent in the language platform (ignoring Android for the moment).  C# can have native bindings to Cocoa, XAML, WinForms, etc but for cross platform you need to not cheat in separating game or app logic from UI code or you will pay later.

 

For games, you code against the game engine unless you're starting from scratch.  The native UI is the engine...but game logic should STILL be compartmentalized from GUI code and logic.  If for no other reason than you might want to reuse game logic code in a new engine for a new game.

 

Don't code from scratch although DO code from the tutorials.  Things like the NeHe opengl tutorials are kinda advanced but there are many XNA, JOGL, etc tutorials based on the NeHe ones.  These gives you some low level understanding of what the 3D engines are doing for you...and why you don't want to code from scratch.

 

3) Documentation and tutorials:  Both C# and Java have lots of these.  Java probably has more because it is older and is a common teaching language.  The downside is that if you google "How to do X in Java" you often end up with three different answers, two of which are deprecated by newer features in later versions of Java.  C# is somewhat less crufty from this perspective but with the number of .NET versions, LINQ, XAML, win forms, etc you end up with some of the same issues.

 

Ran out of steam but this should get you started.  

 

Don't worry about Java dying...it'll be around a couple more decades.  There's billions of dollars worth of enterprise code built on Java including all of Oracle's stuff, a large chunk of IBM stuff, etc.  Even desktop development will continue on...at least as the same low level of effort as today.  Heck, it surprised the hell out of me but they did GA on JavaFX in Feb.  I was pretty sure JavaFX would have died with the Oracle acquisition.  Oracle doesn't have a desktop focus but given that Java is open sourced they can neglect it but not kill it.  I don't see Ardor or JMonkeyEngine going away any time soon either.

post #4 of 5
Thread Starter 
Quote:
Originally Posted by nht View Post

"It depends.  I would pick either Java or C#.  Both are (semi) modern high level languages. I know some folks swear by python but IMHO it doesn't quite give you what Java and C# can.

 

For you, the higher the level of abstraction the better off you are.  That pretty much eliminates C and C++.  As a former C++ dev I know all about Boost, STL, yadda yadda yadda.  C# and Java are still cleaner and have less ways of shooting yourself in the foot. 

 

3) Documentation and tutorials:  Both C# and Java have lots of these.  Java probably has more because it is older and is a common teaching language.  The downside is that if you google "How to do X in Java" you often end up with three different answers, two of which are deprecated by newer features in later versions of Java.  C# is somewhat less crufty from this perspective but with the number of .NET versions, LINQ, XAML, win forms, etc you end up with some of the same issues."

 

 

 

Interesting, so after the replies from this and a few other threads, it seems like C# could be a good choice. What are my best bets for coding/ learning C# on Mac? Mono, and Cocoa? 

post #5 of 5

If you aren't coding specifically for Windows don't bother with C#.  Mono is a poor stepchild compared to the Windows managed runtimes.  Anything anyone says about Obj-C being a single platform language is for all practical purposes the same with C# despite the touting of open source smoke and mirrors.

 

Java isn't going away, but it's not the promised write once run anywhere language either.  It's the only game in town if you want to write for Android devices.

 

Python is great for learning and small script-like projects.  I refuse to do shell scripts anymore, I just write them in easy to read Python.  But anyone that tells you Python is great for anything that will be coded by more than one or two people is ignoring the issues a fully dynamic language brings to the table.  It's a tradeoff, but one that can give you lots of surprises if a project gets to be more than a couple files or couple people touching it.  So you need to use social discipline to instill the predictability that not so dynamically typed languages have built in.

 

C/C++ are the heavyweight industrial languages.  They can do literally everything if you are willing to pay the cost in development + QA time. If you are smart and leave platform specific code out of what you are writing except in some carefully selected files that have the purpose of being Windows/Linux/MacOS specific you are relatively cross platform, or at least as cross platform as you are willing to become when learning the platform specific parts.  LOTS of extra choices are necessary to get it all right.  

 

 

So rather than pick a language first, pick a target platform to play on first.  That will lead you to the right language.   

 

iOS/Mac OS -- go with Obj-C

Windows -- go with C#

Android or server writing -- go with Java

script-ish stuff on Win/Linux/MacOS -- Python

DX games -- C++

OpenGL games --  C++/Obj-C

Platforms like Unity, pick any one of the supported languages

.
Reply
.
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: General Discussion
AppleInsider › Forums › General › General Discussion › C,C++,C#,Java?