.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 14th, 2003, 11:11 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 64
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
But which is better, Java or C#..

Hi all,

I have been reading through this forum and 'C# is Java' came up a lot in one particular thread, so which is better :S. I'm quite up for learning and so.. Java or C# is my question. There both looking pretty interesting.

Have fun everyone,
mark.

Reply With Quote
  #2  
Old June 14th, 2003, 10:40 PM
icrf's Avatar
icrf icrf is offline
Perl Monkey
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2003
Location: the far end of town where the Grickle-grass grows
Posts: 1,857 icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 10 h 43 m 49 sec
Reputation Power: 104
Send a message via AIM to icrf
I would say, at this point, it depends on your platform. If you're okay with MS and their products (many people have religious-like zeal against anything the corporation is so much as loosely affiliated with) and plan to run on a windows platform, then I'd say you'd be hard pressed to go wrong with C#. It has VB's renouned forms for increadibly easy interface creation, and really looks a lot like java at the code-level. It is a fully-functional and featured language, and once you get the hang of the Visual Studio IDE, you can have very rapid development quite easily.

On the flip side, java is ported everywhere, will run on any system. Characters are always two bytes to insure that it supports any language's character set. It's been around longer and is more mature. As for the internet, JavaScript is an easy pick-up and a must for almost all client-side activity. Applets and Servlets are at your disposal, as well. They support XML web services, too, but it's more costly licensing for a company (I think, really not very sure).

If you get to know one language, you will have absolutely no problem picking up the other. I'd say it really boils down to platform. If you need stuff to run in something other than windows, stick with java. The open C# compiler (mono?) has been mentioned, but if you're developing a significant portion in *nix, forget C# for now. Language maturity can be worked with, but couple that with compiler maturity issues, too, and it's likely to get hairy.

I should also mention that I've only loosely worked with both languages and am as far from an authority as could be. I've done background research on the two in the last six months, but haven't spent more than a few weeks programming in either. I'm a man of C/C++/Perl (especially that last one).
__________________
Andrew - Perl (and VB.NET) Monkey

Never underestimate the bandwidth of a hatchback full of tapes.

Reply With Quote
  #3  
Old June 15th, 2003, 07:55 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 64
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Ah, I think i'll stick to Java then. A, because of as you mentioned its ported to ever platform and B, simply because it seems to be alot more desirable on the job front .

Thanks a lot for your help, easy to understand and got the point accross.

Ta,
Mark.

Reply With Quote
  #4  
Old June 15th, 2003, 12:31 PM
fetcher fetcher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Portugal
Posts: 106 fetcher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 11 m 33 sec
Reputation Power: 7
Well saying that Java advantage is that it runs in all platforms is mostly true but everyone knows that ensuring your Java applications/applets/etc work on each platform is an absolute nightmare.
To me C# is better than Java. Sun was the pioneer of Java and microsoft looked at its records and said, let's keep this, enhance that, and get rid of this and so on, making C# a modern new language. And things you take 2h to do in java takes 15 minutes with C#....
Where's overloading, pointers, preprocessor directives, delegates and deterministic object cleanup in Java?
I'm starting to think that the only real advantage of Java is portability(although it can be a nightmare).. because with C# you can do everything Java does and do it easier and in less time(and maybe better). And I won't even mention JSP6Servlets Vs. ASP.NET because every independent study have said everything about it...

One of the first things I saw in C# that got me interested in it: read/write properties:

Code:
Java:

public int getSize() {
	return size;
}

public void setSize (int value) {
	size = value;
}

C#:

public int Size {
	get {return size;
	}
	set {size = value;
	}
}


"relationship between a get and set method is inherent in C# while has to be maintained in Java." It just makes your life easier

you can find more examples like that here:
http://genamics.com/developer/csharp_comparative.htm

if you just want the conclusion:

"I hope this has given you a feel for where C# stands in relation to Java and C++. Overall, I believe C# provides greater expressiveness and is more suited to writing performance-critical code than Java, while sharing Java's elegance and simplicity, which makes both much more appealing than C++."

