Beta

Slashdot: News for Nerds

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Does C# Measure Up?

Cliff posted more than 10 years ago | from the bring-out-the-byte-meter dept.

Programming 677

An anonymous reader queries: "Windows::Developer is offering a detailed, quantitative examination [free login required] of C#'s performance versus Java, C, C++ and D. 'Overall the results were surprising, although perhaps unexciting, in showing that C# (and to a less extent Java) is, to a good degree, on a par in efficiency terms with its older and (presumed to be) more efficient counterparts C and C++ at least as far as the basic language features compared in this analysis are concerned,' writes the author, Matthew Wilson. I'm only an amateur coder, and confess to not understanding most of the two-part article. I'd love to hear how true programmers view his results, which are too wide-ranging to summarize easily here. How about it Slashdot, as this special edition asks, 'Can C# keep up with compiled languages like C, C++, and D or byte-code based Java?'"

While we're on the topic of C#, rnd() queries: "It's been a while now, since Mono and DotGnu have begun eroding the market power of Microsoft by creating open source implementations of C# and the Common Language Runtime. Over the weekend I loaded Mono and did some informal benchmarking of object creation, intensive message passing, massive iteration, etc., and the results show that Mono is about 90% as fast as Microsoft's implementation after a very short time. I now want to switch my .NET development over to Linux/Mono exclusively, but I want to first settle on a free alternative to Visual Studio .NET 2003. Any suggestions?"

cancel ×

677 comments

