Slashdot Mirror


C# In-Depth

Bergkamp10 from ComputerWorld writes "Microsoft's leader of C# development, writer of the Turbo Pascal system, and lead architect on the Delphi language, Anders Hejlsberg, reveals all there is to know on the history, inspiration, uses and future direction of one of computer programming's most widely used languages — C#. Hejlsberg also offers some insight into the upcoming version of C# (C#4) and the new language F#, as well as what lies ahead in the world of functional programming."

86 of 499 comments (clear)

  1. Ads... by Dannybolabo · · Score: 3, Informative

    Why must they make me trawl through 8 pages of ads?

    --
    Give a man a fire and he's warm for a day. Light a man on fire and he's warm for the rest of his life. - Terry Pratchett
    1. Re:Ads... by Anon+E.+Muss · · Score: 4, Informative

      Just click the "Print this story" button and you can read the whole thing on one page, without ads. This trick works on many sites.

      --
      The key sequence to access my Slashdot bookmark in Firefox is Alt-B-S. I don't believe this is a coincidence.
  2. The Printer Friendly version ... by neonprimetime · · Score: 5, Informative

    I beg you to use this link instead of flipping thru all 8 pages

    1. Re:The Printer Friendly version ... by Anonymous Coward · · Score: 2, Informative

      Your link did not redirect me to a printer friendly version.

  3. Foctothorpe FTW by netpixie · · Score: 5, Funny

    I am a sad case and find much amusement in the fact that the "correct" name for the # symbol is octothorpe, which means "C#" should not be pronounced "C-sharp" but Coctothorpe.

    Imagine my joy on discovering that they've scoured the alphabet and have managed to find a new initial letter that makes an even funnier name.

    Ladies and gentlemen, let us welcome the new language, F# or Foctothorpe.

    1. Re:Foctothorpe FTW by mbadolato · · Score: 2, Informative

      I am a sad case and find much amusement in the fact that the "correct" name for the # symbol is octothorpe, which means "C#" should not be pronounced "C-sharp" but Coctothorpe

      Er, haven't studied much music, eh? Personally I don't recall anyone ever saying anything to the effect of "This time,let's try Bach's Bouree, but change the key to E octothorpe". E# is pronounced "E sharp" ;-)

    2. Re:Foctothorpe FTW by netpixie · · Score: 5, Informative

      That'll be because music uses sharps (i.e. unicode symbol 266F) rather than octothorpes (unicode 0023)

      E followed by unicode 266F is indeed E sharp
      E followed by unicode 0023 is E-octothorpe.

    3. Re:Foctothorpe FTW by binarylarry · · Score: 2, Funny

      I can't wait until the Mono project completes their clone.

      And I can use GNU/Cocotothorpe.

      --
      Mod me down, my New Earth Global Warmingist friends!
    4. Re:Foctothorpe FTW by TheLink · · Score: 2, Informative

      I haven't really checked but it might depend on which "temperament" you're using.

      See: http://en.wikipedia.org/wiki/Musical_temperament

      This might have E sharp not being F:
      http://en.wikipedia.org/wiki/19_tone_equal_temperament

      --
    5. Re:Foctothorpe FTW by IIRCAFAIKIANAL · · Score: 4, Informative

      C# is indeed C followed by a musical sharp. But everyone uses the octothorpe for convenience.

      --
      Robots are everywhere, and they eat old people's medicine for fuel.
    6. Re:Foctothorpe FTW by tobiasly · · Score: 2, Interesting

      C# is indeed C followed by a musical sharp. But everyone uses the octothorpe for convenience.

      If I had mod points I'd give 'em to ya but instead I'll just reply that you're correct. :) In fact the C# standard (don't have the link handy) specifically states that although sharp is the "correct" glyph to use, the octothorpe is an "accepted" alternative due to the lack of the former on keyboards.

    7. Re:Foctothorpe FTW by Ed+Avis · · Score: 2, Insightful

      On a piano keyboard to play E# you press the same key as for F, so it gives the same sound. But I *think* this is not true for every instrument. Some instruments can produce different sounds for E# and F. Then there are the considerations of music theory and notation which others have pointed out.

      --
      -- Ed Avis ed@membled.com
    8. Re:Foctothorpe FTW by danwesnor · · Score: 3, Funny

      It never ceases to amazes me what Slashdotters will argue about. Somebody makes a reasonably funny smart-ass remark and the next 5,000 posts are dedicated to arguing about whether his premise is correct.

    9. Re:Foctothorpe FTW by risk+one · · Score: 3, Funny

      Somebody should trademark C octothorpe, and sue Microsoft for every place they've used the wrong character.

    10. Re:Foctothorpe FTW by cjh79 · · Score: 3, Informative

      Actually, E# is pronounced "eeh sharp", and is a distinct note (and in many cases pitch) from F.

      For example, in an F# major scale, E# is the leading tone and should sound slightly higher than F natural (which would be the lowered tonic) would, due to the tendency to want to resolve to the F#. Of course if you are playing on an even tempered instrument such as a piano, the pitch will always be identical to that of F natural, but pianos are always out of tune for this reason.

      I fully expect to be modded down for this embarrassing display of band geekery.

    11. Re:Foctothorpe FTW by turgid · · Score: 2, Interesting

      What a lucky little so-and-so. But could he still distinguish flat and sharp keys if all of the instruments were in equal temperament?

      That would be an interesting experiment to perform.

  4. a bunch of questions by yanyan · · Score: 5, Insightful

    Could it be that C# is one of the most widely used simply because of the installed base of windoze machines all over the world and not because of any technical merit? Most current languages have compilers and interpreters that run on windoze; what makes people choose C# over the others? Just how much impact has C# had on computing sciences as a whole, anyway?

    1. Re:a bunch of questions by SquareVoid · · Score: 2, Insightful

      What impact did Java have on computing sciences? Well take that list and multiply it by several generations ahead of Java and that is what you have. And it isn't so much C# as it is the .NET framework which has done this. C# is just syntax that allows you to use the framework. C# just happens to have a very close syntax structure to the C-family of languages. If you are a glutton for punishment go to VB.NET and code in that horrendous language structure, but still be able to do all the things you could in C#.

    2. Re:a bunch of questions by nschubach · · Score: 5, Informative
      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    3. Re:a bunch of questions by Nursie · · Score: 5, Informative

      8th most widely used.

      After Java, C, C++, Visual Basic, Python, Perl and PHP. It just beats out javascript, below that you get into the obscure languages.

    4. Re:a bunch of questions by ByOhTek · · Score: 5, Interesting

      I've tried a number of apps in mono under frebsd (you need lang/mono and x11-toolkits/libgdiplus). Threads, UI, Sockets, SSL sockets, etc. all seem to work fine. Compiled in Visual Studios 2003. It's not even bad as a cross-platform application.

      Conversely, in Suns own Java implementation, going between Windows and HPUX, I've run into issues simply with the regular expression parser of the /find/ function of the String library.

      I'm not saying .NET is perfect by any means, but it's certainly not bad framework either. It's decent for cross-platform apps. Everything has it's flaws, nothing is perfect, etc.

      Yes, I know, there is always a chance MS will say "No more!" to the mono project. As I said, nothing's perfect.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    5. Re:a bunch of questions by GeckoX · · Score: 4, Insightful

      ehh? You do realize that VB.Net is not VB6. When you choose to not use the Microsoft.VisualBasic namespace, which merely contains an abstraction layer to allow VB6 programmers to be more comfortable in .Net, it actually hardly merits the name VB.

      For the most part, the only differences between c# and vb.net are syntax. Begin...End, For...Next control structures rather than brackets is the biggest difference.

      I wrote c# at my last job for a couple of years. At my current shop, they're a vb shop and brought me in to bring things up to .Net. Since all the current devs were vb6 devs, they wanted the easiest path for them to migrate into .Net, thus I had to start working in VB.Net. At first, I dreaded it..but very quickly realized that it's all just .Net, and the VB.Net and C# languages are very comparable, both being just as easy to work in.

      Bottom line, you like curly braces? Use c#. Don't care? Then use whichever you like.

      --
      No Comment.
    6. Re:a bunch of questions by BradleyUffner · · Score: 2, Informative

      Actually, that isn't right either. Microsoft.VisualBasic isn't the compatability layer, it's the VB runtime. It just provides a few extra function that *look* like VB6, some of them don't even behave the same. The actual computability layer is in Microsoft.VisualBasic.Compatability, It's the library that is responsible for doing the weird stuff like giving you collections that start at 1 instead of 0 and other strange stuff. Microsoft.VisualBasic follows all the standards that any other .NET library uses.

    7. Re:a bunch of questions by wtbname · · Score: 2, Insightful

      ehh? You do realize that VB.Net is not VB6. When you choose to not use the Microsoft.VisualBasic namespace, which merely contains an abstraction layer to allow VB6 programmers to be more comfortable in .Net, it actually hardly merits the name VB.

      For the most part, the only differences between c# and vb.net are syntax. Begin...End, For...Next control structures rather than brackets is the biggest difference.

      I wrote c# at my last job for a couple of years. At my current shop, they're a vb shop and brought me in to bring things up to .Net. Since all the current devs were vb6 devs, they wanted the easiest path for them to migrate into .Net, thus I had to start working in VB.Net. At first, I dreaded it..but very quickly realized that it's all just .Net, and the VB.Net and C# languages are very comparable, both being just as easy to work in.

      Bottom line, you like curly braces? Use c#. Don't care? Then use whichever you like.

      So true. I use both C# and VB .Net. It blows my mind how the ignants out there blast VB.Net, while happily code away in C#, a language that at best is slightly syntactically dissimilar. Actually I guess it doesn't. Ignorance is ignorance after all.

    8. Re:a bunch of questions by johnlcallaway · · Score: 3, Interesting

      They can take one company off the list of users. We are rewriting all the C# (and C++) code in Java so we can gain portability. Already, our operations staff is drooling over the prospect of being able to deploy virtual Linux servers that need far less memory instead of Windoze if they want to.

      The first project converted 12 C++ programs to one, far more flexible Java program (that runs 12 times). The nightly run is now 30 minutes instead of two hours and hasn't had an abort in two months. In fact, the operations manager was very nervous for awhile because he wasn't getting paged on the weekends and kept checking the system.

      We could have done the same thing in C++ or C#, but they offered no discernible benefit and are more complicated to use for what we are doing.

      --
      I rarely read replies, it's my opinion and if you thought about your opinion a little more, I'm OK with that.
    9. Re:a bunch of questions by Bright+Apollo · · Score: 2, Insightful

      Actually, COBOL is more widely used than any of those. Not sexy, but it literally pays the bills.

      -BA

    10. Re:a bunch of questions by godefroi · · Score: 2, Informative

      Where have you been? System.IO.Compression has been available since, what, the 2.0 framework? Even before that, you always had SharpZipLib.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    11. Re:a bunch of questions by TheDreadSlashdotterD · · Score: 3, Insightful

      I mean, wow, good for you, picking the right tool for the job. And 12 C++ programs into one Java program? Isn't that an indictment of C++ rather than C#?

      --
      I have nothing to say.
    12. Re:a bunch of questions by BitZtream · · Score: 2, Interesting

      I had a hard time conviencing a Microsoft Developer, who writes in C# that VB.NET and C# are practically identical. Until I pulled out the URL to the MSDN documentation that uses XML and XSLT to show example code in the browser and allows the browser to switch between showing C# and VB examples with a javascript call.

      Its amazing how hard it is for some people to pick up on the obvious. Thats the POINT of .NET, to make a lot of the differences between languages and their output (libraries and executables) go away so you can use whatever suits you or the project best, including multiple languages in the same library/executable.

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
  5. C# is not the most widely used comp language by frith01 · · Score: 4, Insightful

    >>one of computer programming's most widely used languages.

    I highly doubt that a language that has only been around for a few years is the most "widely" used computer language. Cobol, fortran, or standard C , maybe.

    1. Re:C# is not the most widely used comp language by Anonymous Coward · · Score: 2, Insightful

      The author used the words "one of", meaning *not* THE most widely used language. It is pretty common, so it's not really an arguable assertion.

    2. Re:C# is not the most widely used comp language by Nursie · · Score: 2, Informative

      Apparently Java is the top dog today.

      My personal favourite, good 'ol C is in second place. C# was in at number 8, and seems actually to be on the decline.

  6. One of the most widely used languages? by novalis112 · · Score: 2, Interesting

    Really? Is that actually true? I thought it was still relatively obscure. I'm not sure I've ever even met more then a handful of people who have done any real work with it. Am I just totally out of the loop? Has C# truly surpassed C, C++ and Java?

    1. Re:One of the most widely used languages? by Dystopian+Rebel · · Score: 3, Funny

      Yes, it must be one of the most widely used, because it seems that every day I hear of .NET failing to scale somewhere.

      --
      Rich And Stupid is not so bad as Working For Rich And Stupid.
    2. Re:One of the most widely used languages? by Anonymous Coward · · Score: 2, Insightful

      Yes you must be out of the loop to some degree if you have only met a handful of people developing in it. It certainly is not obscure. Where I am there is more C# work going on than any other single language.

    3. Re:One of the most widely used languages? by jlechem · · Score: 4, Informative

      I can feel my Karma burning here but in my office we run into this issue with a lot of MS products. SQL Server 2000 ........ Upgrading is not an option since the DoD just approved SQL Server 2005 for classified use. Apparently 2008 is the bees knees but come on 8 years to get your shit straight? And we've also run into massive problems getting asp.net applications to scale. We've found MS best practices while certainly easy are not very efficient behind the scenes and cause massive slowdown when used on a large scale. And after using their ajax toolkit I wouldn't touch that thing with a ten foot pole.

      Now I might sounds like I'm bashing .net a bit. But .net products do have their time and place. I code in C# almost everyday. But for anything Enterprise I would think twice about it.

      --
      Hold up, wait a minute, let me put some pimpin in it
    4. Re:One of the most widely used languages? by nschubach · · Score: 2, Insightful

      Could that be partly due to the fact that a literal monkey could code it? Hell, most of the code you'd ever need for any program has been posted by some Microsoft programmer on MSDN so the only skill developers have to know is cut and paste. I don't know how many times I've looked through code with myObject and myHttpWebRequest because the developer was too lazy to even change the variable names to fit the purpose.

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
  7. Re:oh goody. by ByOhTek · · Score: 3, Informative

    It's closer to Java than C++. Much closer. Would you call Java a 'slightly altered and nonstandard and proprietary' version of C++?

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
  8. Re:amazing what doesnt get asked by Abcd1234 · · Score: 4, Interesting

    I'm curious, what gives you the idea that C# fragmented "the whole programming scene"? As far as I can tell, C# has really just replaced C++ on the Windows client side, where Java never had a foothold to begin with.

    So, where is this fragmentation you speak of?

  9. C# is a good language by s6135 · · Score: 2, Funny

    I think C# is one of the better languages I have used. I think M$ has done a good job (as they usually do) of stealing the concept and making it easier for the user (in this case, developer). I do understand that as far as M$ is concerned, it is only meant for Windows. However, that does not diminish the fact that it is a good language. I have friend who work solely on Java. Their target deployment servers are linux. But they do all their development on Windows.

  10. You're missing the most radical language of all by BadAnalogyGuy · · Score: 4, Funny

    The Roctothorpe!

    *insert headbanging graphic here*

  11. Re:oh goody. by GeckoX · · Score: 2, Informative

    Either a troll, flamebait, or spoken in ignorance.
    Languages evolve, and anyone that knows c++ and c# knows that what you have stated is patently untrue. Not interested? Then don't bother, but until you do your research, please refrain from throwing in your apparent 2 cents worth...it's not really worth that much.

    As has been stated already, the CLR is in fact a standard, and c# has more in common with Java than with c++. It's an evolutionary language, and it is very popular for a lot of very good reasons. But you'd know that if you cared to bother looking into it.

    --
    No Comment.
  12. Re:Why F#? by xouumalperxe · · Score: 2, Funny

    Well, F# is a perfect fourth up from C#, which offers better resolution than moving to E#, a major third up. At least they didn't go for G, at which point they'd have you begging for G#.

  13. Re:amazing what doesnt get asked by rzei · · Score: 3, Interesting

    Well there is fragmentation produces as they introduce YET another language.

    You currently cannot say C# replaces C++ on Windows platform as using any DirectX components for example is nightmare through C#. Which I think is a rather major obstacle if you have an application that would like to use something other than simple sound output facilities. (Reasons for this might be as simple as choosing a sound output device, on at least .NET 2.0.)

    More on the major downside of writing .NET applications is that you cannot guarantee that the stuff I work on my Vista workstation works on my co-workers XP workstation. This is a very sad "feature" that has been bugging as even with very simple applications. (Side note: We have tried to code using all the best practices you can find from MSDN.)

    Also, GP's point 3 sounds very interesting. Can it be a success when it cannot be used to produce major parts of their own operating system. (No, I'm not talking about writing their kernel with C#).

    Though, the GP doesn't list any sources for point 3, which at least I would be very interested to read as I seem to have missed those articles.

  14. C# Usage by O('_')O_Bush · · Score: 5, Informative

    According to this: http://www.langpop.com/ , C# is only the 9th most popular language, only competing with scripting languages.

    It comes nowhere close to the more popular programming languages in terms of usage.

    --
    while(1) attack(People.Sandy);
    1. Re:C# Usage by andy19 · · Score: 2

      It also says that SQL is a programming language.

  15. Re:amazing what doesnt get asked by Abcd1234 · · Score: 4, Insightful

    Well there is fragmentation produces as they introduce YET another language.

    So? That's a problem for Windows developers. Why should a Java programmer care? In the realms where Java is popular, C# has had basically no influence. So MS has, at worst, fragmented the Windows development ecosystem... big deal. :)

    You currently cannot say C# replaces C++ on Windows platform as using any DirectX components for example is nightmare through C#.

    ...

    More on the major downside of writing .NET applications is that you cannot guarantee that the stuff I work on my Vista workstation works on my co-workers XP workstation.

    But none of this has anything to do with fragmentation to begin with. You're getting off-point. And that's ignoring the fact that, once again, this is a problem for MS... the rest of the programming world doesn't care one whit how hard DirectX is to integrate with C#.

    Can it be a success when it cannot be used to produce major parts of their own operating system.

    Last I checked Java wasn't being used to write operating system components, yet no one claims it's a failure. Now, that's not to say C# and .NET are unbridled successes, but that's a pretty crappy metric for making the call.

  16. Meh. It's alright. Not great yet. by Seakip18 · · Score: 2, Funny

    I'm a little surprised at the ease to attack C# but not much. It actually does a few of the things that C++ folk would like over Java, but I can understand the comparisons with Java.

    Anyways, I've been fooling around with it for a while via an O'Reilly book and so far it's not too bad. That said, I don't see it much use beyond the Windows .Net Framework. Then again, that's all employers seem to want to see on the resume nowadays when it comes to development. And who can blame them?

    I do have a cause for concern though....

    Now, you can argue that we're not obviously open source or anything, but the language is standardized, and the entire specification is available for anyone to go replicate. Mono has done so, and I think Mono is a fantastic thing. I don't know [if] you're familiar with Mono, but it's an implementation of the C# standard and the CLI standard (which is effectively the .NET standard) on Linux, built as an open source project. And they're doing great work and we talk to them a lot and I think it's a super thing.

    The fact it feels like he's faking the enthusiasm, as he did for most of this dumb interview, is slightly scary. The followup question confirms that

    And I guess they couldn't have done that had you not put the specifications out there?

    Well, they could have but it would have been a heck of a lot harder and it would probably not be as good a product. You can go reverse engineer it... they have reverse engineered a lot of the .NET platform... but all of the core semantics of the language, they were part of the standardization process.

    You know most recently we've created Silverlight, which is our browser hosted .NET runtime environment, and the Mono guys have built a project called Moonlight which is an implementation of Silverlight that is officially sanctioned by Microsoft that runs on Linux and other browsers. It's a good thing.

    Lastly...

    It is possible to build alternate implementations. We are not building .NET for Linux, because the value proposition that we can deliver to our customers is a complete unified and thoroughly tested package, from the OS framework to databases to Web servers etc.

    Ummm....just because it's possible to build an alternate implementation doesn't mean it will work the same way. It would absolutely kill me to use a language that implements two things differently because MS wants to hold back special class $VERY_IMPORTANT_FUNCTION that is the paramount to the language, such as database or socket connectivity.

    I seriously hope that Java being opened helps chop block this. With open code, my hope is more places will buy into the language, showing MS that a "industrial-strength" language can be free.

    --
    import system.cool.Sig;
    1. Re:Meh. It's alright. Not great yet. by cryptoluddite · · Score: 2, Interesting

      The fact it feels like he's faking the enthusiasm, as he did for most of this dumb interview, is slightly scary.

      Of course Anders Hejlsberg is faking enthusiasm... just like for instance Bjarne Stroustrup about C++ and C++0x.

      In both cases the language features they chose to include cause incredible amounts of complexity. At first they are all excited about all these cool features... but then when they get to the gritty, like for instance getting C# to beat Java in performance (it doesn't come close), they start tearing their hair out.

      For instance, one big reason Java did not include 'real' generics is because it had never been done before in a major statically-typed virtual machine and the interaction with other parts was not understood or simple. C# just threw it in, and now they have problems like not being able to inline more than one method deep, and only ridiculously simple methods (less than 32 bytecodes, no branches, etc). Another reason was backward compatibility, but see discussions with Bracha for instance about implementation if you think that was the main reason.

      Designers of languages like Smalltalk are enthusiastic forever. Designers of languages like Java are workers, they get the job done and done well but aren't crazy excited about it. Designers of languages like C++, C# go mad and in their warped minds 'complexity is simplicity' and they have to feign enthusiasm so they don't have to admit their mistakes.

    2. Re:Meh. It's alright. Not great yet. by ozphx · · Score: 2, Funny

      So if something is useful, but has a performance hit when used, it should be left out?

      Dang. There goes my bright idea about "methods" with all their wasteful pushing and popping before jmps...

      --
      3laws: No freebies, no backsies, GTFO.
    3. Re:Meh. It's alright. Not great yet. by shutdown+-p+now · · Score: 2, Interesting

      In both cases the language features they chose to include cause incredible amounts of complexity. At first they are all excited about all these cool features... but then when they get to the gritty, like for instance getting C# to beat Java in performance (it doesn't come close), they start tearing their hair out.

      References? I don't see anything about C#-the-language that would cause it to be slower than Java in any reasonable implementation. If anything, value types and methods being non-virtual by default gives it an edge. Delegates are significantly faster that anonymous classes when it comes to implementing the Observer pattern (because implementation of delegates works directly with raw function pointers). And as far as runtimes go, .NET GC has always favored better in my tests than Java GC, by about 15-20%.

      For instance, one big reason Java did not include 'real' generics is because it had never been done before in a major statically-typed virtual machine and the interaction with other parts was not understood or simple. C# just threw it in, and now they have problems like not being able to inline more than one method deep, and only ridiculously simple methods (less than 32 bytecodes, no branches, etc).

      Inlining limitations in .NET have nothing to do with generics at all - they are just thrown in "for good measure", and are often conscious design decisions (because, you know, sometimes inlining decreases performance). Most of them were in place before generics, in fact. Some (such as no inlining for methods taking structs as argument) were just silly, but gladly they finally fixed it in 3.5 SP1.

      Meanwhile, if we're still talking about performance, try comparing the one of java.util.ArrayList<Integer> vs System.Collections.Generic.List<int>. And then come tell us why .NET generics suck because they are slow...

  17. Re:oh goody. by strack · · Score: 2, Informative

    i think you mean "standard encumbered with patents, and not covering the whole libary" and while it is true that it is a interpreted language like java, its syntax is a lot like c++. Although, your probably right. I really shouldn't compare it to c++. thats a insult to c++. Its more like visual basic.

  18. Re:oh goody. by i+kan+reed · · Score: 4, Informative

    Your reply indicates you have new clue what C# is. C# is not a direct descendant in design from c++. C# is a child language of Java more than anything. You could probably convert 90% of C# code directly to java with a simple find/replace regex for keywords.

    C# is also not non-standard. The C# language has a published standard, which, while not open source, is not the same as non-standard. A number of other implementations exist for both the virtual machine level(e.g. mono, boo) and the compiler/ide level(e.g. sharpdevelop)
    C# more tolerable than java in terms of ease of design and naturalness of the language, and good for a similar scope of projects.

    I like the ability to release windows binaries without having a headache about version compatibility, the irrationality of the underlying windows API, or memory leaks in trivial portions of code.

    C# is not the best language for all sorts of problems, but when it comes to banging out a GUI .exe for windows users to use quickly, I don't think there are better choices.

  19. Re:oh goody. by binarylarry · · Score: 2, Informative

    Not only that, but the "standard" is of the type anyone with cash can buy.

    The .NET "standards" weren't submitted to peer review, in a fashipn like IEEE. Instead, they were handed in a manilla folder to a cashier with a whole lot of money.

    Voila, parts of .NET become a "standard".

    Basically getting .NET "standardized" was fancy marketing campaign.

    --
    Mod me down, my New Earth Global Warmingist friends!
  20. Re:oh goody. by morgan_greywolf · · Score: 3, Informative
  21. Re:Oh, well, that explains everything... by FlyingGuy · · Score: 5, Interesting

    Dude, you seriously need to stop sipping the red bull or whatever your drinking...

    Turbo-Pascal was a god send to the programming world. It was an entry point for 10's of thousands of programmers and I am one of them. It was the 1st IDE, write your code then compile and run in one key press! No one had that, not a single company. Yes it was limited to 64K of code and data and only made an image ( com file ), but what you could do in that 64K was beyond anything else at the time.

    Say what you will about Anders going over to the dark side, I mean until then he was my personal hero, but there is no denying the mans brilliance. Turbo Pascal for Windows? Again, no company had anything remotely close to that and he was the architect. Delphi... Again, no one had anything close to that, and he was the architect.

    The OOP model that came out of Borland made C++ look exactly like the joke it was and is today. Their model was infinitely superior, and again, he was the architect.

    The demise of Borland was mostly about Microsoft's malevolence and monopolistic ways. If MS had wanted actual competition, more then likely we would would all be programming in Borland languages to this day, instead of the shit that comes from MS which most of Anders has a hand in, but is corrupted by the MS Marketing machine making technology decisions.

    --
    Hey KID! Yeah you, get the fuck off my lawn!
  22. Re:oh goody. by JasterBobaMereel · · Score: 3, Informative

    "C# is not the best language for all sorts of problems, but when it comes to banging out a GUI .exe for windows users to use quickly, I don't think there are better choices."

    Delphi - Simpler, Faster, less overhead, By the same author!

    --
    Puteulanus fenestra mortis
  23. Re:oh goody. by Goaway · · Score: 2, Insightful

    Yeah, it only took twelve years for that to happen. I guess C# just won't get around to it for another five years.

  24. Re:Oh, well, that explains everything... by morgan_greywolf · · Score: 2, Funny

    It seemed like 90% of the time when I came across a badly behaved application that ignored command line redirects because it went straight to the BIOS just to write its copyright banner, and wouldn't run on anything but a perfect clone, or wouldn't run under DoubleDOS, or (later) required the most stringent DOS emulation under Windows, it was in Turbo Pascal.

    Hey! I wrote some of those applications, you insensitive clod!

    (Whaddya want? I was a 15-year old kid with a copy of Turbo Pascal. A very dangerous thing back then. ;)

  25. Re:oh goody. by Duffy13 · · Score: 2, Interesting

    I'm sorry, gotta disagree right here. I absolutely hate Delphi, it feels like retarded VB compared to my work with C#. Granted this is opinion, but I know I'm not alone in this train of thought.

    --
    "Now you know, and knowing is half the battle!"
  26. Re:oh goody. by bigstrat2003 · · Score: 3, Informative

    Simple, encapsulation of private variable. Java:

    class foo {
      private int dontTouch;
     
      public void setDontTouch(int newVal) {
    //Determine if we want to allow newVal
        dontTouch = newVal;
      }
     
      public int getDontTouch() { return dontTouch; }
    }
     
    class bar {
     
      public void someMethod() {
        foo ourFoo = new foo();
        ourFoo.setDontTouch(5);
        ourFoo.getDontTouch();
      }
     
    }

    C#:

    class foo {
      private int _dontTouch;
      public int dontTouch {
        get {
          return _dontTouch;
        }
        set {
    //Decide if we want to allow the value
          _dontTouch = value;
        }
      }
    }
     
    class bar {
      public void someMethod() {
        foo ourFoo = new foo();
        ourFoo.dontTouch = 5;
        int asdf = ourFoo.dontTouch;
      }
    }

    The implementation is about the same in both languages, but using it is much nicer and cleaner in C# than in Java.

    --
    "16MB (fuck off, MiB fascists)" - The Mighty Buzzard
  27. A note on F# and Ocaml by Cultural+Sublimation · · Score: 3, Interesting

    I think that one of the most interesting developments of C# and most mainstream programming languages is that they keep borrowing long-established elements of functional programming.

    All and all this is a positive development. The only irritating aspect about it is the number of Microsofties who think M$ is inventing new stuff and being "innovative(TM)". A good example of this is F#: while the language is basically an adaptation of Ocaml to the .NET environment (to the point that simple programs are indistinguishable), I've seen plenty of people touting F# as the best thing since sliced bread, but completely failing to mention its roots, or the fact that Ocaml is a well-established language with a long history, and perhaps the most successfull (in terms of actual usage in the industry) of functional programming languages.

    (Though I give credit to the interviewee in this particular article for being an exception to this rule, and for acknowledging F#'s pedigree).

    Incidentally, this has long been a burning question for me: why is a language like Ocaml ignored to such an extent within the mainstream open-source community? It already has a small but vibrant community, excellent coverage in terms of libraries, performance comparable to C++, and the safety and cleanness that comes with functional programming. I even see Linux people excited with F#, seemingly oblivious to the fact that we *already* have a language better than F# that runs natively under Linux!

    (Note: I consider Ocaml to be superior to F# because in the process of transforming Ocaml into F#, Microsoft removed two of the most interesting and powerful features of Ocaml: functors and polymorphic variants)

  28. Re:oh goody. by cerberusss · · Score: 2, Informative

    when it comes to banging out a GUI .exe for windows users to use quickly, I don't think there are better choices.

    I've got a Q and a t who think otherwise. Product page: http://trolltech.com/products/qt/ Wikipedia: http://en.wikipedia.org/wiki/Qt_(toolkit)

    --
    8 of 13 people found this answer helpful. Did you?
  29. Re:oh goody. by Tiger · · Score: 5, Interesting

    Having spent the last seven years using Qt and C++, and the last two comparing that with C#, I'd agree with the original poster: C# is a better choice for fast productivity to a GUI .exe for Windows.

    Throw other platforms into the mix and my decision changes, but that's not what he stated, is it?

    Qt lost a lot of points in my book for just how much time was destroyed in porting our code to Qt4. Two years later, and we're still asking for bugfixes.

  30. Re:oh goody. by morgan_greywolf · · Score: 2, Informative

    (First off, Java was ALWAYS open source, just not OSI-compliant)

    But the difference is that Microsoft has committed developer resources to work with the Mono team at Novell. Sun never committed any resources to work on GCJ.

  31. Here's some data that may help by SaDan · · Score: 2, Informative
  32. Re:oh goody. by tjwhaynes · · Score: 4, Insightful

    The implementation is about the same in both languages, but using it is much nicer and cleaner in C# than in Java.

    That really is a matter of opinion. In Java, it's pretty clear that you are requesting or modifying a property of the object. In C#, you are using assignment to represent that mechanism so you might be accessing a public member variable directly or calling a method to achieve that end. To me, the Java method is more explicit and therefore less prone to error.

    Cheers,
    Toby Haynes

    --
    Anything I post is strictly my own thoughts and doesn't necessarily have anything to do with the opinions of IBM.
  33. Re:remember the carnagie melon self guided vehicle by mc2thaH · · Score: 2, Informative
    I believe you're speaking of this story that was covered on slashdot. The problem was not an issue with C#, but an issue with Princeton's code. They were keeping references to objects, which in turn kept them from being released for garbage collection.

    After a month or so of line by line code inspection the team discovered that the C# code they used had inherent memory leaks and the problem was not repairable

    Actually, they did fix the problem... since it was an issue with their code and not C#. C# was doing what it was supposed to.

  34. Re:oh goody. by eggoeater · · Score: 2, Informative

    In Java, it's pretty clear that you are requesting or modifying a property of the object.

    Really? The paranthesis after the method name inclines me to think of it as a function, and I prefer using assignments vs a function call; it's easier to read and debug.
    eg. blah.Prop = someFunct(); is easier to read than blah.setProp(someFunct());

    In C#, you are using assignment to represent that mechanism so you might be accessing a public member variable directly or calling a method to achieve that end.

    Which is kind of the point... a property is exposed as if it were a public member. I don't /care/ if I'm assigning to a property or a public member.

    To me, the Java method is more explicit and therefore less prone to error.

    What? Can you give me an example of how it is less prone to error?

    I program in Java too, but I prefer c#. I see c# as an improved version of java. The designers of c# learned from their mistakes.

  35. Re:oh goody. by denoir · · Score: 2, Insightful
    Actually, with the latest incarnation of C#, it gets much more compact. I don't know how to get indentation to work within the ecode tag but you should still get the idea:

    class foo
    {
    public int dontTouch { get; set; }
    }

    class bar
    {
    public void someMethod()
    {
    foo ourFoo = new foo() { dontTouch = 5 };
    int asdf = ourFoo.dontTouch;
    }
    }

  36. Re:oh goody. by asg1 · · Score: 2, Informative

    Hogwash. Anyone who has spent any time whatsoever with C# in Visual Studio knows the difference between a property and a public variable when they try to assign it. And if you have intellisense off, then the only people who will get confused are those who don't follow any sort of naming conventions. And in that case, they are likely to get confused no matter what language they are in.

  37. Re:Oh, well, that explains everything... by dwye · · Score: 2, Insightful

    > Turbo Pascal and Delphi were popular because 20 or so years
    > ago universities taught Pascal to their computer science students.

    False, or else MS-Pascal would have become equally popular. Turbo Pascal was popular because it only cost $44.95, thus falling into the "buy it for a lark, try it, and toss it if it isn't good" buying space. Turbo C and Delphi, in their first versions, were equally under-priced, compared with $250 or so for MS compilers, and over $500 for some of the really good C compilers.

    The really good, independently produced, compilers died away as Borland's cheapness and MS's standardness (not real standards, THEIR standards, but they wrote the OS, so *surely* they had the best tools? NOT) gradually undercut their niches. The first Turbo versions were crippled from the POV of professional programmers, but were good enough for students, amateurs, etc., and Borland then introduced better compilers for higher prices, until the best version was about as expensive as MS C, but slightly better (following the old GM strategy of cannibalizing yourself, rather than letting competitors do it, by covering all the price points). GNU C also helped kill them, as it was also good enough to make the other compiler companies' offerings redundant.

    > About the time Delphi came out, things moved on
    > and they began teaching C++ which pretty much
    > killed Delphi off.

    Actually, the programming market had only moved from Pascal to C, but Delphi was very wed to Pascal and its idioms. It also ran into the wall, in that the REALLY complicated stuff that professionals did was beyond it, and Borland didn't have a follow-on product.

  38. Objective-C is what you are looking for by SuperKendall · · Score: 2, Informative

    We still don't have a good replacement for C or C++. The big problems with C are 1) the language doesn't know how big arrays are (the cause of most of the buffer overflows in the world), 2) the language has no clue about concurrency or locking (the cause of most of the race conditions in the world).

    Objectve-C fits both criteria. You use the found class NSArray for pretty much everything so you don't get buffer overflows, and you have a decent threading model with runloops and Java style @syncronized statements for threading, along with a lot of useful functionality to do common things with threads (like detaching a thread, having a thread run a method after a short delay, etc.). Further helping desktop aps at least is garbage collection, but even when you can't use that the memory model of release/retain is still more easy to use and less prone to having issues.

    And, you can always fall back to C or C++ as needed.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  39. E# and F by Tetsujin · · Score: 2, Informative

    Pretty sure that music precedes unicode, dude, and they write the sharp sign using anything that looks like a tiny smooshed tick-tack-toe board.

    At any case, you're both wrong. "E#" is pronounced "eff" - there is a half step between E and F, and the "#" sign denotes "do this note, except take it up half a step."

    E#==F.

    That's actually not entirely true.

    It is true that going a half-step up from E gives you F. However, in certain keys you'd still refer to the note as E#.

    --
    Bow-ties are cool.
  40. That's what *# does, dumb down languages by SuperKendall · · Score: 3, Informative

    Incidentally, this has long been a burning question for me: why is a language like Ocaml ignored to such an extent within the mainstream open-source community? It already has a small but vibrant community, excellent coverage in terms of libraries, performance comparable to C++, and the safety and cleanness that comes with functional programming. I even see Linux people excited with F#, seemingly oblivious to the fact that we *already* have a language better than F# that runs natively under Linux!

    (Note: I consider Ocaml to be superior to F# because in the process of transforming Ocaml into F#, Microsoft removed two of the most interesting and powerful features of Ocaml: functors and polymorphic variants)

    I can't exactly answer why other languages don't get more play - but I can lament that the .Net platform has been responsible for draining some of the life out of every language they touch. I still remember a very excited Eiffel proponent being very excited about Eiffel# when it first came out - not realizing it was a gateway for Eiffel users to flow to pure C# programming.

    Perhaps F# is a true move by Microsoft to switch everyone to functional programming, but it could just as easily be a trick to get people using the .Net platform and then through convenience get them to move naturally to C# from there...

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  41. Re:oh goody. by digitig · · Score: 2, Insightful

    Better than C#? Well, how many platforms can you name that C++ is not available for? If you're willing to go back to an early version of C++ it compiled via C (may be possible even for current versions, I've never bothered looking into it), so at least some version of C++ would run on anything that runs C (and had enough resources).

    --
    Quidnam Latine loqui modo coepi?
  42. Re:oh goody. by molarmass192 · · Score: 2, Insightful

    "C# ... is very popular ..."

    By "very popular" I take it you mean less popular than Perl or Python, but more popular than Delphi.
    http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

    --

    Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws-Plato
  43. Re:Oh, well, that explains everything... by argent · · Score: 2, Insightful

    I was a 15-year old kid with a copy of Turbo Pascal. A very dangerous thing back then.

    Aha! "Turbo Pascal, the PHP of the '80s."

  44. Re:oh goody. by The+Mayor · · Score: 3, Interesting

    Yeah, that was what I thought before I started using C#. I am a 10+ year veteran of the Java world, and have spent the last year or so on a large C# project. C# has much better syntax in every way that it deviates from Java. Properties are quite clear, since VS does a nice job. Under the covers, there is *no* difference between a property with an implicit getter/setter (i.e. you didn't provide one, so you access the variable directly)--the bytecode creates a synthetic get_ and set_ method, allowing things like AOP to work even if no explicit getter/setter is provided.

    The Java method results in much more verbose boilerplate code. This also causes many developers to do more cut-and-paste, another source of potential error. The Java method makes tech like AOP much harder, as there is no synthetic method call surrounding access to public member variables. The Java method is, in short, not object oriented, as it does not properly abstract away property access, so Java tacked on this stupid getXXX/setXXX naming convention in the JavaBean standard.

    There are many reasons why Java is a superior platform than .Net/C# (maturity of 3rd party libraries, the open source community, the quality of design in the provided libraries). But the language itself is not one of them. I cannot think of a single area where Java bests C# in terms of the language itself. C# really is the next generation of Java, and has learned from Java's mistakes.

    --
    --Be human.
  45. Re:oh goody. by aztracker1 · · Score: 2, Interesting

    If you have to use legacy libraries (dll/so), then you will definitely like .Net over Java. That's my single biggest gripe with Java, is the pain that is JNI. I also find that development in VS is far easier than using any of the Java IDEs I've tried. Not to mention that ASP.Net, Dynamic Data, and MVC frameworks are easier than anything in the Java side of things to get up, running, and debugging at runtime. Java is more portable, that is a given. But I still prefer C#/.Net.

    --
    Michael J. Ryan - tracker1.info
  46. Re:oh goody. by salgiza · · Score: 2, Informative

    It hides from the developer that you are actually doing something that could be costly.

    For example, that innocent "item.price" could actually be calling an stored procedure that makes all kind of querys to get the right price for the current session customer.

    In Java, item.getPrice() would be a hint to this fact. In C#, someone could abuse the property, in different instances of the same item, unaware that he should cache the value to avoid performance hit.

    Of course, there are ways to prevent this, but are mostly related to procedures the developers must follow.

    Actually, while I really like C#, LINQ, and Visual Studio on the whole (I'm quite happy developing with it), I'm starting to understand why Java had some things that forced the programmer to be explicit about what his/her code did. Not forcing you to catch or throw exceptions means, for example, that methods that couldn't throw an exception (according to it's definition) actually throw them. And you didn't put a try catch because it was a simple call and there were no methods that could throw...

  47. Re:oh goody. by haystor · · Score: 2, Funny

    If your goal is ugly code, then Java is the clear winner.

    I should really use monstrously long words and about 38 more lines to explain this, but Java is not my preferred writing style.

    --
    t
  48. Re:oh goody. by maestroX · · Score: 4, Insightful
    I like neither way.

    Java: Properties are private variables/methods exposed through a public method. Seems unnatural and tedious when accessing a guarded variable, e.g.

    Line.GetWidth(); Line.SetWidth(10);

    Two different calls for accessing a single property.

    C#: Properties are private variables/methods exposed through a public variable. May be cause for surprise e.g. when

    Line.Width++

    increases width and executes statements outside the scope of width increase.

    For exposing a (guarded) private variable I prefer the C# way, but it's too easy to mix data with flow.

    I don't feel a property can be accessed as either a variable or a method, because it isn't and adds to confusion.

  49. Re:oh goody. by nog_lorp · · Score: 2, Informative

    I had a bad experience with .NET 2, where in order to open an old project in Visual Studio it insisted on converting to .NET compatibility apis. The rather simple program then ran insanely slow, so slow that the interface was sluggish and it was useless for its purpose (automation).

  50. Re:oh goody. by Dun+Malg · · Score: 2, Informative

    It hides from the developer that you are actually doing something that could be costly.... there are ways to prevent this, but are mostly related to procedures the developers must follow.

    You mean like reading the documentation and/or the source code of the class you're using? If you don't know how or where the object is getting its data, then you're just as in the dark whether it's data passed via a C# get/set or a Java method. Granted the Java method approach is a "clue" that it's not just a member int being set, but I'm not sure that's the ideal way to "get a clue"...

    I understand what you're getting at with all this, but at some point familiarity with the road is going to serve you better than guardrails all over the place.

    --
    If a job's not worth doing, it's not worth doing right.
  51. Re:Python by zuperduperman · · Score: 3, Insightful

    Here are some problems with Python:

    * significant whitespace does not play well with common development practices (merging, diff'ing, copying, pasting code, esp. on web pages)
    * GIL makes it very hard to scale or completely unscalable in some situations
    * no support for static typing makes large projects harder to manage
    * not truly cross platform - a lot of common libraries are implemented in C and thus you have to install native code for them to work - bad luck if there isn't a binary for your platform.
    * no common standardized GUI toolkit
    * poor commitment to backwards compatibility - Python 3k is going to break compatibility in major ways as did releases before it
    * awkward and ugly object oriented semantics (declaring "self" in class methods, ugh)
    * poor IDE support
    * poor adoption - not sure what makes you think the labor pool for Python is better than other languages

    I'm sure a dozen python supporters will jump up and object to all these - there is hardly anything revolutionary about these criticisms and most of them have been fought to death in enormous flame wars in the past. But the end result is, Python is not great for a lot of "enterprise" type situations due to these things (and you will quickly see how sensitive pythonistas are to this snub since they constantly mock the word "enterprise" on mailing lists etc.). In other situations it can be brilliant.