10 Replies - 3652 Views - Last Post: 14 February 2011 - 01:43 PM

#1 NantucketSleighride  Icon User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 108
  • Joined: 13-February 11

Getting started with either Java or C#

Post icon  Posted 13 February 2011 - 01:34 PM

*
POPULAR

Hey. I just found this place doing a google search and it looks like the most active programming forum I can find.

So, here's my issue. I'm not a programmer. I've used VB6.0 since maybe 1999/2000, and I've really just mucked around with it and had fun. I took one beginner course in computer programming (we used Java a bit) which was really just the basic ideas of programming - what's a loop, a variable, syntax, recognizing errors, snippets of code that we had to figure out what it would do; but not in an actual language, but more in syntax terms.

So. I have some background with programming. I get the basic things, what a variable is, loops, if statements, etc - although I never got far enough to use classes or objects, those always confuse the crap out of me. As for variables, I always just created global variables because I could not figure out why I'd want to hide it, instead of just being able to alter and read it any time I wanted to. I'm also used to to just plopping down a control and writing code in it, which you don't do with Java - heck, I wouldn't know how to make a simple button.

Now I'm at the point where I'd like to jump back into a little bit. My learning time is limited with 2 kids and full time work, but I've decided that C# or Java looks like a good language to learn. I only have time to learn one, and I just want to learn how to properly program, and in the end work on some little ideas I have.

I've installed Visual C# Express 2010 and the Java JDK and Eclipse. I've found a good basic youtube tutorial that I'm using by some Bucky guy. It gives the basics of Java syntax and how to print stuff out to the screen, or use a scanner to get input. C# I've fiddled with, but it's a little confusing because do I write a console app or a windows app? It seems all the tutorials use the console, but it seems the windows app would be the most useful.

So I'm posting this on the Java forum because I'm leaning towards Java. It appears both are excellent, but Java looks to be a little more accessible and friendly. The idea, though, is to learn just one language and use that for my projects - most of which are game ideas. Now mostly when I've seen Java, it's on a webpage, but I know Minecraft is a regular downloadable game running on my computer, so I know Java can run stuff on a client computer, and not have to be on some server played online.

That's my background - and I wanted to get some tips:

C# or Java? I ask here because I'm leaning towards Java, but I'm sure a lot of you have moved on to or used c# as well. I don't want or have the time to learn both. I want to stick to one and that will be what I use. I'm just doing it as a hobby.

Where do I begin? There are so many tutorials, and it seems they all got through the basics - which I pick up quickly, but then it starts to get confusing with classes, methods, objects, and then just odd math stuff. How did you go about getting better? I guess learn the basic bits and drill them in by making programs over and over until I can write it all with just my knowledge, and not have to look at anything and then move on? Just keep pushing through?

Any great/good beginner places you know online? I prefer not to use books, but to use online tutorials in the forum of webpages or videos (like youtube).

I don't plan on making any games soon; I want to learn the basics and learn how to program. I know that means making "Hello World!" and "Enter your Name"/"Enter the first number" programs and simple things like that for quite a while. I want to get started in the right direction. The first choice is the hardest, because it really defines what direction I go in, and what I'm going to be using for the next several years.

This post has been edited by Dogstopper: 13 February 2011 - 02:28 PM
Reason for edit:: Featured


Is This A Good Question/Topic? 7
  • +

Replies To: Getting started with either Java or C#

#2 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2876
  • View blog
  • Posts: 11,051
  • Joined: 15-July 08

Re: Getting started with either Java or C#

Posted 13 February 2011 - 01:52 PM

Where do I begin? I'm a Java guy, but am most certainly familiar with C# as well, and overall, they are extremely similar. C# is very commonly associated with Visual Studio and its drag-n-drop capabilities in a GUI editor. In Java, there is not yet a GUI generator that produces clean enough code to use well. We Java guys prefer to write our GUIs from scratch.