No (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#6969952)

No it doesn't. Does this first post?

Re:No (-1, Troll)

Anonymous Coward | more than 10 years ago | (#6970001)

stupid fucking tight ass hippy gnu freek - wanting everything for free!

THATS IT (-1, Flamebait)

Anonymous Coward | more than 10 years ago | (#6970130)

I'm calling Senator McCarthy.

I've had it up to here with you GNU commies advocating free this and overthrowing great bastions of capitalism such as Microsoft and Sun Microsystems

I'm not a subscriber (-1, Offtopic)

Bingo Foo (179380) | more than 10 years ago | (#6969957)

And I get a chance to fail it at FP?

YOU FAIL IT! (-1)

YOU FAIL IT! (624257) | more than 10 years ago | (#6970258)

You have succeeded in FAILING IT! Even if you were a subscriber, a pathetic FAILURE like you would never have what it takes to get the mighty first post!

YOU FAIL IT!

Differences (5, Funny)

fredistheking (464407) | more than 10 years ago | (#6969963)

C# is higher pitch than C but less so than D.

--

I always said (2, Funny)

Microsift (223381) | more than 10 years ago | (#6970133)

C# was Delphi b (best flat sign I could do)

FP (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#6969964)

brr! it's already 2:32AM and still no First Posts ;]

Whoa whoa whoa! (1)

77Punker (673758) | more than 10 years ago | (#6969970)

There's a D? What's next? Eb? Technology is moving at an incredible rate, indeed!

Re:Whoa whoa whoa! (0)

Anonymous Coward | more than 10 years ago | (#6970137)

I think it's important to point out that the letter of the languaged does not, in no way whatsover, represent how advanced or efficient it is.

There was a language called B, and it is in no way related to C. Likewise, C may be better in different implementations than C++.

Re:Whoa whoa whoa! (4, Funny)

jemenake (595948) | more than 10 years ago | (#6970188)

There's a D? What's next? Eb? Technology is moving at an incredible rate, indeed!
Actually, depending upon who you ask, "D" shouldn't be the next in the series. I remember reading somewhere that the "C" got its name because it came after "B"... not in the alphabet, but in the acronym "BCPL", which supposedly stood for "basic combined programming language". (For more info, go read "BCPL to B to C" here [lysator.liu.se] .

So, with that line of thinking, C++ should have been "P" (insert favorite "P Object-Oriented Programming" acronym joke here), and C# (although it shouldn't have been created at all, but was) should have been "L".

Re:Whoa whoa whoa! (2, Funny)

wkitchen (581276) | more than 10 years ago | (#6970324)

So, with that line of thinking, C++ should have been "P" (insert favorite "P Object-Oriented Programming" acronym joke here), and C# (although it shouldn't have been created at all, but was) should have been "L".
"L Object-Oriented Programming"?

There's no D. (-1, Troll)

Anonymous Coward | more than 10 years ago | (#6970254)

The story is a troll and the "D language" was the hint. Cliff has been trolled. Any random dude can register something like windevnet.com and post a hoax there. Slashdot should stick to established sites like nytimes to avoid this kind of crap in the future.

In Java's case ... (2, Interesting)

Anonymous Coward | more than 10 years ago | (#6969971)

Hotspot is really good about compiling bytecodes down to the native machine language. That code is real honest to goodness native code, and will execute at approximately C++ speed.

Why use anything else?

- David

Re:In Java's case ... (3, Insightful)

Bingo Foo (179380) | more than 10 years ago | (#6970002)

Why use anything else?

Templates. [josuttis.com]

Any other questions?

Re:In Java's case ... (5, Informative)

JasonB (15304) | more than 10 years ago | (#6970066)

Java SDK v1.5 (not yet released) contains support for 'generics', which are very much like C++ templates for Java:

http://java.sun.com/features/2003/05/bloch_qa.html [sun.com]

Re:In Java's case ... (-1, Troll)

Anonymous Coward | more than 10 years ago | (#6970107)

I don't care about this Java template vaporware. Talk to us when it is production ready and all the third party tools support it.

Re:In Java's case ... (0)

Anonymous Coward | more than 10 years ago | (#6970192)

you're right. but many others care.

Re:In Java's case ... (1)

pyrrhonist (701154) | more than 10 years ago | (#6970261)

I don't care about this Java template vaporware.

It's not vaporware. There is already an implementation [sun.com] .

Talk to us when it is production ready and all the third party tools support it.

Oh, and C++ support for templates was instantly available.

Third party tools already support it. I have no issues running ant and my ide with the new implementation.

Re:In Java's case ... (3, Funny)

Bingo Foo (179380) | more than 10 years ago | (#6970218)

How are these mythical generics at metaprogramming? If Java eventually gets libraries like Blitz++, Loki, and boost::Spirit, I'll take a look. Oh, but that would require operator overloading, too. Maybe Sun should release the "J2UE" (Java 2 Usable Edition) as a JVM implementation of C++.
</snarky>

Re:In Java's case ... (0)

use_compress (627082) | more than 10 years ago | (#6970098)

Any other questions?

What about the Object [sun.com] class? Having everything (with the exception of native datatypes that can be wrapped into classes) be a descendant of a superclass is a far more elegant solution than using c++'s hackish and syntactically awkward template feature.

Re:In Java's case ... (1)

molarmass192 (608071) | more than 10 years ago | (#6970103)

Templates are in Java 1.5 (see generics) so this argument is moot.

Re:In Java's case ... (2, Insightful)

Trejkaz (615352) | more than 10 years ago | (#6970114)

Yay! All the power of Java's Generics but with 10 times the code bloat.

Re:In Java's case ... (1)

yanestra (526590) | more than 10 years ago | (#6970151)

Why use anything else?

Templates.

Any other questions?

In C++, templates are absolutely necessary. In any other language, they aren't... and not even useful...

Re:In Java's case ... (0)

Anonymous Coward | more than 10 years ago | (#6970165)

Templates are not necessary in Java. Every class instance is a subclass of Object, and primitive types can be wrapped in class instances. Since you can test Object references for subclass membership simply, generic algorithms in Java can be constructed using polymorphism, without any need for a preprocessing kludge like templates.

There is no such universal polymorphism in C++, so it needs templates in order to make generic algorithms possible. Now some people like templates, stylistically, so this feature is going to be added to Java 1.5, but it is not as fundamental to Java as it is to C++.

Re:In Java's case ... (1)

pyrrhonist (701154) | more than 10 years ago | (#6970198)

Templates.
Any other questions?

Generic types [jcp.org] have been added to Java for public release in version 1.5 [sun.com] .
There is an early access release of the compiler [sun.com] for generics.

For those people who want generics now, there is a non-Sun implementation [avayalabs.com] of generic types.

Why do we need C# in the first place? (0, Flamebait)

Anonymous Coward | more than 10 years ago | (#6970235)

When i first heard about C# i thought "Why is M$ making it's own language in the first place?" Then I thought i'd give it a try and I pretty much said "if there is nothing extrordinary about this lanugage then it's pretty much useless. C# would have to be something really great to replace C++ or Objective-C for me.

So i dove into C# and found nothing extrordinary about it. If nothing else it looked like a confusing mix of C++, Java & basic. Well i've been wrong before so i asked my teachers after a meeting with industry bussinesses and their opinion was that "most developers don't want to learn another language just to learn another language that does not offer great benifets." They further said that it most peoples opinion they asked about C#/.NET it has had the exact oposite effect that M$ thought it'd have.

I'd hate to say it but this is clearly M$ making it's own version of something JUST to have it's own version of it. Wake up people!

Re:In Java's case ... (0)

Anonymous Coward | more than 10 years ago | (#6970244)

How big is that JIT compiler, JVM, and the rest of the runtime? My app has to fit into 64K bytes. I can do that with C and C++; any baggage (like the compiler!) remains on my development machine. With Java, the baggage has to come along for the ride for the app to run. If it takes 1.5M bytes to boot "hello world", it doesn't much matter how efficient the JIT compiler eventually makes some small loop.

The time has come for this discussion (-1, Troll)

Anonymous Coward | more than 10 years ago | (#6969974)

Gentlemen, the time has come for a serious discussion on whether or
not to continue using C for serious programming projects. As I will
explain, I feel that C needs to be retired, much the same way that
Fortran, Cobol and Perl have been. Furthermore, allow me to be so bold
as to suggest a superior replacement to this outdated language.

To give you a little background on this subject, I was recently asked
to develop a client/server project on a Unix platform for a Fortune
500 company. While I've never coded in C before I have coded in VB for
fifteen years, and in Java for over ten, I was stunned to see how
poorly C fared compared to these two, more low-level languages.

C's biggest difficulty, as we all know, is the fact that it is by far
one of the slowest languages in existance, especially when compared to
more modern languages such as Java and C#. Although the reasons for
this are varied, the main reasons seems to be the way C requires a
programmer to laboriously work with chunks of memory.

Requiring a programmer to manipulate blocks of memory is a tedious way
to program. This was satisfactory back in the early days of coding,
but then again, so were punchcards. By using what are called
"pointers" a C programmer is basically requiring the computer to do
three sets of work rather than one. The first time requires the
computer to duplicate whatever is stored in the memory space "pointed
to" by the pointer. The second time requires it to perform the needed
operation on this space. Finally the computer must delete the
duplicate set and set the values of the original accordingly.

Clearly this is a horrendous use of resources and the chief reason why
C is so slow. When one looks at a more modern (and a more serious)
programming language like Java, C# or - even better - Visual Basic
that lacks such archaic coding styles, one will also note a serious
speed increase over C.

So what does this mean for the programming community? I think clearly
that C needs to be abandonded. There are two candidates that would be
a suitable replacement for it. Those are Java and Visual Basic.

Having programmed in both for many years, I believe that VB has the
edge. Not only is it slightly faster than Java its also much easier to
code in. I found C to be confusing, frightening and intimidating with
its non-GUI-based coding style. Furthermore, I like to see the source
code of the projects I work with. Java's source seems to be under the
monopolistic thumb of Sun much the way that GCC is obscured from us by
the marketing people at the FSF. Microsoft's "shared source" under
which Visual Basic is released definately seems to be the most fair
and reasonable of all the licenses in existance, with none of the
harsh restrictions of the BSD license. It also lacks the GPLs
requirement that anything coded with its tools becomes property of the
FSF.

I hope to see a switch from C to VB very soon. I've already spoken
with various luminaries in the C coding world and most are eager to
begin to transition. Having just gotten off the phone with Mr. Alan
Cox, I can say that he is quite thrilled with the speed increases that
will occur when the Linux kernel is completely rewritten in Visual
Basic. Richard Stallman plans to support this, and hopes that the
great Swede himself, Linux Torvaldis, won't object to renaming Linux
to VB/Linux. Although not a C coder himself, I'm told that Slashdot's
very own Admiral Taco will support this on his web site. Finally,
Dennis Ritchie is excited about the switch!

Thank you for your time. Happy coding.

But there's just one problem... (-1, Redundant)

77Punker (673758) | more than 10 years ago | (#6969987)

...VB only works on Windows.

Re:But there's just one problem... (2, Informative)

Vaevictis666 (680137) | more than 10 years ago | (#6970015)

Actually VB apps tend to run just fine through Wine, or at least a few little projects I've done in VB have worked for me...

Re:But there's just one problem... (2, Insightful)

javelinco (652113) | more than 10 years ago | (#6970020)

(a) That's not the only problem;
(b) VB isn't the topic; and
(c) That isn't even true.

Wow, none out of three!

Re:But there's just one problem... (-1, Troll)

Anonymous Coward | more than 10 years ago | (#6970037)

(d) You have been trolled!

Re:But there's just one problem... (1)

javelinco (652113) | more than 10 years ago | (#6970065)

Yeah, some day I'll be able to stop myself from doing that. *hangs head in shame*

Punked! (0)

Anonymous Coward | more than 10 years ago | (#6970063)

Hahaha...

Re:But there's just one problem... (1)

Osty (16825) | more than 10 years ago | (#6970049)

Are you sure [go-mono.com] about that? Granted, that's VB.NET, and not VB pre-.NET, but it's still VB. It's also still under development, but the work is being done.

DD# is better (-1, Troll)

Anonymous Coward | more than 10 years ago | (#6969983)

Ben Affleck and Jennifer Lopez went their separate ways on what was supposed to be their wedding weekend. Who pulled the plug on the relationship? Where did the couple really spend their weekend apart? Access Hollywood got all the details on the Bennifer breakup.

On what was to be the start of her wedding weekend, Jen boarded a plane Friday afternoon at Burbank airport without Ben and arrived in Miami later that evening.

Meanwhile Ben, who was rumored to be in Vegas, spent Friday night at Larry Flynt's Hustler Casino in Gardena, Calif.

"I said to Ben, 'You know, the guys here would rather play poker with her than you,'" Larry told Access.

Flynt said Ben stayed at his poker club gambling from around 11 p.m. to 6 a.m. "If she'll call me I'll let her know that he didn't get out of line. He was in really a truly great spirit, an upbeat spirit," said Larry.

On Saturday Jen, no longer wearing her engagement ring, spent the day at Miami Beach with some friends. Although she didn't look it, according to sources Jen was devastated at the news that Ben had broken off their wedding and was said to be in disbelief.

Later that afternoon, Jen reportedly left her heavily guarded Miami compound for pampering at the Mandarin Spa. That evening she enjoyed the nightlife at South Beach.

Ben was spotted Sunday having dinner with friends at the popular Mexican chain restaurant Baja Fresh. According to People Magazine, his decision to end his relationship came after a heart to heart with his mother. Ben seemed to be coping well though. He even stopped to sign autographs on his way out before climbing into his Rolls Royce and heading home.

According to sources, Ben called friends mid-week to let them know that he was going to call off their relationship -- something he would have known when he made the very public appearance with Jen at The Ivy the same day they announced their wedding postponement.

Donald Trump saw the footage and wasn't surprised. "I watched them walking out of that restaurant last night and that didn't look like a love fest, so something happened," Trump told Access.

Over the weekend at the Rosa Cha Fashion Show in New York, Cris Judd, the man Jen was married to before she met Ben, said he knows all too well that relationships can be challenging.

"Marriage is tough as it is, so you have to work at it," said Judd.

At the Edge-Mar Center for the Arts Event, Ben's friend Christian Slater, who reportedly was with Ben for an impromptu bachelor party at a Vancouver Strip Club two months ago, summed up perhaps what the rest of us are thinking.

"I'm pretty 'Bennifried' out. I mean, who gives a flying Affleck, that's what I say," said Slater prior to the breakup.

Jen and Ben timeline

How did the couple who were so in love just days ago end so fast? Access took a look at the timeline of how they became Hollywood's royal couple.

They first got to know each other working on "Gigli," which began shooting in December 2001. Then in March 2002, the first sign of affection came as Ben took out a full-page ad filled with lavish praise for Jen as she was honored as ShoWest Female Star of the Year.

"I just thought I'd write a paragraph saying what a professional, what a decent person I think she is," Ben told Access.

Jen was pleasantly surprised by the ad. "He's a poet. It's beautiful. I mean I was just like, 'Wow." We worked together today, so I saw it and I said, 'Thank you so much for that.' He was like, 'I mean it from the bottom of my heart. We've had a really great working experience together and people should know,'" said Jen.

Keep in mind, Jen was still married to Cris Judd at the time. But in what now may turn out to be the only interview ever of Ben and Jen together, the pair assured us there was no hanky panky.

"When did you fall in love?" Access Hollywood's Pat O'Brien asked the couple in July 2003.

"It was like we became friends first, that is the honest to God truth," said Jen.

"Yeah that is the truth," added Ben.

In April 2002, Jen opened her new restaurant Madre's. It was Ben who came up with that name. She arrived at the opening with Cris, but danced with Ben at the party. Just two months later, Jen and Cris announced they were separating.

"You know, it's just two people, it didn't work out," Judd told Access.

Ben and Jen began dating almost immediately. On July 22, 2002 in New York, Jen introduced Ben as her boyfriend. Two days later, Ben gave her a Harry Winston diamond bracelet worth a reported quarter of a million dollars and brought her a birthday cake on the set of "Maid in Manhattan." The next day Jennifer and Cris' divorce papers were filed.

In August 2002, the pair started shooting the upcoming "Jersey Girl." Then, Jen and Ben shot the "Jenny from the Block" music video where Jen's got a "rock" on her finger that's not "fooling" anyone.

It was indeed an engagement ring that she was wearing and in early November, Access broke the news that they were engaged.

The couple's first public event together was the New York premiere of "Maid in Manhattan." However, they were not interviewed together.

Next up, the radiant couple induced hysteria at Ben's "Daredevil" premiere. Then in July, Ben and Jen fever hit a new high with our exclusive interview with the couple. It was the one and only interview of them together.

Later that month, they rolled up to the "Gigli" premiere in a Rolls Royce. Finally, last Wednesday Jen and Ben made a very public appearance at The Ivy on the same day they announced they were postponing their wedding due to "excessive media attention." That outing may very well have been their last public appearance together.

Re:DD# is better (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#6970004)

you suck. foad.

Alternative to Visual Studio (5, Informative)

Vaevictis666 (680137) | more than 10 years ago | (#6969988)

I now want to switch my .NET development over to Linux/Mono exclusively, but I want to first settle on a free alternative to Visual Studio .NET 2003. Any suggestions?

How about Eclipse? [eclipse.org]

Re:Alternative to Visual Studio (2, Informative)

Anonymous Coward | more than 10 years ago | (#6970145)

Eclipse do not seem to support c# natively (I confess to not having tried the c# plugin).

I would recommend SharpDevelop. I understand work is underway to make it less dependent on WinForms so that it can run under Linux/Mono.

If the original poster was looking for free-as-in-free-beer-IDE's, there's always the personal edition of Borlands C#Builder, as well.

Re:Alternative to Visual Studio (3, Informative)

Glock27 (446276) | more than 10 years ago | (#6970339)

Eclipse do not seem to support c# natively (I confess to not having tried the c# plugin).

AFAIK, all language support in Eclipse is by plugin. You're basically saying you've never tried it, but you advise us to try something else.

Huh?

(I've used Eclipse a bit for Java, and it is excellent. I'm pretty sure it'll be a fine environment for many languages by the time it's all said and done.)

Fsirt Psot? (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#6969991)

Fsirt Psot?

FUCK! Wesley Willis is dead! (-1, Troll)

Anonymous Coward | more than 10 years ago | (#6970011)

I have some sad, if belated, news to report: Wesley Willis died several weeks ago at the age of 40 [geocities.com] from Chronic Myelogenous Leukemia. He battled schizophrenia all his life and never gave up any of his dreams. He drew and wrote such songs as "Cut the Mullet," a song that brought an end to that dastardly haircut. One song includes the lyrics "McDonald's hamburgers are the worst/they are much worse than Burger King.../they serve Quarter Pounders/they will put pounds on you." Other songs include "Casper the Homosexual Friendly Ghost" and "Suck My Dog's Dick". Even if you aren't familiar with his works, you can't deny his contribution to the world. Truly an American icon to be missed.

Rock over London.
Rock on Chicago.

Signing out, yo.

Hmm (0)

Autistic_Treat (704344) | more than 10 years ago | (#6970013)

I referred this question to a colleague of mine, and I have enclosed his findings below for your perusal. http://web.ask.com/web?q=%27Can+C%23+keep+up+with+ compiled+languages+like+C%2C+C%2B%2B%2C+and+D+or+b yte-code+based+Java%3F&o=0&qsrc=0

Re:Hmm (0)

Anonymous Coward | more than 10 years ago | (#6970031)

Thank you very much for your ultra cool link.

I'm holding out for... (0, Offtopic)

obladioblada (689805) | more than 10 years ago | (#6970023)

D flat, damn it.

Re:I'm holding out for... (3, Funny)

ThatDamnMurphyGuy (109869) | more than 10 years ago | (#6970156)

Remember though, C# and Db aren't the same note outside of the well tempered world!

He's serious: D-flat is a programming tool (1)

rfmobile (531603) | more than 10 years ago | (#6970302)

Mod parent up - D-Flat is an actual programming tool. There was a series of articles by Al Stevens on Dr. Dobb's Journal back in the 90's.

http://www.ddj.com/articles/1991/9110/

-rick

Microsoft license prohibits CLR benchmarks (4, Funny)

Anonymous Coward | more than 10 years ago | (#6970038)

Raed it. Ingroe it. Bncehmrak aynawy.

no (-1, Troll)

Anonymous Coward | more than 10 years ago | (#6970041)

no

Visual Studio .Net alternative - SharpDevelop (1, Informative)

ObiWonKanblomi (320618) | more than 10 years ago | (#6970042)

I'm assuming you're asking for an IDE alternative to Visual Studio .Net. Take a look at SharpDevelop [icsharpcode.net] . According to its authors, it's open source under the GPL. I've given it a try on my old P2 300, and it's not bad at all IMO. It takes a little longer to load, but it has solid functionality and tons of features on an interface that looks very familiar to that of Visual Studio .Net

Duh (5, Insightful)

be-fan (61476) | more than 10 years ago | (#6970048)

This really makes sense if you understand how JITs work, and understand the nature of the benchmarks. These benchmarks are mostly microbenchmarks that test a particular operation in a tight loop. JITs can compile this loop once and run it directly on the CPU afterwords. This doesn't extrapolate well to situations where the JIT gets involved more often in the benchmark.

lttile trultte gogo (-1, Troll)

Anonymous Coward | more than 10 years ago | (#6970050)

hehe...logo

VS Alternative (5, Funny)

contrasutra (640313) | more than 10 years ago | (#6970058)

I now want to switch my .NET development over to Linux/Mono exclusively, but I want to first settle on a free alternative to Visual Studio .NET 2003. Any suggestions?

VI. :-D

C,D, I feel bad for the F Programmer.

Re:VS Alternative (4, Funny)

JamesOfTheDesert (188356) | more than 10 years ago | (#6970095)

C,D, I feel bad for the F Programmer.

Ah, but there is F# [microsoft.com]

Re:VS Alternative (1)

yamcha666 (519244) | more than 10 years ago | (#6970190)

As a matter of fact, I actually do that. I am taking C/C++ at college right now. The school has Visual Studio .NET on all of the workstations right now. But when I go home to do the work, I jump right into an Xterm and use vi and g++

Re:VS Alternative (0)

Anonymous Coward | more than 10 years ago | (#6970298)

Not to be rude, but have you had a chance to see what VS .NET offers? Just the great debugger is enough to swear by it after all.

Mono risks (2, Insightful)

alext (29323) | more than 10 years ago | (#6970062)

Mono is a bit faster than Java, for some benchmark?

Well, why didn't you say so before?!

That way we could have avoided all that tedious discussion about IP infringements, functionality etc. in yesterday's [slashdot.org] Mono debate. Clearly some dude's performance figure should override all other considerations when choosing a platform.

Re:Mono risks (0)

Anonymous Coward | more than 10 years ago | (#6970134)

You must be new here. No one on slashdot is at risk for mono.

Can't do it (1)

werdna (39029) | more than 10 years ago | (#6970247)

Microsoft has sought protection for a "programming language and compiler system capable of generating object code that performs comparably or better than C."

Uhm... (4, Funny)

Black Parrot (19622) | more than 10 years ago | (#6970070)


> Overall the results were surprising, although perhaps unexciting, in showing that C# (and to a less extent Java) is, to a good degree, on a par in efficiency terms with its older and (presumed to be) more efficient counterparts C and C++ at least as far as the basic language features compared in this analysis are concerned

Could we have a few more weasel-words in that sentence, please?

Re:Uhm... (1, Informative)

Anonymous Coward | more than 10 years ago | (#6970189)

Had no idea what you were talking about so I looked it up. From College Campus [collegecampus.com] :

Weasel words. If your information is less than conclusive, acknowledge that either in summary or by choosing another argument. But don't undercut your argument with weasel words -- empty palliatives such as "to a certain degree," "it may seem likely that," or "in some cases." If your points are weak, they need no additional burdens. Note how much stronger the following become as the bracketed words drop out:

* [It may even be, as] some experts have hinted that Thomas More was [somewhat] suicidal [anyway].
* Josiah Royce was [to some extent] the Hegel of American philosophy.

Weasel words dilute your thought, and hence your argument.

I don't get it (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#6970078)

Where's my daily SCO story? Two icons for RedHat on front page today, where;s the SCO wrap-up for the day?

jump off the bandwagon (2, Informative)

curtlewis (662976) | more than 10 years ago | (#6970088)

Java has received alot of attention over the last 7 or 8 years or so. It's a great idea in theory, but it falls way short in practice. It does remain viable for a few select uses, though: small widgets, servlets and web app servers. Pretty much other than that, using Java will mean excessive memory usage and slow performance.

Garbage collection in Java is not guranteed. It's what I call Union. It'll clean up when it god damn well feels like it. In the meantime, the system slows to a crawl.

Graphics in Java are abysmally slow. Even basic UIs lack the speed and responsiveness of GUIs written in C, C++ or similar languages.

Java was supposed to be: Write once, run anywhere, but what it is in reality is: Write once, debug everywhere... over and over and over. Or perhaps more appropriately it is" Write once, run screaming.

I've worked in a variety of Java development projects in the past and not once has it ever risen to the task to show itself as a worthy choice and/or a mature language. Instead it has invariably wasted companies time and money. Primarily because they failed to realize that Java is a small task tool, not suitable for major applications or those requiring performance.

I know a lot of engineers like Java because it makes life easier for them by doing things for them, but those things it does it does very poorly.

I'm sure I'll be marked as flamebait or troll by some Java loving mod, but what I've stated are facts and experiences from real life Java development. The results are in and frankly... Java sucks! Stick with C and C++ for most development, there's a reason they are the standard: they work.

Re:jump off the bandwagon (3, Interesting)

trompete (651953) | more than 10 years ago | (#6970139)

to add....

GUI development isn't that bad in Visual Studio. In fact, it is easy as hell. With emulators like Wine available, it makes sense to develop the software with Visual Studio and its amazing debugging tools for WINDOWS and then use Wine to run it on Linux.

One could use the GTK and GNU-C to develop multi-platform software in the first place, but then you are dealing with the parent poster's problem of debugging on multi-platforms, not to mention that GTK sucks under Windows (Anyone else use GAIM?)

Re:jump off the bandwagon (-1, Redundant)

Anonymous Coward | more than 10 years ago | (#6970142)

ditto!

Re:jump off the bandwagon (5, Informative)

Cnik70 (571147) | more than 10 years ago | (#6970168)

You apparently haven't taken the time to work with any of the newer releases of java (1.3 and 1.4). Java is a very mature and worthy language, especially when it comes to developing non platform dependent applications. I prefer java since I CAN program it on a Linux box, transfer it to a windows, mac or even a mainframe and the program will still run exactly the same without changing a single line. lets see c, c++, .Net or c# do that... Also don't forget about a little thing called J2ME which is slowly but surely making it's way onto cell phones and other small devices. You may want to take another look at todays Java before declaring that it sucks.

Re:jump off the bandwagon (1)

fitten (521191) | more than 10 years ago | (#6970200)

In my experience as well, you write it on one platform and have to do a bit of debugging to get it to run on another, more debugging for a 3rd, etc. This generally isn't so bad if you use the same JVM on the different hardware/OS but switch JVM and you are out in left field again.

Re:jump off the bandwagon (1)

easter1916 (452058) | more than 10 years ago | (#6970288)

In 5 years of developing server-side apps using Java and web containers I've never encountered one of these bugs, with deployments to Mac OS X, Windows (many flavours), Solaris and AIX as the targets.

Re:jump off the bandwagon (5, Insightful)

Gunfighter (1944) | more than 10 years ago | (#6970270)

I'm afraid I'll have to agree with Cnik70 on this one. I can remember struggling through Java programs back in the day and thinking to myself, "No way in Hell this will ever become what everyone is saying it will be." That was then, this is now. Internal benchmarks of our code under mod_perl, PHP, Python (Zope), and Java for our web development show Java (Tomcat) to be the winner by a landslide when it comes to scalability, performance, and rapid development. From what I understand, even eBay is switching to a Java platform (anyone know more about this?). Of course, this is all on the server side...

As far as GUI applications are concerned, the only thing that is slow about running Java GUI apps on modern hardware is the startup time. This can supposedly be taken care of with accelerator apps which keep a JVM running in the background just waiting for Java apps to be run. Even without such acceleration, I still use jEdit as my text editor of choice for all my programming needs (http://jedit.org/), and as a sysadmin I don't even program in Java (where jEdit is best applied). I usually stick to Perl/Python for automating systems administration scripts. Nevertheless, I find that the features, performance, and overall ease-of-use in jEdit save me loads of time (nice CVS integration too).

Bottom line, Java is already in enterprise computing environments and, with an experienced developer, ready for primetime in smaller applications as well.

-- Gun

Re:jump off the bandwagon (4, Informative)

MikeApp (151816) | more than 10 years ago | (#6970183)

You claim to have worked on numerous Java projects, then complain only about GUI apps? The large majority of Java projects are server-side, which is where it really rocks. Write once and deploy on your choice of platform (Linux, Solaris, or Windows if need be).

Re:jump off the bandwagon (3, Insightful)

pla (258480) | more than 10 years ago | (#6970305)

The large majority of Java projects are server-side, which is where it really rocks. Write once and deploy on your choice of platform (Linux, Solaris, or Windows if need be).

Although true (in my experience), the idea itself has sooooo many things wrong with it...

Portability - Server-side Java, by nature, does not involve any OS-specific activity. So, with no loss of portability or functionality, you could do the same in C/C++. Which, incidentally, will run on any platform for which GCC exists - About 30 *times* the number of platforms for which a JVM exists.

Performance - Yes, servers tend to have fairly impressive hardware resources available to them. So lets cripple that hardware by making it run an interpreted language. JIT? Server-side apps also tend to have very short process lives, doing a small task and exiting. In such situations, JIT causes worse performance, as it wastes time optimizing something that will never execute again during this process' invocation.


I believe (though I do not wish to put words in his mouth) that CurtLewis only mentioned GUI programming because if you use Java anywhere else, you have misused it. It makes it easy to write an app with a similar user experience on any hardware with the resources to run the JVM. If the idea of a "user experience" has no meaning to your app, using Java means you have made a suboptimal choice.

Re:jump off the bandwagon (3, Insightful)

Trejkaz (615352) | more than 10 years ago | (#6970202)

We're going to have to point out the separation of language and platform for you again. If the Perl community can figure it out, then anyone should be able to.

Java 'the language' is good. Java 'the machine' is good. Java 'the platform' blows presumably because all the people who could make it better are sitting on Slashdot whining about Java's performance instead of doing something about it.

Re:jump off the bandwagon (1)

boomgopher (627124) | more than 10 years ago | (#6970249)

Informative my ass...

Dude, show me a better IDE than Intellij IDEA [intellij.com] which is entirely written in Java, and then we'll start talkin'.

Re:jump off the bandwagon (1)

PDHoss (141657) | more than 10 years ago | (#6970281)

okay [microsoft.com]

[ducks]

Re:jump off the bandwagon (1)

angst_ridden_hipster (23104) | more than 10 years ago | (#6970278)

I'll see your anecdotal evidence, and I'll raise you three cases of C++ disasters, ten C buffer overruns, and fifty million lines of legacy Jovial code that no-one can read.

OK, I'll get this off my chest first: C is the only Truly Great Language ... well, other than assembler. But Real Programs are written in C.

Still, I have to say that I strongly disagree with you. For certain tasks, Java's a great language. I wouldn't use it for GUI code, and I wouldn't use it for sysadmin scripts, but for servers, multithreaded network applications, and similar tasks, it's a good language.

Sure, it's got some annoying aspects. It's overly "academic" in some of its approaches.

Java doesn't suck (and C and C++ really aren't the standard anymore).

Re:jump off the bandwagon (4, Informative)

Dr. Bent (533421) | more than 10 years ago | (#6970284)

I've worked in a variety of Java development projects in the past and not once has it ever risen to the task to show itself as a worthy choice and/or a mature language. Instead it has invariably wasted companies time and money.

I would be willing to bet the reason they failed is because you do not understand how to use Java correctly. As long as we're playing the personal experience game, it has been my experience that hardcore C/C++ programmers tend to make horrible Java programmers because they think Java should behave like C/C++. It doesn't (obviously), and when you try to shove that round peg into a square hole what you get is a huge mess.

At my company, we have a bunch of old school C/C++ progammers and a few Java programmers. As our Java products started to take off (now our #1 selling product line), we wanted to move some of those developers over to Java to help out.

It was a disaster. They made object pools in order to try to manage thier own memory. They were calling System.gc() and yield() instead of using a Java profiler to find bottlenecks. The never used lazy loading. They never used failfast ("exceptions are too slow!", they said). The result was all the projects they worked on were extremely brittle, used twice as much memory, and ran much slower than our original Java stuff because they were constantly fighting against the system instead of working with it.

Try reading Effective Java [amazon.com] by Josh Bloch and Thinking in Java [mindview.net] by Bruce Eckel. Do what these guys suggest and your Java apps will run just as well than as anything written in C or C++.

java and .net (-1, Flamebait)

Anonymous Coward | more than 10 years ago | (#6970090)

virtual machines are for pussies! 'nuff said.

Languages are not application-neutral (5, Insightful)

DaMeatGrinder (565296) | more than 10 years ago | (#6970093)

These articles set a metric of what is "good". They judge a bunch of languages based on this criteria, and announce a "winner".

This is just one way to slice the pie.

Languages are appropriate for different uses. I use C while kernel hacking. I use C++ for its template abstractions. I use PHP for web pages, Perl for command-line scripting. I use bash/tcsh for boot-scripts. I respect VB as an accessible language, but I have no use for a single-platform language.

What language you use depends on your application. Comparing C, C++, and C# is like comparing a wrench and a screw driver. And concluding they can both be used as a hammer.

Re:Languages are not application-neutral (4, Interesting)

Waffle Iron (339739) | more than 10 years ago | (#6970252)

Comparing C, C++, and C# is like comparing a wrench and a screw driver.

Moreover, languages like C and C++ can be used in very different ways, depending on the circumstances. You can code the "safe convenient" way using tools like STL or glib to manage strings, containers, etc. I've found that the overall performance of such an application often is in the same ballpark of a Java implementation (other than Java's obnoxious startup time).

However, C and C++ also allow you to write in a "masochistic balls-to-the-wall" mode that gives you much higher performance in exchange for 10X the programming effort. To do this, you often have to analyze your algorithms over and over until you can implement them using only stack and static structures. You avoid malloc() at all costs, avoid copying any data unless absolutely necessary, etc. You might disassemble the compiler output, run profilers and arrange data in cache-friendly patterns to squeeze out even more performance. The implementation will be much more brittle and prone to bugs, but you can often get a 10X or more speed improvement over the "natural" C or C++ implementation. Obviously, very few problems warrant this kind of attention, but making blanket statements about "comparing" other languages to C/C++ really should acknowlege the large range of performance that these languages can cover.

Competition is important. Whats really needed. (0, Insightful)

zymano (581466) | more than 10 years ago | (#6970100)

Java is not what it was intended for. It's a decent language . More so for Sun though. Don't care for it's memory consumption .

C# is good because it competes with java and therefore will make SUN competitive.

Whats really needed is a FAST language that can be run on all computers so the software developers don't have to develop different code for each OS so applications don't need porting and speed and memory consumption wont be noticed by the user like they do with java. Something that can also be run on all handhelds with speed.

Java will never be able to do that.

Re:Competition is important. Whats really needed. (1)

cbreaker (561297) | more than 10 years ago | (#6970266)

"Java will never be able to do that."

Says who? Computers are getting faster and faster. Java applications on my machine (AthlonXP 2200) appear to run just as fast as any native application. I'm sure some benchmark could tell the difference, but I can't.

You wouldn't run a java database server at this point, but as computers keep getting faster... the performance hit will become less and less of an issue.

Conclusions (3, Informative)

SimuAndy (549701) | more than 10 years ago | (#6970148)

After a quick registration, I'm enlightened by the conclusions I drew from his article:
  • C# fares rather well.
  • ... but almost never as well as native C and C++ implementations done "smartly".
  • Java suffers from runtime-based overhead, with the advantage of a well-tested set of runtimes for various platforms. Unfortunately, due to the Java implementation of client-side runtime libraries, programming in Java is still "write once, test everywhere. curse. port everywhere" for real applications.
And most importantly, as a game programmer, I'm going to pay attention to the relative performance the author received from the Intel-branded compiler, written to the metal of the Pentium IV with streaming SIMD instructions. -andy

What's with all of the bellyaching about speed? (5, Interesting)

defile (1059) | more than 10 years ago | (#6970170)

OK lets get a few things settled.

Given: two identical applications; A, written in low level language like machine assembly, C, or C++; B, written in high level language like Java, Python, VB, hgluahalguha.

If the application is high in CPU burn (lets call it X), like oh, for (i = 0; i

If the application is copying a very large file using basic read/write system calls and large enough buffers (lets call this Y), A and B will have very similar performance.

If the application is printing hello world, they will have similar performance, although the startup costs for B may be higher, and A will probably finish executing faster.

MOST applications written today are written to solve for Y. The code that most programmers write today is NOT the CPU intensive portion. Usually the CPU intensive portion is in the library called by the programmer: rendering a box, moving things around on a storage device, making something appear on a network.

In these cases, a high or low level language makes no freaking difference on execution speed. However, your choice WILL make a huge difference on time to develop, maintainability, resultant bugginess, SECURITY, etc.

OF COURSE THERE ARE EXCEPTIONS. Maybe you're writing a routine that needs to draw lines fast, or move bytes through a network filter at 100MB/sec, or you're compressing a file, whatever. In these cases you tend to write the performance critical code in a more low level language so you have greater control over the physical machine. Sometimes you write the entire application in the low level language.

Many high level languages provide mechanisms for calling low-level code when it's necessary for performance. It's often pretty easy.

The performance argument is a red herring.

Re:What's with all of the bellyaching about speed? (1)

Derivin (635919) | more than 10 years ago | (#6970301)

The performance argument is a red herring. I would not go that far. As many posters have pointed out, its not really about which single language is better overall, but which languages are best suited for which applications. There is a reason why perl and python have a published C/API for extending and imbeding, there is a reason for JNI, blah, blah, blah. As with many things in life, the intended purpose of the article is not its best use. After reading the article it has changed my opinion on when and where to draw the line between the different languages. Many times I have planned from the start to do my network programming in C over C++ or Java due to the belief that they were slower or contained undue overhead. Which language has the best performance may be what the author intended to write an article about, in the end it is more a helpfull guide to help decide which side of the fence to write that piece of code.

Re:What's with all of the bellyaching about speed? (1)

Aadain2001 (684036) | more than 10 years ago | (#6970327)

I disagree. When you are talking making one box appear on the screen or copying one large file into memory or to another disk location, sure the performance difference isn't something to use as a make or break deal. But when you talk about running something for a long time, say hours or days, the difference becomes brutely clear. I have a Java application (GUI based) that I need to run for up to 24 hours sometimes. The longer it runs, the worse it gets. Memory bloat, performance degradations, etc. They all add up. Remember: Java is running on an emulation layer, so each instruction has to be executed twice. Once by the Java code, and once by the Java machine. It's the reason emulators like Wine and WineX don't have as good performance as straight Windows.

If the probject is small, does or or two small activities and doesn't have to run for more than short periods, the it's just fine. For something that will do big work, require lots of memory and run for long periods, Java will come to bite you in the ass.

Login (0)

Anonymous Coward | more than 10 years ago | (#6970178)

Someone's set up slashdot:slashdot

I've been coding most of... (5, Insightful)

rmdyer (267137) | more than 10 years ago | (#6970179)

...my life. It's been mostly C/C++ but also a good amount of assember and VB. Maybe someone here can answer one of the questions that keeps poping up when I write anything. My question is, why do we always end up creating libraries/classes that contain other code we will never use? What I would like is a compile environment where each function or object that I use is individually addressable, without having to pull in other "stuff" I don't need in my specific app. Is that so hard? Why doesn't the OS manage code better than pulling in a whole library? If I use only strcat() for example, why do I need to load in the entire C string library?

The problem gets even worse with C++ and objects. Huge numbers of member functions and public variables that will never be used. Microsoft's .NET and Suns Java take the cake by making you load an entire "run-time" engine. This consists of vast numbers of "ready-to-go" objects that make your simple "Hello World!" app into an 11 Meg progam. Java can't even share the "run-time" between apps very well!

Is there a program out there that can tell the efficiency of the operating system environment, apps and OS, by how many functions "aren't" getting used in a normal day by a user? I'm going to go out on a limb here and suggest that most RAM isn't being utilized by apps.

What I would like is an extremely efficient programming environment that compiles my six line x++ program down to a few hundred bytes total...that's in-memory while running. I want to use my RAM for data and number crunching, not unusable code.

+1-1

Re:I've been coding most of... (2, Insightful)

Tyler Eaves (344284) | more than 10 years ago | (#6970227)

>If I use only strcat() for example, why do I >need to load in the entire C string library?

Because strcat can call another string library function, which can call another, etc...

Code duplication is bad, remember?

But, the compiler/os should... (2, Insightful)

rmdyer (267137) | more than 10 years ago | (#6970319)

...be smart enough to "know" what sub-functions each function you are using needs to be loaded. If strcat() only uses 3 sub-functions, then those should only be loaded for "it". And, if those functions are already loaded "somewhere in memory", the OS shouldn't load them again, and again, and again, as so often happens these days.

I'm saying that the compiler/OS should be smart enough to "itemize" your entire application in terms of absolute functions/variables needed at compile and run-time.

Where is that capability? Why aren't compilers smarter?

-1+1

Re:I've been coding most of... (2, Insightful)

gewalker (57809) | more than 10 years ago | (#6970293)

What you want is a smart linker. You still build libraries, modules, etc. But when the program builds the executable it notices that some functions are never referenced, so the code for these is dropped when building the executable.

Some versions even recognize classes have functions that are never referenced, and these class functions are eliminated.

You get used to using a smart linker (I've been using Delphi a lot and it has one), it changes your programming style as you build larger modules/libraries since the bloat penalty is not there.

Re:I've been coding most of... (1)

kinema (630983) | more than 10 years ago | (#6970326)

Can't this be accomplished by "stripping" your libraries?

What is "good"? (5, Insightful)

ljavelin (41345) | more than 10 years ago | (#6970225)

I don't know if anyone has done any formal study on the complexity of development tools over time - but the fact is that programming tools are getting "lower" over time.

When I started out in this business, a language like C was a high level programming language. It did a lot for the programmer, especially compared to assembler and FORTRAN.

Everything we did every day was to save memory and CPU cycles. Can we squeeze a date field into 8 bits? You bet we'd try! And we did! Heck, we could ignore weekends and holidays. Phew!

At the same time, databases were heirarchical. The databases were very close to the machine, so they were darn fast. As long as you didn't do any unexpected queries (like "sort by first name"), everything was blazing fast and tight.

Then came the higher level systems. Ouch, they sucked! We were the very first customer to run DB2 in production (quiz- you know which one?) Anyhow, it sucked rocks compared to the heirarchical databases - they were just optimized for speed! Why would anyone ever want a relational database?

But over years we came to see the light. With faster and faster machines, the number of cycles was less important. With bigger memory and disk, storage was less important. And it was butt-easy to use these tools. Easier and MUCH more maintainable.

So yeah, Java and C# are going to use more memory and more cycles than plain old C (if using the languages as expected). But for most tasks, that isn't the whole story.

The whole story is that Java and C# result in less expensive programs. And those programs should run fast enough. Yeah, not in EVERY case. But in most cases.

Performance comparisons be damned.

Try it before you knock it (3, Interesting)

nissin (706707) | more than 10 years ago | (#6970228)

I've programmed extensively in C and Java, with some C++. I took a typical anti-Microsoft stance early on and refused to even look at C#. I was finally convinced to try it, and I must say that it has some nice features.

I recommend that any programmers out there try using it before discounting it. It might be especially interesting for those C++ programmers out there who don't like Java for one reason or another.

Slashdot contracts viral marketing piece, again (-1, Flamebait)

bill_mcgonigle (4333) | more than 10 years ago | (#6970233)

Go ahead and read the story again with this question in mind: "is the writer from Redmond?"

Wow...is this the best you can do? (0)

Anonymous Coward | more than 10 years ago | (#6970271)

God..so typical for this site. Hardly any of you answered his question - most just throw out the 'java' answer..which isn't any sort of answer for client apps - it blows on the client - no one would use an app written in java if there were an alternative product written in anything else (god even VB).

But, sorry dude, I can't help answer your questions as I am a windows coder and just lurk here for the interesting news and to laugh at the linux elitists.

asking for comments here? (0)

Anonymous Coward | more than 10 years ago | (#6970296)

Yeah right, like anyone on Slashdot knows two things about writing code or anything else valuable.

troll on! w0ot kewl dood

C# Rocks!! (0)

Anonymous Coward | more than 10 years ago | (#6970299)

I've been using it exclusively for almost two years now and it's really the best language out there, at least as far as Windows programming goes.

Look at the game industry (1, Insightful)

bismarck2 (675710) | more than 10 years ago | (#6970313)

These tests are very trivial. Basic string tests are one thing but they are very different from the complex performance implications of larger scale software.

A good indicator is the game industry. Game developers are notorious early adopters and tend to care little and even hold contempt for backward compatibility. But they also require performance. There are plenty of Java puzzle games but any major game with fancy graphics that you find on a store shelf is C or C++ (with various graphic specific languages and custom game scripting type languages).

If you start seeing competitive cutting edge 3D engines written in Java, then you will know the performance difference has become moot.

There are plenty of non-game examples but that is the easiest to see.

Java and C# are great languages. Eclipse is awesome. But the performance, of Java at least, still isn't there; even with native code compilers.

Studies can suck (1)

Luveno (575425) | more than 10 years ago | (#6970323)

I saw Don Box show C# to be a gazillion times faster than C++ doing simple integer math, but what he _really_ was showing (unbeknownst to the VB-heads in the audience) was the wonders of garbage collection.

Ah well, .NET still is pretty nice.

Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...