Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2008

Tip: Looking for answers? Try searching our database.

What do Java programmers feel is missing from C#?

Thread view: 
mc - 08 Mar 2008 15:26 GMT
I may be opening a can of worms and don't want to start a religious war,
but...

What features of Java do Java programmers miss when working in C#?

Other than, of course, great portability.  C# has more limited
cross-platform portability (Mono).

I'm thinking more about data structures and ways to express algorithms.
Dan Leifker - 08 Mar 2008 23:21 GMT
> I may be opening a can of worms and don't want to start a religious war,
> but...
[quoted text clipped - 5 lines]
>
> I'm thinking more about data structures and ways to express algorithms.

I sort of liked fall-thru in switch statements, but I'm the first to
admit that it can lead to unreadable code.

The Java Language Reference mentions something called a Duff's Device,
which I never really understood and which C# would probably frown on
anyway.  :)

dleifker
mc - 09 Mar 2008 01:11 GMT
>> I may be opening a can of worms and don't want to start a religious war,
>> but...
[quoted text clipped - 8 lines]
> I sort of liked fall-thru in switch statements, but I'm the first to admit
> that it can lead to unreadable code.

Actually, I think the switch statement is the most awkward thing in C#,
largely because it isn't the Fortran-like thing from C that it looks like.
I wish C# had adopted the Pascal case statement.
Dan Leifker - 09 Mar 2008 04:11 GMT
> Actually, I think the switch statement is the most awkward thing in C#,
> largely because it isn't the Fortran-like thing from C that it looks like.
> I wish C# had adopted the Pascal case statement.

But I seem to recall (good grief, I learned Pascal in 1981) that the
Pascal case statement had no default/otherwise/else, right?  Well, I
don't think it did on that creaking Univac we used, but I just Googled
it and and I guess other flavors of Pascal did support it.

See also Brian Kernighan's famous paper about Pascal at:

http://www.cs.virginia.edu/~evans/cs655-S00/readings/bwk-on-pascal.html

One bit of trivia about the Java default (I think) is that it can occur
anywhere in the case sequence, even at the top.

cheers
dleifker
mc - 09 Mar 2008 05:26 GMT
>> I wish C# had adopted the Pascal case statement.
>
> But I seem to recall (good grief, I learned Pascal in 1981) that the
> Pascal case statement had no default/otherwise/else, right?  Well, I don't
> think it did on that creaking Univac we used, but I just Googled it and
> and I guess other flavors of Pascal did support it.

Yes... when I say Pascal I really mean Turbo Pascal and Delphi.  Early
Pascal was impoverished in some ways, as Kernighan pointed out in the paper
you cite.

> http://www.cs.virginia.edu/~evans/cs655-S00/readings/bwk-on-pascal.html
Mishagam - 09 Mar 2008 04:01 GMT
> I may be opening a can of worms and don't want to start a religious war,
> but...
[quoted text clipped - 5 lines]
>
> I'm thinking more about data structures and ways to express algorithms.

I am just esthetically prefer Java. I think Java is simpler language.
There is no properties, no defined operators, no delegates - for me it
makes everything more clear. I know only one language that is comparable
 in transparency - C.
I also liked Java collections Api and general API more - just preference.
Java has checked exceptions and this makes dealing with exceptions more
easy - you mostly know which exceptions you can expect.
JavaDoc - is more clear that C# XML Docs, and in my opinion leads to
better quality API descriptions.
I prefer Java Strict package / folder structure to unclear C# conventions.
Nobody - 09 Mar 2008 22:22 GMT
Well now that just has to be the IDE...  Visual Studio is just so 1990's

>I may be opening a can of worms and don't want to start a religious war,
>but...
[quoted text clipped - 5 lines]
>
> I'm thinking more about data structures and ways to express algorithms.
mc - 10 Mar 2008 04:42 GMT
> Well now that just has to be the IDE...  Visual Studio is just so 1990's

What kind of IDE do you prefer?

>>I may be opening a can of worms and don't want to start a religious war,
>>but...
[quoted text clipped - 5 lines]
>>
>> I'm thinking more about data structures and ways to express algorithms.
Nobody - 12 Mar 2008 05:07 GMT
Give me IntelliJ or Eclipse any day.

>> Well now that just has to be the IDE...  Visual Studio is just so 1990's
>
[quoted text clipped - 9 lines]
>>>
>>> I'm thinking more about data structures and ways to express algorithms.
mc - 13 Mar 2008 01:33 GMT
> Give me IntelliJ or Eclipse any day.

And what do you feel are their advantages over Visual Studio?

>>> Well now that just has to be the IDE...  Visual Studio is just so 1990's
>>
[quoted text clipped - 9 lines]
>>>>
>>>> I'm thinking more about data structures and ways to express algorithms.
Harry Walters - 11 Mar 2008 02:05 GMT
>I may be opening a can of worms and don't want to start a religious war,
>but...
>
>What features of Java do Java programmers miss when working in C#?

I miss the slow performance of Java and overall lack of productivity
and the vast amount of crappy offshored leftover code I used to work
on.

