Why do you prefer C#?

This is a discussion on Why do you prefer C#? within the C# Programming forums, part of the General Programming Boards category; Originally Posted by brewbuck If you can give another example that doesn't involve an obscure keyword that nobody uses then ...

  1. #31
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Quote Originally Posted by brewbuck View Post
    If you can give another example that doesn't involve an obscure keyword that nobody uses then I'll concede that point.
    How long did it take compilers to correctly implement partial template specialization, which although a bit obscure is also a very powerful and often-necessary tool? GCC had buggy implementations (often resulting in crashes) until 3.3.1, which was five years after the standard. Much of Boost didn't even work on GCC until 3.3.x, and as far as key third-party libraries, Boost is at the top of the pack.

    One compiler on one piddly little platform. What are you going to do when a customer offers you $100k to port your application to AIX? Hell, even Java would be a better choice.
    There are actually several C# compilers, some which are open source and cross-platform. Not all of them implement all the proprietary portions of the .NET framework (portions of the framework are not standard C#) but some do. And that "one platform" also happens to be the platform with 90% market share in the personal computer market, so if you're targeting an application for that market, being Windows-only is no big deal at all.

    Obviously C# isn't the best tool for every job, but that doesn't mean it's never the best tool for any job. A hammer is a perfectly useful tool even if it can't drive screws; in fact you'd be foolish to spend your time driving nails with a screwdriver. Different situations are best handled in different programming languages, and C# happens to have a very nice and rather large niche for designing Windows GUI applications. Choose the tool based on the job, not based on your feelings about the tool.
    Last edited by Cat; 12-05-2007 at 12:58 PM.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  2. #32
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,985
    Quote Originally Posted by Cat View Post
    ...A hammer is a perfectly useful tool even if it can't drive screws; in fact you'd be foolish to spend your time driving nails with a screwdriver...
    I just have to add this, but though it may be foolish to only use a screwdriver instead of using a hammer when the need arises, only using a screwdriver prevents you from smacking your thumb and smashing it with the hammer
    Translation: Even I used the right tool for the job (C#), I can still get burned [Don't like how the C# is? Too bad, 'cause the hammer is the right tool for the job!] (smashing my thumb), but if I use a screwdriver (C++), I'm perfectly safe (or safer).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #33
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,269
    Quote Originally Posted by Cat View Post
    How long did it take compilers to correctly implement partial template specialization, which although a bit obscure is also a very powerful and often-necessary tool? GCC had buggy implementations (often resulting in crashes) until 3.3.1, which was five years after the standard. Much of Boost didn't even work on GCC until 3.3.x, and as far as key third-party libraries, Boost is at the top of the pack.
    I don't see how this is an argument. Yeah, compiler support was iffy in the past. Choosing C++ at that time may have been unwise. Times change though.

    Different situations are best handled in different programming languages, and C# happens to have a very nice and rather large niche for designing Windows GUI applications. Choose the tool based on the job, not based on your feelings about the tool.
    It's not my feelings about the tool. Ironically, the few times I've used C# I've felt comfortable with it. If it only had true templates, I'd probably be using it in preference to C++. It's my feelings about MICROSOFT and their DEMONSTRATED propensity for repeated, deliberate breakage of standards and deliberate incompatibility with other products which adhere to standards. This isn't blind hate -- MS has been declared, legally, in a court of law, to be in violation of various monopoly and anti-trust statutes. They show a pattern of antisocial behavior which is not going to change any time soon.

  4. #34
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    Use the right tool for the job at hand. If you want to code a GUI in C++ and that is the right tool for you then so be it. But insisting that doing it any other way than your way makes you a tool.

    I choose whatever will get the project done reliably and in due course. If the team does not know MFC it's probably not a good idea to force them to use it. If the team knows MFC better than Microsoft but does not know a lick of C# then prob would go with MFC even though it would take mere days to learn C#.

    C# is a godsend and now with .NET 2.0 it's even better. Generics simply put are the best thing since sliced bread and beat the crapola out of those nasty untyped everything fits inside ArrayLists. There isn't one person I know who is familiar with .NET who prefers 1.1 so saying it's crappier in 2.0 is, to me, an uneducated statement since 2.0
    is better in just about every aspect.

    As I see it this debate has two sides. Those who are talking about C# vs C++ and those who are talking about Microsoft vs the world. This is not a debate about languages but more a debate about Microsoft. So I say get over it, stop bashing them because nothing is perfect, and use what works. I agree that Microsoft's practices are questionable at times but I have seen a move away from some of them. Namely these are some of the good things I see
    • The free release of a very good development environment. It does not do MFC but that's not because Microsoft is stingy, it's because they are trying to tell people don't use MFC and use .NET. This dev environment is not a joke and is far better than anything we actually paid for years ago. Two thumbs way up to Microsoft for releasing this express version.
    • Excellent documentation and help system with all of their products and their website has tons of free information, examples, and so forth.
    • Ongoing support for deprecated OS's. Even though Microsoft has released Vista they are well aware that most of the world for now is going to stick with XP. They realized this as well when they released XP and supported 98SE for quite some time thereafter. This ongoing support approach allows me the user to choose when I want to upgrade. I think they are trying to step away from the upgrade or else approach and they are doing well.
    • Continual fixes for Microsoft products. Fixes come out faster than bugs are found and while they never address them all (who can?) they do end up with a very good product in the end. XP sucked at first but then we had SP1 and now with SP2 it's probably the best OS out there. Vista will be the same eventually. This pattern has been evident ever since Windows 95. Product release sucks and then they fix it. With each Service Pack their products do get better unlike some patches for other things.
    • Continual support for DirectX and Direct3D. Microsoft said that one day you could run any Direct3D game on any video card so long as the drivers worked and for the most part they have been dead on. Let's face it, this works like a charm today.
    • Microsoft's refusal to sit on their laurels and continual development of new innovative products. It seems like they are always doing something.


    And, no, I don't work for Microsoft. But without their products I would consume much more Advil at work.
    Last edited by VirtualAce; 12-05-2007 at 04:58 PM.

  5. #35
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,269
    Quote Originally Posted by Bubba View Post
    Use the right tool for the job at hand. If you want to code a GUI in C++ and that is the right tool for you then so be it. But insisting that doing it any other way than your way makes you a tool.
    Who's insisting anything? I have an opinion, I expressed it.

  6. #36
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    It's an implicit insistance. And where in my post did it say brewbuck? It would be nice if all us stopped arguing over such trivial matters.

  7. #37
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Quote Originally Posted by brewbuck View Post
    Ironically, the few times I've used C# I've felt comfortable with it. If it only had true templates, I'd probably be using it in preference to C++.
    What is it about C# generics that you dislike?

    The only truly annoying thing I find about them is that you can't constrain on the presence of an operator, and the workarounds are less elegant (e.g. IComparable compared to operator<). It's something I'd hope for them to do in the future.
    Last edited by Cat; 12-05-2007 at 05:23 PM.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  8. #38
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,269
    Quote Originally Posted by Cat View Post
    What is it about C# generics that you dislike?
    They aren't truly static (you could actually view that as a benefit OR a drawback depending how you look at it), and you can't write metaprograms with them.

    The only truly annoying thing I find about them is that you can't constrain on the presence of an operator, and the workarounds are less elegant (e.g. IComparable compared to operator<). It's something I'd hope for them to do in the future.
    It should be simple for them to implement a principle similar to C++ SFINAE. If one generic can't be instantiated (due to a missing operator or some other type conflict), just go to the next one until you find one that works. Only if there are NO generics which match, should it be considered an error.

  9. #39
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    What are you going to do when a customer offers you $100k to port your application to AIX?
    That's not my business, but I would expect our marketing guy to ask him if that's monthly payments and if he already has aquired the (third party) database licences costing a multitude of what he offers himself or if we should simply add that to the bill. As I said, I'm not talking about two buttons and a textbox.

    For our product (that is not supposed to go to the customer, but used internally) vendor independence is totally mood because for example there is only one, maybe two database vendors that can support our infrastructure commercially. And yes, we do use their drivers for that 5% extra performance. Does that make us dependent on a third party ? Totally. If Larry grabs a gun and shoots every single one of his 50.000 employees, economically, the company I work for would be toast, too. If Billy Boy revokes our Licences, we would be smashed. But then, we rely on Germany not changing it's privacy laws, we rely on our house to not be torn down by tornadoes or floods, we rely on many things we have no control over.

    What would be less Microsoft-centric would be coding to an actual standard which is accepted somewhere other than on Windows platforms.
    As I said, for every job, there is a tool that works best and as C# drawbacks don't concern us, right now C# and vendor dependent C++ (MFC) work best. Somethings else would cost more money and business is about money, not about "the right thing". What I code in private is a totally different story.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. which way you prefer
    By l2u in forum C++ Programming
    Replies: 4
    Last Post: 06-07-2007, 12:39 PM
  2. What Font Size do you prefer?
    By SourceCode in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 03-23-2003, 04:58 AM
  3. Which one will you prefer: cout or printf
    By Yoshi in forum A Brief History of Cprogramming.com
    Replies: 35
    Last Post: 02-06-2002, 10:42 PM
  4. what do you prefer
    By whistlenm1 in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 01-28-2002, 09:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21