Since there are a ton of C# guys that will respond to this, I'll take the Java side of things. Here are some reasons why you should use Java:
  • Used in education (so it's easy to learn).
  • Massive standard library.
  • Object Oriented
  • Cross platform. Both code and compiled executables will work on any platform (that has a machine for it).
  • Online tutorials are endless and the Java help at DIC is fantastic.
  • Applications, applets, and servers are frequently written in Java.
  • It's fast. The Java Virtual Machine (JVM) has been optimized to an extent where it runs as fast, if not faster than many other languages.
  • High level. You don't have to worry about low level things like memory access.


I have written an overview on my site:
http://thousandcodes...asics/intro.php

I'm also going to move this to Software Development so that you won't get one-sided Java-only answers.

:)
Was This Post Helpful? 3
  • +
  • -

#3 DivideByZero  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 238
  • View blog
  • Posts: 551
  • Joined: 02-December 10

Re: Getting started with either Java or C#

Posted 13 February 2011 - 02:08 PM

This thread will help you decide http://www.dreaminco...should-i-learn/
Was This Post Helpful? 1
  • +
  • -

#4 moobler  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 143
  • View blog
  • Posts: 224
  • Joined: 21-January 11

Re: Getting started with either Java or C#

Posted 13 February 2011 - 02:10 PM

I have done very little in C# and a great deal in Java, so my answer may be a bit biased ;)

It seems that your main hangup with objects and classes and such comes from not understanding the concepts of object-oriented programming. Both Java and C# (as well as all flavors of VisualBasic) are object-oriented programming languages. Once you've learned what classes and objects are and how to use them, then switching between object-oriented languages becomes much easier. You may only have time to learn one language, but once you understand the underlying concepts you should be able to switch to the other language fairly easily if you change your mind in the future.

Here is a good place to start for object-oriented programming: OOP: Fundamental concepts and features

For me, the main benefit of Java is that almost anyone can run a Java program. If you write a C# program, then the only people who can use it are those who have the .NET framework installed on a Windows machine. With Java you can compile it once and run it on Windows, Mac OS, Linux, or any other platform for which you can download a Java Runtime Environment.
Edit: Clarified the above paragraph.

Now if your main goal is to learn how to make video games, then you may want to use C# instead. While Java has some third-party support for OpenGL graphics, C# has DirectX and the XNA framework to work with.

Whatever the case is, I would suggest starting off with a project goal. Whether that goal is to search for a file on your hard drive, download a file from the internet, or make an interactive tic-tac-toe game, choose something that you can't do and then try to do it.

Once you have an idea, break it down into small parts:
For a tic-tac-toe game I first need to show a window on screen.
Then I need to draw some lines on it.
Then I need to detect when the user clicks on a space.
Etc.

Each of those small parts will be a good learning experience. Whenever you get stuck or even if you finish without problems, post your code here. There are usually plenty of people willing to look over your program and point out design flaws or poor programming practices.

This post has been edited by moobler: 13 February 2011 - 04:02 PM

Was This Post Helpful? 4
  • +
  • -

#5 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: Getting started with either Java or C#

Posted 13 February 2011 - 02:42 PM

I've programmed in the past with both Java and C#.

I'm going to be advocating for C#. Using C#, going from idea to an actual program is dead fast. Things like Entity-Framework and Linq make using a database very easy and Windows Forms/WPF give you access to amazing controls that will let you create nice looking GUI's.

Pro's of C#:
  • Linq
  • Amazing development tools bar none.
  • Tightly integrated to the Windows platform giving you very native looking applications.
  • Lots of helpful guys in the C# subforums here ;)
  • High level language, don't have to worry about managing memory.
  • Lots of open source projects at Codeplex.
  • With Mono you can run your applications on Linux/Mac as well (with some limitations).



As for web applications, ASP.Net is a very robust and dev-friendly platform to code on. MVC3 has come out recently and that gives you even more leverage.

Games you say? XNA is used to create XBox 360 marketplace games, and guess what language you can use? C#. Yep, as you can see, if you learn C# there is tons of room to apply that knowledge.

It all comes down to what platform you're planning to target. If you are going to be creating applications for Windows, use C#. It just works with no hassle.

There's a member here called tlhIn'toq (never can remember his name correctly), he'll post his usual response full of amazing links that will push you along.

For your first book, I recommend reading Head First C#. It's fun and more importantly you see results which in turn make you want to learn more.

Posted Image

View Postmoobler, on 13 February 2011 - 05:10 PM, said:

For me, the main benefit of Java is that almost anyone can run a Java program. If you write a C# program, then the only people who can use it are those who have the .NET framework installed on a Windows machine.