About the job market if you have been paying attention lately you'll notice the fast increase of jobs asking for C#/.NET skills, thus giving you a hint where the future is heading

Reply With Quote
  #5  
Old June 15th, 2003, 05:05 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 64
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
You make a good point, especially with the development time, although Python still beats both hands down on that front.

Your code snippets were very interesting, I did note that C# seem's to use less code than Java which is always a good thing! Another thing I seem to have picked up is that compiling C# is easier than using the command line to compile Java?

Maybe when Mono is more mature it will make sence to use C# for multi platform development..

I've looked at ASP.Net and JSP before and the one advantage I've seen is that JSP has over ASP is that ASP.NET can only be run on windows servers where JSP runs on multiple server on multiple OS. If only Microsoft would make a cross plaform version of ASP then i'd consider using it, simply because it looks very interesting!

As for jobs I havn't seen any advertised but i'll look into that more closely before I make the final choice over which one to learn next!

Thanks alot for the advise!
Mark.

Reply With Quote
  #6  
Old June 17th, 2003, 02:31 AM
Nem Nem is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 109 Nem User rank is Private First Class (20 - 50 Reputation Level)Nem User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
I’ve done a fair bit of programming in both Java and C# and I’d have to say that the only reason I’d ever consider using Java is for cross platform compatibility. C# is faster to develop in (especially GUI design), has a better IDE then any of the various Java IDEs out there, can perform lower level operations (fixed statements and unsafe code), is a hell of a lot faster and comes with one of the most comprehensive runtimes I’ve ever seen. Quite literally anything you could ever want to do is built into the .NET framework. All this with the beauty of OOD that is Java and you can’t go wrong.

I think C# definitely has a bright future and if you already know Java you should have no problem picking up C# in no time so if cross platform compatibility isn’t an issue I’d say give C# a try.
Comments on this post
BaronVonDoppleG agrees!

Reply With Quote
  #7  
Old June 29th, 2003, 05:04 PM
vb.net vb.net is offline
Demonic Swordsman DGQB
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Apr 2003
Posts: 1,022 vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 17 h 23 m 11 sec
Reputation Power: 78
fetcher: I never understood the PROPERTY thing. You wrote:

Code:
C#:

public int Size {
	get {return size;
	}
	set {size = value;
	}
}


but where does the variable value come from?

In java, it's clear because it's passed on as a parameter (int value).

I am still confused about the property property of Microsoft languages, and frankly, I really don't like it. But maybe I will like it once I understand it

Reply With Quote
  #8  
Old June 30th, 2003, 01:02 PM
Nem Nem is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 109 Nem User rank is Private First Class (20 - 50 Reputation Level)Nem User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
'value' is a keyword in C#, when you set a property in C# 'value' contains the value that was sent to the set procedure, it can be anything (value or referance).