I get so much more done in C# it leaves me longing for that crappy
Java environment I left behind.
Robert Larsen - 11 Mar 2008 09:11 GMT
> I miss the slow performance of Java and overall lack of productivity
> and the vast amount of crappy offshored leftover code I used to work
> on.
>
> I get so much more done in C# it leaves me longing for that crappy
> Java environment I left behind.
I did a quick Google search for "java c# benchmark" (try it yourself)
and it seems that it's only that offshored code that is slow and crappy
and not Java itself, because all benchmarks I could find concludes that
Java is way faster than C#.
mc - 11 Mar 2008 15:19 GMT
> I did a quick Google search for "java c# benchmark" (try it yourself)
> and it seems that it's only that offshored code that is slow and crappy
> and not Java itself, because all benchmarks I could find concludes that
> Java is way faster than C#.

Well, this one:

http://www.manageability.org/blog/archive/20030520%23p_the_problem_with_cameron

is the first one that comes up, but obviously something has gone wrong.  A
factor of 7700 speed difference?  They're just not measuring the same thing.
If C# were 7700 times slower than Java, it would be unusable.

I'm going to explore this and see what I can find out.  A quick test shows
that his C# program is indeed woefully slow.
mc - 11 Mar 2008 16:14 GMT
>> I did a quick Google search for "java c# benchmark" (try it yourself)
>> and it seems that it's only that offshored code that is slow and crappy
[quoted text clipped - 11 lines]
> I'm going to explore this and see what I can find out.  A quick test shows
> that his C# program is indeed woefully slow.

Quick preliminary answer:  Both of the programs measure the time taken to
*compile* a regex, not the time taken to run it.  The two compilers are
probably doing very different things.
Harry Walters - 12 Mar 2008 03:01 GMT
>>> I did a quick Google search for "java c# benchmark" (try it yourself)
>>> and it seems that it's only that offshored code that is slow and crappy
[quoted text clipped - 15 lines]
>*compile* a regex, not the time taken to run it.  The two compilers are
>probably doing very different things.

It's like dude went very far out of the way to find some bizarre
benchmark to suit his goal.  Who uses compiled regexs in c#
applications?
mc - 12 Mar 2008 03:22 GMT
...
>>> I'm going to explore this and see what I can find out.  A quick test
>>> shows
[quoted text clipped - 7 lines]
> benchmark to suit his goal.  Who uses compiled regexs in c#
> applications?

I do, in a tokenizer -- I compile a handful of them and then use each of
them thousands of times.  Nobody compiles a million different regexes and
uses each of them only once.
BobJ - 29 May 2008 18:30 GMT
I never met a benchmark I didn't like.
BobJ

>>>> I did a quick Google search for "java c# benchmark" (try it yourself)
>>>> and it seems that it's only that offshored code that is slow and crappy
[quoted text clipped - 21 lines]
> benchmark to suit his goal.  Who uses compiled regexs in c#
> applications?
Jeremy - 19 Jun 2008 16:22 GMT
I don't think this guy knows what he's doing.   There's no possible way "c#"
is that much slower.  I doubt it's even slower at all.  And besides, c#
doesn't have a speed. it's only language.  It gets compiled to msil.  you
could time the execution of msil, but not c#.  If he was really interested
in doing a proper test, he would have at least run a profiler on each peice
of code to figure out where the time was spent.

Additionally, this nitwit makes the comment that the c# took more lines of
code than the java.  Not that it really matters, but if it did, it's
probably because in the java version he combined several statements on to
single lines, where he didn't in c#.

>I never met a benchmark I didn't like.
> BobJ
[quoted text clipped - 26 lines]
>> benchmark to suit his goal.  Who uses compiled regexs in c#
>> applications?
mc - 11 Mar 2008 15:08 GMT
> I get so much more done in C# it leaves me longing for that crappy
> Java environment I left behind.

Ah, the fast pace of modern life :)

Likewise, a whole generation of office workers longs for the days of snail
mail instead of e-mail, so that we would actually be allowed some *time* to
do our work :)
Harry Walters - 12 Mar 2008 03:02 GMT
>> I get so much more done in C# it leaves me longing for that crappy
>> Java environment I left behind.
[quoted text clipped - 4 lines]
>mail instead of e-mail, so that we would actually be allowed some *time* to
>do our work :)

Those guys are called COBOL programmers, and they make the big bucks
:)
Maarten Bodewes - 23 Mar 2008 17:21 GMT
> I may be opening a can of worms and don't want to start a religious war,
> but...
[quoted text clipped - 5 lines]
>
> I'm thinking more about data structures and ways to express algorithms.

Ehm, the main thing about Java is that it tries to keep out feature
creep. So what I'm missing in C# is any constraint to keep features out.

It's starting to look as another D language, in which you can do
anything. That's fine if you are a single programmer that does not care
about reuse or refactoring, but it's madness for enterprise code.

That you still have to take care to make things "virtual" is another
thing I'm really missing.

In other words: KISS (keep it Simple, stupid) is missing.

That's not to say that C# does not have a lot of things going for it,
some features are very useful, like checked code fragments (which, of
course, should have been the default, just like the virtual keyword).

Maarten


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.