This is no different to downloading the JVM on a client machine. I wouldn't count that as a pro against C# since they both have the same requirements.

This post has been edited by Sergio Tapia: 13 February 2011 - 02:45 PM
Reason for edit:: Fixed the name for you

Was This Post Helpful? 2
  • +
  • -

#6 moobler  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 143
  • View blog
  • Posts: 224
  • Joined: 21-January 11

Re: Getting started with either Java or C#

Posted 13 February 2011 - 04:06 PM

View PostSergio Tapia, on 13 February 2011 - 04:42 PM, said:

View Postmoobler, on 13 February 2011 - 05:10 PM, said:

For me, the main benefit of Java is that almost anyone can run a Java program. If you write a C# program, then the only people who can use it are those who have the .NET framework installed on a Windows machine.


This is no different to downloading the JVM on a client machine. I wouldn't count that as a pro against C# since they both have the same requirements.

Sorry, I worded that statement poorly. I didn't mean to imply that Java doesn't need a native interface to be downloaded and installed, just that it can run on multiple platforms.

I reworded it to (hopefully) be more clear.
Was This Post Helpful? 0
  • +
  • -

#7 NantucketSleighride  Icon User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 108
  • Joined: 13-February 11

Re: Getting started with either Java or C#

Posted 13 February 2011 - 07:14 PM

Thanks for the ideas, guys. It's a hard choice for me to make because I want to stick with one while I learn it, and it seems like a fairly big decision.

I have both installed already, but I think I'll stick with c# right now; it seems to make the most sense for me. I'm completely on windows, and I doubt I'll even release any sort of program for anyone else to use - so multiplatform doesn't seem like a necessity for me; also the layout of it all seems like perhaps it'll be easier to pick up. I do mostly plan on working with making games once I start getting all the basic ideas (albeit, ascii type stuff is my main interest right now, so graphics don't really matter[I've an interesting Ascii RPG idea]).

Thanks for the input. I'll be around here a bit, hopefully, trying to figure it all out - and this seems like a really good community for getting help and feedback.

This does lead me to one final question, though: do I start learning via Console applications or Windows Form Application applications? All I know is that console basically runs stuff in a console window, and that the other runs it in a regular Windows window. I mean, it seems like in console I'd be using stuff like Console.Writeline("Hey"); as opposed to things like Label1.Text="Hey", which is fairly different.

This post has been edited by NantucketSleighride: 13 February 2011 - 07:21 PM

Was This Post Helpful? 0
  • +
  • -

#8 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: Getting started with either Java or C#

Posted 13 February 2011 - 07:50 PM

Learn the basic C# juicyness by using a Console application first, that way events and other GUI things don't get in the way yet. After you feel familiar with OOP and C#, start using Windows Forms. I can't recommend enough that you read Head First C#, it'll give you a nice path to start out with.
Was This Post Helpful? 2
  • +
  • -

#9 Justin3085  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 31
  • Joined: 20-December 09

Re: Getting started with either Java or C#

Posted 13 February 2011 - 09:37 PM

I've been poking around with both also the past few months. I just got finished with a Java course and it all started with console stuff and worked into building GUI's. I also started using C# during this course and did the same console apps I was creating in Java.

I like both languages, but I'm leaning more onto C# for now only because I like using VS2010. I keep messing around with both when I have the time. Great place for advice though so add it to your bookmarks! :)
Was This Post Helpful? 0
  • +
  • -

#10 SpeedisaVirus  Icon User is offline

  • Baller
  • member icon

Reputation: 114
  • View blog
  • Posts: 855
  • Joined: 06-October 08

Re: Getting started with either Java or C#

Posted 14 February 2011 - 11:18 AM

It really is sort of a toss up scenario. C# is everything Java is plus some great things that Java should have. On the other hand, the documentation for the Java language is incredible. Something MSDN cannot say (with as much confidence). C# has the better development tool in my opinion on the flip side of that. Can't go wrong either way.
Was This Post Helpful? 0
  • +
  • -

#11 DivideByZero  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 238
  • View blog
  • Posts: 551
  • Joined: 02-December 10

Re: Getting started with either Java or C#

Posted 14 February 2011 - 01:43 PM

I actually asked a very similar question to this a couple of months ago here http://www.dreaminco...8-c%23-or-java/
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1