Usually you declare a variable and a property to control read write acces such as:
PHP Code:
private int iSize;
public 
int Size
{
    
get
    
{
        return 
iSize;
    }


This will allow you to only read the iSize variable outside the class.

It's also very useful for when you want something to happen when a variable is assigned to. ie:
PHP Code:
private int iID;
public 
int ID
{
    
get
    
{
        return 
iID;
    }
    
set
    
{
        
iID value;
        
lblCurrentID.Text iID.ToString();
    }


The above lets you get or set the current ID, but when you set the ID the label lblCurrentID is updated to display the current ID.

Reply With Quote
  #9  
Old June 30th, 2003, 04:17 PM
fetcher fetcher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Portugal
Posts: 106 fetcher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 11 m 33 sec
Reputation Power: 7
in C# a property may have a get and/or set accessor associated with it. C# automatically provides the variable value which holds the new value to which the property can be set

Code:
class Car {

   int size;

   public Car(int size) {
      this.size = size;
   }

   public int Size {
      get { return size; }
      set { size = value; }
   }
}


to use it...

Code:
Car c = new Car(10);

Console.WriteLine("Car size is: " + c.Size); // displays 10

c.Size = 12;

Console.WriteLine("Car size is: " + c.Size); // displays 12



vb.net:
I hope that now the property property of Microsoft languages isn't confusing anymore. It is simpler once you get it

Last edited by fetcher : June 30th, 2003 at 04:24 PM.

Reply With Quote
  #10  
Old July 1st, 2003, 07:52 PM
vb.net vb.net is offline
Demonic Swordsman DGQB
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Apr 2003
Posts: 1,022 vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 17 h 23 m 11 sec
Reputation Power: 78
Thanks guys. It cleared up a few things for me.

The thing that gets me the most is this:

Code:
get
    {
        return iID;
    }


get return iID? Why not just GET ID or RETURN ID? Two consecutive verbs = bad programming syntax!

Reply With Quote
  #11  
Old July 2nd, 2003, 04:50 PM
fetcher fetcher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Portugal
Posts: 106 fetcher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 11 m 33 sec
Reputation Power: 7
vb.net:

Quote:
get return iID? Why not just GET ID or RETURN ID? Two consecutive verbs = bad programming syntax!


dude..... you must be kidding right? Or you are another one of those people that get blind with their anti-microsoft way of living?

inside the get you can have many more stuff than just a return.....so ummm where's the problem?

people say Java is an "evolution" of C+ and C# is an "evolution" of Java => C# kicks Java a$$!! in an elegant, beautiful, simple, eficient way

Reply With Quote
  #12  
Old July 3rd, 2003, 11:01 AM
icrf's Avatar
icrf icrf is offline
Perl Monkey
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2003
Location: the far end of town where the Grickle-grass grows
Posts: 1,857 icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level)icrf User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 10 h 43 m 49 sec
Reputation Power: 104
Send a message via AIM to icrf
As a language, I think C# is better than Java, but there's more to programming in something than just the language itself. Platform is a big thing. No, I'm not spouting off about java's super portability, though that is part of it. It's the whole package, the compiler, the runtime, support, following...and there's a lot more subjective points in there. No one language is completely better than another. Cobol is worlds better than Java/C# for what it did.

Reply With Quote
  #13  
Old July 3rd, 2003, 12:21 PM
vb.net vb.net is offline
Demonic Swordsman DGQB
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Apr 2003
Posts: 1,022 vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level)vb.net User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 17 h 23 m 11 sec
Reputation Power: 78
Quote:
Or you are another one of those people that get blind with their anti-microsoft way of living?


In fact, you couldn't be more wrong. I am a huge supporter of Microsoft, probably the biggest you will find in these forums.

Quote:
inside the get you can have many more stuff than just a return


Like what? show some examples, because the books made it look like RETURN was the only thing to do.

Reply With Quote
  #14  
Old July 3rd, 2003, 12:27 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 64
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Platforms..

Ok i never got this about Java, The idea seemed to be that Java apps run the same on all platforms but.. Java can only run where an VM will run, and then you get problems with VM types, versions, memory etc. surly it isn't any more platform indepent than, well i would say perl but i know sometimes you have to chnage code so it will run on other platform. so that aside, if C# is better than Java language wise, and has a growing following, why use Java?

Mark.

Reply With Quote
  #15  
Old July 3rd, 2003, 03:04 PM
fetcher fetcher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Portugal
Posts: 106 fetcher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 11 m 33 sec
Reputation Power: 7
I agree 100% with netytan

vb.net:
I'm sorry I thought you were all anti-microsoft.

Anyway about the get accessor, I couldn't find any example so I posted the question in another forum and someone posted this:



Definitely can. For example:

Code:

protected override RenderPathID RenderPath

		{

			get

			{

				if (IsDesignMode)

				{

					return RenderPathID.DesignerPath;

				}



				if(RenderType==RenderType.Default)

				{

					if (_BrowserLevelChecker.IsUpLevelBrowser(Context))

					{

						return RenderPathID.UpLevelPath;

					}

					return RenderPathID.DownLevelPath;

				}





				if(RenderType==RenderType.Uplevel)

				{

					return RenderPathID.UpLevelPath;

				}

				else

				{

					return RenderPathID.DownLevelPath;

				}

			}



		}


So there you go vb.net

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > But which is better, Java or C#..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT