Slashdot Mirror


Does C# Measure Up?

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?"

60 of 677 comments (clear)

  1. Differences by fredistheking · · Score: 5, Funny

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

    --

  2. Alternative to Visual Studio by Vaevictis666 · · Score: 5, Informative
    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?

    1. Re:Alternative to Visual Studio by Glock27 · · Score: 3, Informative
      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.)

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    2. Re:Alternative to Visual Studio by PianoComp81 · · Score: 3, Informative

      Eclipse can be good for other languages. My problem with it is that it's just too slow many times. I did have a problem in Windows getting C/C++ to compile, but I think it was looking for cygwin + gcc, and not the MSVC++ I had installed at the time. I too have used it extensively for Java, and probably wouldn't use anything else on a decent-sized project.

  3. Re:In Java's case ... by Bingo+Foo · · Score: 3, Insightful
    Why use anything else?

    Templates.

    Any other questions?

    --
    taken! (by Davidleeroth) Thanks Bingo Foo!
  4. Microsoft license prohibits CLR benchmarks by Anonymous Coward · · Score: 4, Funny

    Raed it. Ingroe it. Bncehmrak aynawy.

  5. Duh by be-fan · · Score: 5, Insightful

    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.

    --
    A deep unwavering belief is a sure sign you're missing something...
    1. Re:Duh by msgmonkey · · Score: 3, Insightful

      But having said that there is the "rule" that 10% of code runs 90% of the time, hence why caches work. If the JIT is only optimizing code that gets run 90% of the time and it's not doing a bad job (since the JIT compiler would most likely be in 2nd level cache) with the other 10% then the benchmark results would be relatively indicative.

    2. Re:Duh by dnoyeb · · Score: 3, Insightful

      The JIT can optimize code based on the computer its running on, and not just a generic compile time optimization. So JITs have advantages as well.

  6. VS Alternative by contrasutra · · Score: 5, Funny

    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.

    1. Re:VS Alternative by JamesOfTheDesert · · Score: 4, Funny
      C,D, I feel bad for the F Programmer.

      Ah, but there is F#

      --

      Java is the blue pill
      Choose the red pill
  7. Re:In Java's case ... by JasonB · · Score: 5, Informative

    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

  8. Uhm... by Black+Parrot · · Score: 4, Funny


    > 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?

    --
    Sheesh, evil *and* a jerk. -- Jade
  9. Languages are not application-neutral by DaMeatGrinder · · Score: 5, Insightful
    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.

    1. Re:Languages are not application-neutral by Waffle+Iron · · Score: 4, Interesting
      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.

  10. Re:jump off the bandwagon by trompete · · Score: 3, Interesting

    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?)

  11. Conclusions by SimuAndy · · Score: 3, Informative
    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
  12. Re:I'm holding out for... by ThatDamnMurphyGuy · · Score: 3, Funny

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

  13. Re:jump off the bandwagon by Cnik70 · · Score: 5, Informative

    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.

    --
    -Cnik
  14. What's with all of the bellyaching about speed? by defile · · Score: 5, Interesting

    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.

    1. Re:What's with all of the bellyaching about speed? by good-n-nappy · · Score: 4, Interesting

      Maybe you're writing a routine that needs to draw lines fast

      This is one of the specific things you can't really do with JNI and Java anymore. Java graphics is now really complicated. There's no way you'll be able to use low level OS rendering methods and have them integrate with Java2D and Swing.

      It's actually a real problem. You've got no recourse when the graphics primitive you need is too slow. You end up with a Java workaround or you switch to OpenGL or DirectX, which don't have good support for fonts and strokes and such.

      This is where C# may end up beating Java, on Windows at least. Eclipse SWT has promise too since you at least have the potential implement your own graphics code.

      --
      Never underestimate the power of fiber.
    2. Re:What's with all of the bellyaching about speed? by GrayArea · · Score: 4, Informative
      This is one of the specific things you can't really do with JNI and Java anymore. Java graphics is now really complicated. There's no way you'll be able to use low level OS rendering methods and have them integrate with Java2D and Swing.

      Sure there is. Have a look at jawt.h header file that's included in your SDK installation. It allows you to access native window system primitives from JNI.

      --
      "The deluded are always filled with absolutes. The rest of us have to live with ambiguity." - Aristoi, Walter Jon Willia
  15. I've been coding most of... by rmdyer · · Score: 5, Insightful

    ...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

    1. Re:I've been coding most of... by MobyDisk · · Score: 5, Informative

      Linkers already do this. At this point, it is ubiquitous functionality. The linker has a list of functions that are referenced, and functions that are not referenced. Functions and libraries not referenced are discarded. I know for MSVC, this is done by using /opt:ref which is part of the default RELEASE builds. This all works for OO code like C++ as well since the methods boils down to functions as far as the linker is concerned.

      There are some special cases:
      1) You mentioned strcat() which can be inlined by many compilers. In this case, you trade speed for code bloat - the library isn't really used at all here. In MSVC this is an "intrinsic" function.

      2) Dynamic libraries may be treated differently. It is more difficult to try to partially load them. I'm not sure how Linux handles this. Windows allows for a DLL to contain multiple code and data segments, which can be loaded individually if needed.

    2. Re:I've been coding most of... by cookd · · Score: 4, Informative

      Very complicated question. Ughh, there are answers at many levels, and they are all different. But here goes.

      Any decent linker nowadays is "smart." This means that it already does what you are asking for -- it knows how to figure out exactly what the dependencies are, and bring in only the symbols (a symbol in this context is a chunk of code or data) that are (directly or indirectly) referenced by your code. Even though you link against all of the C Runtime, or all of the string library, the linker realizes that you are only using strcat. For this example, we'll assume that strcat uses strlen and strcpy. So your call to strcat pulls in strcat, strcpy, and strlen, but nothing else. So what you mention actually is already happening. (Unless you turn off the "smart" linking, as is common for debugging purposes.)

      However, there are some additional factors at work. The first is the C Runtime (CRT). ANSI C has some very specific requirements about how the environment is to be set up before main() is called, and how the system is to be cleaned up after main() exits. C also has specs about how to prepare the system for unexpected termination and signal handling. Setup and cleanup reference a bunch of additional symbols, so you end up with much more than just main(), strcat(), strcpy(), and strlen() -- you also have atexit(), exit() and etc. There is usually a process by which you can get rid of this and start directly in main with no setup code, but then you can't use any of the CRT-supplied functions (since the CRT isn't initialized) -- you have to set up your process yourself, handle signals yourself, and are limited to calling OS functions directly (no nice wrappers like fopen, printf or such).

      Then there is the issue of linking. Static or dynamic? Static linking means that all of the symbols you reference, directly or indirectly, are compiled into your binary. Dynamic linking means that all of the symbols are converted to references to external binaries, and when your binary loads, the external binaries will also load and you will use the symbol as defined in the external binary. Static linking means everything you need (and nothing you don't) is right there, compiled into your binary, so you'll never load anything you don't need. On the other hand, every program that is statically linked has its own copy of the linked-in routines, which can be wasteful of disk space and memory. With dynamic linking, the entire external binary has to be available, even if you only need one symbol from it. On the other hand, there only needs to be one copy of the binary on disk, no matter how many times it is used. And most of the time, the operating system can arrange things so that only one copy of the binary's code is loaded into memory, no matter how many processes are using it. This can save a lot of memory. For most systems, it turns out to be much more efficient to load a multi-megabyte dynamic link library into every process rather than statically link just the 200k that you actually need from that library.

      Finally, there is the OS involvement. The OS has to do a certain amount of setup for any process, no matter how trivial that process is. It has to allocate a stack, map the process into memory, set up virtual memory tables for it, etc. On a modern OS, in order for it to provide the services we expect, it has to set up a bunch of stuff just in case the process decides to make use of it. It is the price we pay for having a lot of power available to us.

      So for an example, I wrote up two test programs. I'm a Windows guy, so everything was done using Visual C++ 7.1. The first test was just an empty main(). Compiled and linked statically, it takes 24k on disk. That is basically just the CRT startup and shutdown code and the signal handlers (plus error message strings, etc.). It also links (dynamically) to kernel32.dll, ntdll.dll, and the OS itself. It allocates 568k of user memory/136k VM, 7k of kernel memory, and holds 14 kernel objects (thread handle, process han

      --
      Time flies like an arrow. Fruit flies like a banana.
  16. Re:jump off the bandwagon by MikeApp · · Score: 4, Informative

    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).

  17. Re:Whoa whoa whoa! by jemenake · · Score: 4, Funny
    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.

    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".
  18. Re:jump off the bandwagon by Trejkaz · · Score: 3, Insightful

    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.

    --
    Karma: It's all a bunch of tree-huggin' hippy crap!
  19. Re:In Java's case ... by Bingo+Foo · · Score: 3, Funny

    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>

    --
    taken! (by Davidleeroth) Thanks Bingo Foo!
  20. What is "good"? by ljavelin · · Score: 5, Insightful

    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.

  21. Try it before you knock it by nissin · · Score: 3, Interesting
    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.

  22. Re:jump off the bandwagon by Gunfighter · · Score: 5, Insightful

    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

    --
    -- Stu

    /. ID under 2,000. I feel old now.
  23. Re:jump off the bandwagon by Dr.+Bent · · Score: 4, Informative

    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 by Josh Bloch and Thinking in Java 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++.

  24. Re:jump off the bandwagon by pla · · Score: 3, Insightful

    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.

  25. Shared libraries by n0nsensical · · Score: 3, Insightful

    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.

    If the functions are in a shared library, they shouldn't be. Each library (including, for example, the C runtime) is loaded once into memory and every process uses the same code. If you modify that code in memory, Windows makes an individual copy of the page for the modifying process. I couldn't tell you exactly what the overhead is used for, but the OS isn't loading 20 copies of strcpy or whatever as long as each executable is dynamically linked.

  26. The problem is: that's not the problem by Spinality · · Score: 4, Insightful

    You're right. But with ever-increasing CPU horsepower, memory bandwidth, memory size, etc., there simply is no incentive for optimizing the things you're talking about. Moore's 'Law' has attenuated the advancement of software technology, by eliminating the need for efficient software.

    There are plenty of dinosaurian programmers like myself who remember hacking away on small machines. Save a byte by referencing a constant stored as an opcode in the instruction stream? Excellent! SLR R1,R1 is 60ns faster than SL R1,R1? Excellent! Decrease the size of the PDP-8 bootstrap loader by one word? Excellent! (Flipping those toggle switches took a lot of time.)

    In 'the old days' hardware was expensive and programmers were cheap. Hard problems were solved by incredible brainpower from great engineers. As a result, by the early 70's software had made huge advances over the punchcard/paper-tape era, and we had learned a lot about how to build quality systems.

    But there was a magic moment when the curves crossed between the cost of programming time versus the cost of hardware. Suddenly, it became easier to solve a problem by adding iron rather than by thinking harder. And so we slid backwards down the slope.

    As far as I'm concerned, hardly anything significant has happened in software architecture or praxis for a few decades. Sure, we have a bunch of fancy new widgets, and the common man's programming paradigm has changed. And the Open Source movement finally has given substance and a PHB-understandable framework to what Unix, LISP, Smalltalk, and other hacker communities used to do behind the scenes.

    But most of today's 'new' language, compiler, data management, operating system, and other computer science paradigms had their fundamental elements invented back in the 60's and 70's. We're finally RE-discovering many great concepts of the past. But it seems we've totally forgotten the importance of efficient, defect-free code, and the methods that might be used to create it.

    This is not to say that only great systems were built in 'the good old days' -- those days weren't that good, and there was plenty of crap. But the really bright folks figured out how to do things RIGHT; and yet they wound up being ignored, because 'doing it right' became less important than 'letting Bruce the part-time lifeguard do it over the weekend in Visual Basic.'

    So while I totally agree with your rant, and I've made a hundred similar rants of my own, the fact is we probably won't see fundamental improvements in software platforms until subatomic physics finally provides a wall against which hardware advances can bounce. As long as the answer to every performance/capacity complaint is "wait six months" there's no incentive to invest the man-centuries it will take to revamp our software environments. We probably need to build intelligent software that can optimize itself, because WE NEVER WILL.

    </rant>

    --
    -- We all have enough strength to endure the misfortunes of other people. La Rochefoucauld
  27. Re:In Java's case ... by HuguesT · · Score: 4, Insightful

    I was going to moderate, but there you go.

    Because it forces down your throat the concept that everything is an Object. Many people find this counter-productive as object-oriented programming is only well adapted to a subclass of problems (and trying to use that methodology when it just doesn't work is downright ugly).

    Besides inheriting from Object does not solve the same problem as templates do. Templates are super-macros designed for fast runtimes. Universal object orientedness with default virtual methods causes extra overhead that C++ programmers want to avoid a lot of the time.

    Notice that single-object-derived libraries for C++ exist, for example the NIH library, but that they were never as successful as the STL is.

    Inheriting from Object only solves the absence of multiple inheritance in Java.

  28. SharpDevelop - #develop - GPL .NET IDE by Sean+Clifford · · Score: 4, Informative
    Well, there's always vi a la vim win32 port. :)

    I do a lot of ASP3.0/SQL2k and some utility development on Win32, taking a stab at .NET. It would be nice to move over to Mono.

    Anyway, I've done a bit of poking around and ran across SharpDevelop - AKA #develop . It's open source a la GPL and looks a lot like Visual Studio, and compiles C# and VB.NET; has C# => VB.NET code conversion; does projects or files; has syntaxing for the whole MS shebang. It's a .97 - this build was released Friday 9/12/2K3, officially in beta, and you can get the binaries here, go snag the source here, and get the MS.NET1.1SDK here.

    To those folks who hiss and moan about the whole GNOME/.NET/Mono thing, take a gander at the rationale before playing jump to conclusions (mp3).

    SharpWT - AKA #WT is a .NET port of Java SWT on both Windows/.NET and Linux/Mono platforms. So...you can develop your .NET apps to run on both Win32 and Linux with pretty much the same GUI. Neat, eh?

    Anyway, intrepid Windows Developer, if you can pry yourself away from the MSDN Library for a few minutes, you might find there's something to this Mono business.

  29. Not from my recent experience by GroundBounce · · Score: 4, Insightful

    I am in the process of coding a data collection server application in Java which collects data from remote devices that dail up over a phone line. The application must interface with the serial port at a low level, send email, generate XLS files, send faxes, create charts, and, of course, communicate with a DBMS. It also has a significant GUI component as well. Oh yes, this application must be able to run both on Linux and Windows (2000 or XP).

    I have been developing on Linux. All in all, to date I've coded around 30,000 lines of code. Because of the high level of portability of the APIs, I had to change all of about a dozen lines of code to get it up and running on Windows. That's one dozen out of 30,000. There's now way you could even come close to that using C or C++, regardless of how cross-platform the library developers say their libraries are.

    As far as performance, Java may have been slow three of four years ago, but the last several versions of the JDK and the HotSpot JVM have seen a steady and rapid improvement in performance and stability. SWING, although it has improved, may still be a bit slow, but computational code written in Java is only slightly slower than in C++. Even current versions of SWING, although arbuably slower than native GUIs like GTK+ or QT, are fast enough so as to not be noticable on any machine faster than 800MHz or so.

    Most people who say Java is unstable or slow are remembering their experience from the JDK 1.1 days. The current JDK 1.4 bears little resemblance to that in terms of performance and maturity.

  30. ...and the .NET Framework is language-neutral by kylef · · Score: 5, Interesting
    What language you use depends on your application. Comparing C, C++, and C# is like comparing a wrench and a screw driver.

    And this is where the .NET Framework shines, because the CLR is a generic virtual machine to which any number of languages can be compiled. Currently there are C#, C++, VB, and even Java (under the moniker J#). There has been talk of writing a Python compiler and even possibly a Perl compiler. So you can choose your language of choice, and your resulting binaries or objects will fully interoperate with the other .NET languages and class libraries.

    And as far as this article is concerned, I think the interesting point is not that they're comparing apples to oranges, but just that the performance numbers for CLR-compiled C# aren't so horrible that they should scare off the majority of developers.

  31. #insert <obligatory_Java _generics_rant> by Anonymous+Brave+Guy · · Score: 4, Interesting
    Java SDK v1.5 (not yet released) contains support for 'generics', which are very much like C++ templates for Java:

    I really can't believe this thread. Why do people always come up with this worn out line whenever someone suggests that C++ templates are an advantage? And how come so many people have done so in replying to the same post? All but the first are (-1, Redundant), and the first is (-1, Ill-informed).

    OK, please, read this carefully, for I shall write it only once (in this thread):

    Java's generics are not even close to the power of C++ templates. They are glorified macros to fix a bug in the type system that should never have been there.

    C++ templates were at that level around a decade ago. Today, they're used not only to create generic containers (for which they are, no doubt, very useful) but also, via metaprogramming techniques, as the tool underlying most of the really powerful developments in C++ for the past few years: expression templates, high performance maths libraries, etc.

    If you didn't already know that, please read it again and understand it before proceeding.

    Java's generics don't even come close to the same power. They're a cheap knock-off, aimed at just one of the uses of C++ templates, which fixes a glaring flaw in the previous Java language. For that, they serve their purpose well, but please don't pretend they're anything more.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  32. Re:jump off the bandwagon by prowley · · Score: 3, Interesting
    I am not sure what server side applications you have been involved with but in my experience server side applications have LONG process lives. They are expected to be up 24 * 7, for as long as possible. Just as an example lets say Apache.
    Which just happens to not be written in Java... Server processes that do require to be up and running 24/7 are written in C (maybe C++) by people who know why. Servers written in Java for the 24/7 operation are written by people who read why in a magazine. Sorry, but I still cannot stifle a smile when Java and server are mentioned in the same sentence. I know there are many true-believers, but really, even if it does look good on paper, just wait til that garbage collector kicks in and I'll have yer 24/7 right here.
  33. And both generics and templates are kiddy toys... by alispguru · · Score: 4, Insightful

    ... compared to the code-generating power of lisp macros.

    --

    To a Lisp hacker, XML is S-expressions in drag.
  34. Re:In Java's case ... by Anonymous+Brave+Guy · · Score: 4, Insightful

    In C++, casts are rarely necessary. When they are, tools like dynamic_cast allow for the same useful run-time type checking as Java et al support.

    In Java, you can't even pull an object out of a container without a cast, and you can't even use a basic type in a generic container without some sort of wrapper object.

    In C++, the RAII idiom lets you ensure the safe release of any resource type. In Java, you have to write the same finally blocks all over just to make up for the fact that finalizers don't work.

    Java is "more safe" than C++?

    Now that was funny.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  35. Re:jump off the bandwagon by EMN13 · · Score: 4, Informative

    Server side tasks are just great for java; your arguments don't add up.

    Any platform I've heard of for server stuff will run java. C/C++ may have a wider distribution; but not amongst relevant platforms. Irrelevant to the discussion are portable/client side/ small / light platforms, and the computation heavy things. Servers are about "service" - the naming is not a coincidence.

    Most server processes run forever, or as close as possibly; not very short lived at all. Starting a new process (aka application) for every client is generally not best practice - those are threads, and don't require constant re-JIT-ing or other JVM/CLR overhead.

    Rather, the larger the system, and the more data, generally the less code in relation to that data, and even less JVM in relation to data. So for the quintessential server with tons of data gunk, the c/c++ advantage is much smaller than in the GUI.

    Furthermore, it is a mistake to compare the portability of java to that of c++ in the manner you do. c++ implementations aren't generally compatible. Take a look at the mozilla coding guidlines for portable c++: http://mozilla.org/hacking/portable-cpp.html

    c++ isn't portable, normally. C++-- might be though. Then again, it might not be. The java language is very standardized; and in case you shouldn't have a compiler on that platform, the bytecode is too!

    In conclusion, if you're using c++ for a server-side task you should consider using java instead. As a matter of fact, most scripting languages are probably better suited than c++, I can hardly image a worse fit.

  36. Re:jump off the bandwagon by Anonymous+Brave+Guy · · Score: 3, Interesting

    Give or take a few quirks, most recent (last five years, say) C++ compilers support all the major features acceptably well for most purposes. There are only a few issues that cause significant problems: the infamous export, Koenig look-up and partial specialisation of templates come to mind. None of these features is used very often anyway, though.

    Coding standards that forbid the use of templates, exceptions and half the standard library in C++ are common, but way out of date.

    By the way, I write code for a living that gets shipped on more than a dozen different C++ platforms. Alas, some of them are well pre-standard, and so don't support even basic template or exception mechanics properly, which sucks. But this is an issue we've looked into in some detail, so I'm pretty confident in my statements above.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  37. Re:In Java's case ... by pyrrhonist · · Score: 5, Insightful
    Did you ever stop for a minute and think that you're doing it wrong, and that there was probably another way to do what you want?

    What many C++ programmers fail to recognize is that Java and C++, though similar, are not the same language, and the paradigms they use in C++ will not work in Java.
    Good programmers learn the new paradigms, bad ones simply criticize that it doesn't work the same.

    --
    Show me on the doll where his noodly appendage touched you.
  38. Re:But, the compiler/os should... by The+boojum · · Score: 3, Informative

    There are enough answers here, but I can't resist jumping in and clarifying.

    Most modern compilers in conjunction with OS's already basically do this. GCC and MSVC and the like all will link in only the functions that they deem referenced by your program and it's dependencies, provided you statically link the library.

    Dynamic link or shared libraries work differently. The OS "loads" them once and uses that one copy for all programs that require that library. The linker that builds the DLL has no way of knowing which functions in the library will be needed by the programs that may use. Some programs may only need one, others may need them all. So the DLL *has* to contain everything it needs to provide.

    The tradeoff is that while static linking means the linker only links in what's nescessary, all executables that use it must provide the same copies of those functions linked into each one. DLL's have to have the whole kit-and-kaboodle, but there can be a single, globaly available copy on this system shared by each.

    It's really a matter of pickin' yer poison.

  39. Oracle by Un+pobre+guey · · Score: 3, Interesting
    So, with no loss of portability or functionality, you could do the same in C/C++.

    Try this:

    Write a backend app in Java, and one with the same functionality in C or C++. Make sure they both read and write data to an Oracle database. Now, with stopwatch in hand, make them both run on Win2K, Cygwin, Solaris, and Linux.

    Guess which language will allow you to finish first.

  40. Re:In Java's case ... by Geek+of+Tech · · Score: 4, Funny
    > Not everything is an Object; didn't you first textbook tell you?

    I never got around to that... my textbook was an object.....

    --
    Stop the Slashdot effect! Don't read the articles!
  41. Re:In Java's case ... by pyrrho · · Score: 4, Interesting

    but you have to remember that C++ is designed to open up the power of the machine to you, not make you think a particular way or be magical for you.

    The onus is on the "our language does it for you" crowd because you were not supposed to say "oh, you have to understand how the VM is working"... right?

    Of course, in the end, all languages will have to tell us this "oh, yes, well, you have to know something". Of course you do! It will always be this way.

    So choose the most efficient and effective language for you and learn it well, learn a different one if called for, etc.

    At least, I take this to be apparent.

    PS: "pyrrhonist"... right on!

    --

    -pyrrho

  42. Re:#insert by pyrrho · · Score: 3, Interesting

    I posted this already... go see how blitz++ works.

    It doesn't make the language butchered in the least, quite the opposite, the end result is very clear to use and the confusing part is hidden inside the classes, where it cannot cause trouble.

    the thing about C++ is, sometimes things are hard, but the reason you do them anyway is because they are worth it, and you can get high levels of abstraction (arbitrarilly high) without taking runtime hits. You have the ability to control your overhead, templates are a great example, especially the examples the parent poster mentions, expression templates, and high performance math libraries.

    Blitz++ uses templates in an elegant, mind blowingly cool way. It might not be clear how it works to many, but that doesn't change how it works. Truly beautiful. And it makes the code easier to read, not harder.

    --

    -pyrrho

  43. Re:jump off the bandwagon by deanj · · Score: 3, Interesting

    Start up time should be a lot better in the 1.4.2 release. Last JavaOne they specifically said work was being done on that. Further improvements are in 1.5 (when it comes out).

  44. Re:In Java's case ... by pyrrhonist · · Score: 3, Interesting
    but you have to remember that C++ is designed to open up the power of the machine to you, not make you think a particular way or be magical for you.

    I guess any language ends up indirectly making you think in a different way. Maybe that's the magical part.

    The onus is on the "our language does it for you" crowd because you were not supposed to say "oh, you have to understand how the VM is working"... right?

    Well, my point was that the languages are different in more ways than many C++ programmers (or Java programmers) realize. For instance, many C++ programmers think that finalize methods are destructors, and many of them use finalize incorrectly because of this. Then some of these programmers choose to complain loudly about Java, when the problem lies with them. They need to learn a new paradigm or their programs will continue to function incorrectly. There are definitely best practices in C++ that are bad ideas in Java.

    Obviously, this works in reverse, too. You can't go from Java to C++ without changing your thinking as well. Many Java programmers have made this mistake.

    Of course, in the end, all languages will have to tell us this "oh, yes, well, you have to know something". Of course you do! It will always be this way.
    So choose the most efficient and effective language for you and learn it well, learn a different one if called for, etc.

    Yeah, I agree. I use languages as a tool, not a crutch. If I see a problem that is better represented by Perl than Java, I'll use Perl. Or Python, or 6502 assembly...

    PS: "pyrrhonist"... right on!

    I like yours too. Pyrrho was cool.

    --
    Show me on the doll where his noodly appendage touched you.
  45. Bad Kool-Aid. by rjh · · Score: 4, Interesting

    Currently there are C#, C++, VB, and even Java

    If I understand the .NET framework correctly, there is no way to support either multiple inheritance or templates--in which case C++ cannot be accurately modeled in .NET. Nor will Java be .NETtable after 1.5, which will introduce pale imitations of templates (but imitation enough to give the CLR a hissyfit).

    The .NET CLR does not support multiple languages. It supports one language--C#. Its "multiple language support" comes from being able to compile down many functionally-identical languages with different syntaxes down to the same bytecodes.

    But truly different languages are not representable in the CLR. Show me how to do a Scheme continuation in the CLR, please, or export a C++ template, or a LISP macro.

    The only languages .NET supports are those which are subsets of C#. And once you realize that, .NET becomes much less interesting.

    (Warning: haven't used .NET much in the last few months. Last I checked these things were true, but after being very unimpressed with .NET I haven't kept up with things.)

    1. Re:Bad Kool-Aid. by Keeper · · Score: 3, Informative

      If I understand the .NET framework correctly, there is no way to support either multiple inheritance or templates--in which case C++ cannot be accurately modeled in .NET. Nor will Java be .NETtable after 1.5, which will introduce pale imitations of templates (but imitation enough to give the CLR a hissyfit).

      The next version of .Net (2.0) is supposed to introduce native template support to IL. Not sure about multiple inheritance, but I doubt it.

      The .NET CLR does not support multiple languages. It supports one language--C#. Its "multiple language support" comes from being able to compile down many functionally-identical languages with different syntaxes down to the same bytecodes.

      If you want to get technical, the CLR supports IL (implementation language), which is interpreted by the virtual machine. The virtual machine has a set of instructions it understands, and the various .Net compilers compile to those set of instructions. This isn't very different from taking a C++ program and building an executable that consists of instructions for an x86 cpu. The machine (virtual or not) provides the facilities for performing the operations you want to do.

      If you can represent what you want to do in IL, you can write a compiler for it. There's some guy out there who wrote an 386 asm->IL compiler (why? because he could I guess...) for example. Not that I think it's a terribly great idea, but it is neat.

      But truly different languages are not representable in the CLR. Show me how to do a Scheme continuation in the CLR, please, or export a C++ template, or a LISP macro.

      IL doesn't have special instructions designed to support those things, but they can be done; they just won't be necessarily be done fast or efficently; for instance, you could do C++ templates the way your average C++ compiler does them --> your compiled code has a unique object for each templated type required. And I can pretty much guarantee you that you could write a Scheme or LISP compiler -- it'd just be a pain in the ass to do (which I'd imagine any proper LISP compiler would be), and it wouldn't be wicked fast.

      The only languages .NET supports are those which are subsets of C#. And once you realize that, .NET becomes much less interesting.

      A more accurate statement would be that IL supports object oriented / functional languages very well, and other things not so well.

      Most commonly used programming languages are OOP or functional in nature. I haven't used a non object oriented language since I got out of college. Perl, C, C++, Java, Basic, Fortran, Pascal, Python, Cobol, Smalltalk, various shell languages, etc. are all either functional or object oriented languages.

      I'd argue that implementing optimal support in a form that most languages translate well to (as opposed to a form that rarely used languages translate well to) was a good design decision.

      The power of this allows you to write code to get what you want done, instead of spending a lot of time writing code to get a round peg to fit in a square hole. There are many other peripheral benefits that .Net brings to the table, and I personally think this isn't one of the big ones -- I think it's more of a "cool" factor than anything else -- but dismissing it outright because the design doesn't perfectly suite some obscure language that is generally used by AI researchers is kind of silly in my opinion.

    2. Re:Bad Kool-Aid. by gglaze · · Score: 3, Interesting

      How can this comment be (+5 Interesting) while each of the subsequent comments are 1's and 2's? When I first read this, I almost jumped to write a diatribe, and found that the other replies had already covered most of the important points very nicely. This comment should be marked (-1 : Ill-Informed) or some such rating, as it is highly misleading to anyone on /. who might be trying to learn about .NET.

      As the others have mentioned here, the CLR is an abstraction of the assembly instruction layer, not the "object-oriented" layer. Thus, a statement such as "CLR does not support {select archaic c++ OO concept}" does not make any sense. This obviously applies for things like multiple inheritance, templates, etc.

      Furthermore, the idea that the CLR "does not support multiple languages" is the most ridiculously malinformed statement I have ever heard about .NET, and trust me, I've heard plenty. One of the major objectives, if not the most important, is to bring to prime-time quality Microsoft's idea of supporting many languages on the same framework. They started this idea a long time ago with COM, and as it evolved, they realized all of the flaws in the COM architecture, and .NET is the next generation of multi-language support, in that sense. .NET currently supports what, like 20+ languages? Not all of them developed by MS, btw... Many of these languages use different paradigms (scripting-oriented, functional-oriented, procedural, etc.), and they all have access to the full breadth of the .NET framework. If that's not "multi-language support", I don't know what is.

      To assume that languages supported by .NET are "subsets of C#" is either naive or very malinformed. Anyone who knows the history of this knows that VB has always been Microsoft's baby, and C# is just the new kid on the block. Yes, now that C# has realized its potential, perhaps it is overtaking VB in popularity. But to claim that VB provides a "subset" of C#'s functionality is precisely backwards - in fact it is literally backwards - if anything, C# provides for the most part a subset of VB functionality, although technically the two provide somewhat intersecting but not fully overlapping sets of functionality - there are some things you can do in VB that you can't do in C#, and there are some you can do in C# that you can't do in VB. And the same goes for all languages on the .NET platform.

      Features like templates and multiple inheritance are first and foremost a feature of a language at the OO-level of abstraction - not the assembly level. As one poster noted here, Eiffel is a good example of a .NET language which already supports these concepts. If you wan't to complain that C# doesn't support them, that's ok. But to complain that "CLR doesn't support them" really doesn't make sense. Get your argument straight first.

  46. Re:jump off the bandwagon by cartman · · Score: 3, Informative

    I disagree.

    Garbage collection in Java is not guranteed... It'll clean up when it god damn well feels like it.

    This is false. Garbage collection in Java is guaranteed. The VM times the garbage collection to occur when the CPU was otherwise idle, or when additional memory is needed by the VM or by other programs. This is the most reasonable behavior.

    In the meantime, the system slows to a crawl.

    This is false. Garbage collection is deferred to improve performance. Deferring gc does not make anything "slow to a crawl," since unused objects consume no cache and take no processor cycles.

    Graphics in Java are abysmally slow.

    This is an exaggeration. It is noticeably less responsive however.

    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.

    Java requires far fewer debug cycles than C or C++, since an entire class of bugs (tricky "pointer bugs") is eliminated. Thus, "over and over and over" is not accurate.

    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.

    It's possible the difficulty was with you or your team, not Java. Perhaps you're unfamiliar with the tools or the language. Other organizations have produced enormous projects, successfully, in Java.

    Stick with C and C++ for most development, there's a reason they are the standard: they work.

    For backend development and enterprise applications, Java is the standard, not C or C++. It's been that way for some time. There's a reason for it.

  47. Am I the only person who read the article? by Ninja+Programmer · · Score: 3, Informative

    First of all -- what's the deal with this whole "WARMUPS" thing? This is just the most explicit way possible of training the JIT mechanisms without measuring its overhead. That might be fine if you believe that the overhead asymptotically costs nothing, however, I don't know what evidence there is of this. The test should use other mechanisms other than this explicit mechanism to allow the language itself to demonstrate that the overhead is of low cost.

    The way this test is set up, the JIT people could spend hours or days optimizing the code without it showing up in the tests. This is the wrong approach and will do nothing other than to encourage the JIT developers to cheat in a way such as this just to try to win these benchmarks.

    Ok as to the specific tests:

    1. FloatInteger conversion on x86 are notoriously slow and CPU micro-architecturally dependent. It also depends on your rounding standard -- the C standard dictates a rounding mode that forces the x86s into their slowest mode. However using the new "Prescott New Instructions", Intel has found a way around this issue that should eventually show up in the Intel C/C++ compiler.

    This does not demonstrate anything about a language other than to ask the question of whether or not the overhead outside of the fi rises to the level of not overshadowing the slowness of the conversion itself.

    (That said, obviously Intel's compiler knows something here that the other guys don't -- notice how it *RAPES* the competition.)

    2. Integer to string conversion is just a question of the quality of the library implementation. A naive implement will just use divides in the inner loop, instead of one of the numerous "constant divide" tricks. Also, string to integer will use multiplies and still just be a limited to the quality of implementation as its most major factor determining performance.

    3. The Pi calculation via iteration has two integer->floating point conversions and a divide in the inner loop. Again, this will make it limited to CPU speed, not language speed.

    4. The Calculation of Pi via recursion is still dominated by the integer divide calculation. It will be CPU limited not language limited.

    5. The Sieve of Erastothenes (sp?) is a fair test. However, if SLOTS is initialized to millions, and the comparable C implementation uses true bits, instead of integers, then I think the C implementation should beat the pants off of C#, Java, or anything else.

    6. The string concatenation test, of course, is going to severely ding C for its pathetic string library implemenation (strcat, has an implicit strlen calculation in it, thus making it dramatically slower than it needs to be.) Using something like bstrlib would negate the advantage of C#, Java, or any other language.

    7. The string comparison with switch is a fair test, and gives each language the opportunity to use whatever high level "insight" that the compiler is capable of delivering on. It should be noted that a sufficiently powerful C compiler should be capable of killing its competition on this test, however, I don't believe any C compiler currently in existence is capable of demonstrating this for this case. I.e., this *could* be a legitimate case to demonstrate that C# or Java's high level abstractions give it an advantage over where the state of the art is in C compilers today.

    8. Of course the tokenization is another serious ding on the rather pathetic implementation of the C library. None of strtok, strspn, etc are up to the task of doing serious high performance string tokenization. If you use an alternative library (such as bstrlib or even just PCRE) you would find that C would be impossible to beat.

    -----

    Ok, while the results here are interesting, I don't think there were enough tests here to truly test the language, especially in more real world (and less laboratory-like) conditions. Please refer to The Great Win32 Computer Language Shootout for a more serious set of tests.

  48. Re:-1: Ill-Informed by rjh · · Score: 3, Interesting

    First, I'll ask you to please see my comments in the other response to you...

    Done.

    In fact, even his "brilliant" graph algorithms may have been top-class during his time.

    As far as I can see, remember, or am concerned, Dijkstra's contributions to computational graph theory are fundamental to the field. If you think they're brilliant-in-quotation-marks, all I can ask is what you've discovered that's comparable.

    That's not meant as an insult or a challenge, incidentally. It's meant to say that in hindsight many things become obvious which required real genius to see them in the first place. Dijkstra's graph algorithms are simple and straightforward, and in hindsight they're obvious--but let's not forget that the only reason they're obvious to us is because Dijkstra had the insight to see, in foresight, what's obvious in hindsight.

    If in your academic mind you truly believe this,

    You keep on calling me that, an "academic". The reality is I'm nothing of the sort except in the sense that I'm a graduate student. I'm a hacker, not an ivory-tower academic. I believe in solving problems and sharing those solutions with the world.

    It's axiomatic that if you're faced with a problem, one of the worst things you can do is stubbornly insist that it be solved with X technique. You have to show some flexibility. You have to be able to approach the problem from different angles. For GUIs, I've found object orientation is almost always best. For scientific programming, I've found template metaprogramming best. For using computers in math theory courses, I use LISP or ML. For writing system-level software, I use C++. Etcetera.

    My insistence on multiple paradigms is unequivocally not born out of "academia", a word which it seems you're using as an insult. My insistence on multiple paradigms is born out of my demand that I use the right tool for the job. .NET claims it will support all programming languages. It doesn't. It doesn't even come close. Once you realize .NET is just another VM that can be more easily targeted by compilers, you realize that "hey, this is ... really ... not all that interesting or useful," as I said in the post which kicked all this off.

    Why is it not all that interesting or useful? Because we already have that with Java. We've got a virtual machine which provides managed services and is targeted by over 60 different languages, all of which can use all the facilities of the other languages once their code has been reduced down to bytecodes. We've got a VM which allows you to interface with the native hardware to get a massive speed boost.

    Am I talking about .NET or am I talking about Java? In this case, Java. (I can't confirm the 60+ languages bit, but that's the number I see. Last I heard, Java supported more languages than .NET, but this gap was rapidly closing and the numbers are a couple of months old.)

    So where is .NET interesting? It was interesting the first time Sun did it with Java. (Or, for us dinosaurs, it was interesting the first time I saw UCSD Pascal do it with their VM.) It's not interesting this second time around.

    Where is .NET useful? If you're married to the Microsoft platform, then I guess it's useful. But really, where's the huge win for .NET over Java? There isn't one. It's an alternative to Java, not really something new and innovative, not something which allows you to solve more problems than Java or even allows you to solve them all that much differently.

    That said, is it useful for Company A, which prefers VB, and Company B, which uses Java, to be able to collaborate on software, each using their preferred language, with their results able to be executed on a shared VM?

    Sure it is. That's not what I mean when I say ".NET is neither useful nor intere