473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

C# and VB.NET comparison

I've created a quick reference comparison of C# and
VB.NET that you might find useful. I couldn't find
anything like it on the web and so I made my own.

http://www.harding.edu/USER/fmccown/...t_csharp_compa
rison.html

It doesn't cover every area of the languages, just those
features most frequently used.

I also created a Java and C# comparison:

http://www.harding.edu/USER/fmccown/..._csharp_compar
ison.html

I'd be thankful for any suggestions you may have on ways
to improve the comparisons.

Thanks,
Frank
Nov 15 '05 #1
1 2886
Frank McCown <mc*****@yahoo.com> wrote:
I also created a Java and C# comparison:

http://www.harding.edu/USER/fmccown/..._csharp_compar
ison.html

I'd be thankful for any suggestions you may have on ways
to improve the comparisons.


You've fallen into the "objects are passed by reference" trap for Java
and C#. Please read
http://www.pobox.com/~skeet/csharp/parameters.html
I can't remember offhand whether or not Java is getting variable
parameter lengths in 1.5, but it may well be.

Picky things:

o Constants in Java are usually declared to be static. (It's implicit
in C#)

o Under enumerations, I believe the preferred order for modifiers is
"public static final int", although it doesn't matter too much. It
might also be worth mentioning that Java is getting enumerations in
1.5.

o Under arrays, in Java you can write:
int[][] x = new int[5][3];
but you can't do the same thing (with jagged arrays) in C#.

o Under foreach, it may be worth mentioning that Java is getting
foreach (in the form "for x : collection") in 1.5. The usual equivalent
of foreach would be done using an Iterator though.

o Under "choices", your code would give a warning under Java 1.4 (due
to the fallthrough).

o Under exception handling, not only is the argument itself entirely
optional in C#, but you can also get rid of *just* the variable name.
It would also be worth mentioning that C# (and .NET in general) doesn't
have checked exceptions.

o Under namespaces, your import statement is incorrect in Java - it
should either be "import Harding.Compsci.Graphics.*;" or
"import Harding.Compsci.Graphics.ClassName;". You might also want to
change the package name to "harding.compsci.graphics" to follow Java
conventions for the Java version.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS...
29
by: Steven D'Aprano | last post by:
Playing around with comparisons of functions (don't ask), I discovered an interesting bit of unintuitive behaviour: >>> (lambda y: y) < (lambda y: y) False Do the comparison again and things...
5
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit...
46
by: yadurajj | last post by:
Hello i am newbie trying to learn C..I need to know about string comparisons in C, without using a library function,...recently I was asked this in an interview..I can write a small program but I...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS...
37
by: spam.noam | last post by:
Hello, Guido has decided, in python-dev, that in Py3K the id-based order comparisons will be dropped. This means that, for example, "{} < " will raise a TypeError instead of the current...
7
by: bcutting | last post by:
I am looking for a way to take a large number of images and find matches among them. These images may not be exact replicas. Images may have been resized, cropped, faded, color corrected, etc. ...
0
by: SvenMathijssen | last post by:
Hi, I've been wrestling with a problem for some time that ought to be fairly simple, but turns out to be very difficult for me to solve. Maybe someone here knows the answer. What I try to do is...
1
by: Lars B | last post by:
Hey guys, I have written a C++ program that passes data from a file to an FPGA board and back again using software and DMA buffers. In my program I need to compare the size of a given file against...
11
by: Andrus | last post by:
I created dynamic extension methods for <= and < SQL comparison operators: public static IQueryable<TLessThanOrEqual<T>(this IQueryable<Tsource, string property, object value); public static...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.