Thread: Why do you prefer C#?

  1. #16
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Quote Originally Posted by Elysia View Post
    Uhuh, but so what does this do, exactly? A little less code, yet bigger executables?
    Exactly. Less code means easier maintenance.

    Yes! For inexperienced devs, but not for experienced ones!
    Exactly. And if I need an experienced coder for C++ and a slightly less experienced for C#, it means that C# is cheaper to use.

    It certainly is harder to do GUI in C++, but with all those libraries out there, it's DO-able. One just needs to know how.
    Same thing here. Yes, it's doable. With a considerably amount of experience, time and a third party library that probably comes with costs of it's own, licensing, knowledge needed or whatever else. If you have a customer demand the the first row of the list be a special kind of green if it's wednesday, then that's a no-brainer in C#. You will need a third party library or a ton of custom code in C++.

    Plus it creates bigger executables and it's easier to reverse engineer.
    Both is totally irrelevant to my field of work. I'm neither short on disc space nor will anyone outside of the company get access to my executable. May differ for you. Obviously different environments need different tools.

    But there's also the speed question. If something takes 5s to do, just like clicking a button, then I'd find that program very bloated and unfun to use.
    So do I. But that's a crappy program and I can guarantee that the same program will take maybe 4.8s in pure Assembly. Bad programming is bad programming. .NET programs, like Java programs, only take longer to load because they are compiled at runtime. Startup time to me (and my customers) is irrelevant, remember I'm not talking two buttons and a textbox here, the programs are started once and then used for the remainder of the day. Even client validation against the database and database login will take longer than startup. If the application does a lot of stuff, time for startup becomes irrelevant. Again, this may differ for you. Different environments, different tools, yada yada yada.


    While running, no GUI in any language will take any amount of time that is noticable to the user. If it does, it's either real processing that has nothing to do with the GUI, or it's simply ........ty programming.



    I love C++ and it's power just like I love a car that has some more raw power than I'd ever need. But if it comes to getting a job done fast and efficient, I'd rather take the tool that fits best. Which right now for me is C#.
    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.

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    So were we discussing C# vs C++ or C# maintence easier than C++ (in general)?
    Also, for the less codebase... C or C++ has probably THE largest anount of code out there for you to grab, tested and optimized, making less work for you. Yes, you may have to search, but it makes less code to maintain, just like the .NET Framework.

  3. #18
    Registered User
    Join Date
    Jun 2007
    Location
    Usa, Pa
    Posts
    39
    Ah, another C++ Vs. C#.

    Well this link should solve this!

    C++ Vs. C# Article! In the end does it really even matter?
    IDE and Compiler - Microsoft® Visual C++® 2005 Express Edition
    Operating System - Microsoft® Windows® XP Home Edition SP2

  4. #19
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    That's what I've been trying to tell... does it matter what language you use? In the end, the result is the same.
    (Except I won't lay my hands on C#. I hate C# and the .NET framework with a passion, but that's just me.)
    Last edited by Elysia; 12-03-2007 at 10:49 AM.

  5. #20
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    Quote Originally Posted by Elysia View Post
    (Except I won't lay my hands on C#. I hate C# and the .NET framework with a passion, but that's just me.)
    Thats just plain stupid, I dont know at which stage you are in life. But with a mindset like this you will bump into alot of walls!

  6. #21
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Stupid it may be, but it's my choice. I dislike C# and everything .NET.
    Also, I don't like Microsoft, but that's not why I dislike C#. I don't like the syntax (^ for pointers?! Are you kidding me?!), but I don't like the overall language as well. It goes against the principles of C++ - less control and safer. I like to be in control of what I can do and mess around at a level that just can't be done in C#.
    In C++, I can mess around with memory, swap, manipulate and so on, but I can't in C#. And that's why I dislike C# and .NET.
    And yes, I have used both. C# was a good mixture when it was 1.0, when you could easily mix C++/.NET, but since 2.0 it's just gotten crappier and crappier.
    Last edited by Elysia; 12-03-2007 at 02:47 PM.

  7. #22
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by GanglyLamb View Post
    Thats just plain stupid, I dont know at which stage you are in life. But with a mindset like this you will bump into alot of walls!
    To keep a job, a programmer has to mostly do what he/she is told to do. That doesn't mean we have to like it, and it doesn't mean we should shut up about the potential drawbacks. In some cases, using the wrong tool borders on unethical -- would civil engineers build a bridge out of plastic just because some suit told them to do it that way?

    The problem with C# is that it is a proprietary framework, and the further it penetrates into everything the more reliant the entire world becomes on Microsoft. This is not an anti-Microsoft position, it is a realistic engineering position. You simply don't build important things out of components that you have zero control over and which can be changed by a third party at any time.

    if we see an ISO standard emerge for C#/.NET and companies actually begin to pick it up and implement it, then the whole situation has changed. Until that time, using C# is just worshipping at the altar of Microsoft while digging a very deep hole for yourself.

  8. #23
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Also, I don't like Microsoft, but that's not why I dislike C#. I don't like the syntax (^ for pointers?! Are you kidding me?!),
    Are you sure you are not mixing the two up here? Visual C++/CLI .NET uses ^ for pointers. There are no 'real' pointers in C#. C# is like Visual Basic with C. It really feels about the same too.

    Personally I can vouch for C# being extremely simple since I learned it in a matter of days for a project I was working on. On the third day I was already interoping unmanaged C++ and C#. The GUIs in C# are so simple but some of the more advanced topics can get hairy later down the line so it's not a complete noob language.

    Development time is cut down from coding a GUI in a few months with C++ to a few weeks in C# with the same or better functionality. I like the concept of .NET although I still feel some of the controls are lacking in areas and the interop is still not as smooth as it could be. But generics in .NET 2.0 solve the nasty type issues with ArrayList and overall the programmer is presented with a fairly impressive toolbox to work with. Now for me personally I can create an MFC (non doc-view) dialog app in about the same time as a C# .NET dialog project but not everyone is at that point with MFC. The classes are not daunting to me anymore but if you remember my tons of posts about MFC in prior times you will realize it was quite a pain in the arse learning it from scratch. Learning curve in C# is next to nil but that is not to say it does not take skill to use. C# is a godsend to programmers who have to do GUIs but either cannot do pure Win32 or don't want to and also do not know MFC. So instead of using VB you can use C# and still retain some C++ flavor without all the complexity of MFC.

    I would not use C# for everything but for GUIs it just cannot be beat. So to meet my project deadlines and to make those far above me happy I use C#. This is not saying I'm not a good C++ programmer it's saying I'm a smart programmer in that I use the best tool for the job at hand. Now if we were coding some uber super 3D stuff then no I would not use C#. But using C# instead of C++ for GUIs and to save development time does not make you any less of a programmer. Rather I think it means you can utilize your time and resources effectively to get the project done on time.

    This is not an anti-Microsoft position, it is a realistic engineering position. You simply don't build important things out of components that you have zero control over and which can be changed by a third party at any time.
    Since about a good 80% of your clients will have a PC with some version of Windows XP or Vista on it your statement actually works in your favor. You are guaranteed that your code will run on their machine just as it does on yours. And at work I'd say about 75% of the stuff I build with I either did not code, came from a thirdy party and/or I do not have control over. This to me is not a valid argument.

    And just a news flash for the mainstream PC market out there....it is a Microsoft world whether we like it or not.
    I love Linux as much as the next guy and all the other platforms but MS is still the dominant force. I'm not saying it's right, fair, or that we have to like it but IMO it is fact.
    Last edited by VirtualAce; 12-03-2007 at 09:08 PM.

  9. #24
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    Quote Originally Posted by Elysia View Post
    And yes, I have used both. C# was a good mixture when it was 1.0, when you could easily mix C++/.NET, but since 2.0 it's just gotten crappier and crappier.
    Simply, I don't believe you. Anyone that's used C++/CLI knows that 2.0 brought significant clarity to the language, which previously felt uncomfortably like a bunch of ill-considered language extensions. 2.0 also brought generics to both C# and C++/CLI, a needed expansion for C# and an interesting tool when combined with templates in C++/CLI. I don't know of anyone else who has worked in both and seriously thinks that 1.0 was superior in any way. I do not doubt your seriousness.
    Quote Originally Posted by brewbuck View Post
    This is not an anti-Microsoft position, it is a realistic engineering position. You simply don't build important things out of components that you have zero control over and which can be changed by a third party at any time.
    Wow, using that logic, there should be no third-party Windows applications, since no one other than Microsoft has any control over the Windows API. Programmers use components that they have zero control over all the time. Those that don't spend their time re-inventing the wheel.
    Quote Originally Posted by brewbuck View Post
    if we see an ISO standard emerge for C#/.NET and companies actually begin to pick it up and implement it, then the whole situation has changed. Until that time, using C# is just worshipping at the altar of Microsoft while digging a very deep hole for yourself.
    Is that all you need?

    ISO/IEC 23270:2006 - Information technology -- Programming languages -- C#

    ISO/IEC 23271:2006 - Information technology -- Common Language Infrastructure (CLI) Partitions I to VI
    ISO/IEC TR 23272:2006 - Information technology -- Common Language Infrastructure (CLI)
    -- Technical Report on Information Derived from Partition IV XML File
    ISO/IEC TR 25438:2006 - Information technology -- Common Language Infrastructure (CLI)
    -- Technical Report: Common Generics

    It's cute when people voice interesting and inflammatory opinions without really knowing what they're talking about. The .Net framework is simply an implementation of CLI. As you can see, ISO's for both C# and CLI already exists. Further, Microsoft is not your only option for a CLR. Novell produces the Mono framework, which implements much of Microsoft's implementation and provides additional libraries. The Mono framework has the added bonus of working under both Linux and Windows. It's not complete (if you take the position that missing anything from .Net is lacking), but if you spend your time coding to Mono instead of to .Net, then it doesn't matter.
    Last edited by pianorain; 12-04-2007 at 08:18 PM.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  10. #25
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by pianorain View Post
    Simply, I don't believe you. Anyone that's used C++/CLI knows that 2.0 brought significant clarity to the language, which previously felt uncomfortably like a bunch of ill-considered language extensions. 2.0 also brought generics to both C# and C++/CLI, a needed expansion for C# and an interesting tool when combined with templates in C++/CLI. I don't know of anyone else who has worked in both and seriously thinks that 1.0 was superior in any way. I do not doubt your seriousness.
    2.0 also deprecated pointers and introduced crap syntax to C++/CLI.
    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.

  11. #26
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Quote Originally Posted by Elysia View Post
    Uhuh, but so what does this do, exactly? A little less code, yet bigger executables?
    In most cases, a slight difference in executable size is completely irrelevant; large applications tend to be large because of data files, not because of executables.

    And less code to write is less code to maintain.

    Yes! For inexperienced devs, but not for experienced ones!
    I can maintain a C++ program just as well as a C#. We can divide them into categories - for inexperienced and experienced.
    I have 16 years of C++ experience and I still think C# is easier to maintain. I can do either, but all in all I'd rather be doing C#. Obviously it's doable to maintain C++, but that doesn't make it as easy as C#, even for a professional.

    It certainly is harder to do GUI in C++, but with all those libraries out there, it's DO-able. One just needs to know how.
    Again, obviously it's doable. The question is whether it's worth doing; are there benefits that exceed the drawbacks? It's doable to hammer a nail with a screwdriver, but that certainly doesn't make it the best tool for the job.

    But there's also the speed question. If something takes 5s to do, just like clicking a button, then I'd find that program very bloated and unfun to use. And this might just be the example of C# and .NET.
    Honestly, unless you're programming cutting-edge games, there's little you'll ever notice in speed difference. If you're actually lagging your UI, that's poor program design, not poor language choice.
    Last edited by Cat; 12-05-2007 at 12:32 AM.
    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.

  12. #27
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    The problem with C# is that it is a proprietary framework, and the further it penetrates into everything the more reliant the entire world becomes on Microsoft. This is not an anti-Microsoft position, it is a realistic engineering position. You simply don't build important things out of components that you have zero control over and which can be changed by a third party at any time.
    Our whole line of work is built on using stuff we have no control over. Even Open Source in the end is an illusion. You are afraid MS will pull the plug ? What happens if Linus pulls the plug ? Don't tell me you personally will code patches and future Linux versions to support your line of products. You have the source. But you still need the manpower to put it to use. And you don't have it, or you wouldn't be using somebody else's OS, but your own. With open source, you can at least hope someone else does the job, but don't tell me that is "independent". It's the same dependency on external events you have no control over.

    As a last thought: if an application is windows-only, why would I bother with a cross platform framework? Why not use C#? Do you think the same application would be less Microsoft-centric, if I build it using MFC?

    Show me a single GUI Framework for C++ that cannot be changed by a third party at any time.
    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.

  13. #28
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Quote Originally Posted by brewbuck View Post
    The problem with C# is that it is a proprietary framework, and the further it penetrates into everything the more reliant the entire world becomes on Microsoft. This is not an anti-Microsoft position, it is a realistic engineering position. You simply don't build important things out of components that you have zero control over and which can be changed by a third party at any time.

    if we see an ISO standard emerge for C#/.NET and companies actually begin to pick it up and implement it, then the whole situation has changed. Until that time, using C# is just worshipping at the altar of Microsoft while digging a very deep hole for yourself.
    The nice thing about C# is that it actually HAD a standard since day 1. C++ wasn't standardized for nineteen years, and its second major revision will be at least a decade after its first. Further, even the existing standards aren't fully implemented on modern compilers -- most compilers (even GCC) don't support the export keyword, and that's been part of the official standard for almost ten years. At least with C#, you have the standard, and you know there's at least one compiler that conforms to it exactly.
    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.

  14. #29
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Cat View Post
    The nice thing about C# is that it actually HAD a standard since day 1.
    I, too, can write some crap down, blow my nose on it and call it a "standard." The only reason Microsoft is able to get things into ISO/ECMA is through threats and blackmail.

    C++ wasn't standardized for nineteen years, and its second major revision will be at least a decade after its first.
    But it's not 19 years ago right now.

    Further, even the existing standards aren't fully implemented on modern compilers -- most compilers (even GCC) don't support the export keyword, and that's been part of the official standard for almost ten years.
    If you can give another example that doesn't involve an obscure keyword that nobody uses then I'll concede that point.

    At least with C#, you have the standard, and you know there's at least one compiler that conforms to it exactly.
    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.

    I suppose all the time I've spent writing code for AIX, SCO UNIX, HP-UX, Solaris, Linux, VMS, and a couple of embedded platforms has blinded me to the truth: the entire world is in fact only Microsoft.

  15. #30
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by nvoigt View Post
    Our whole line of work is built on using stuff we have no control over. Even Open Source in the end is an illusion. You are afraid MS will pull the plug ? What happens if Linus pulls the plug ? Don't tell me you personally will code patches and future Linux versions to support your line of products.
    Why would I have to patch anything? The thing works just fine.

    You have the source. But you still need the manpower to put it to use.
    That's the great thing about business. You can hire people.

    And you don't have it, or you wouldn't be using somebody else's OS, but your own.
    That's a bunch of crap and you know it. Just because you have the capability to do something doesn't make it a good idea. Do you begin each new project by writing a compiler from scratch?

    With open source, you can at least hope someone else does the job, but don't tell me that is "independent". It's the same dependency on external events you have no control over.
    Like so many others you have taken my irritation with Microsoft and flipped it around to assume that I must be some kind of Open Source fanatic. False dichotomy.

    As a last thought: if an application is windows-only, why would I bother with a cross platform framework?
    The first time a customer offers you a crapload of money for a port, you will be kicking yourself.

    Why not use C#? Do you think the same application would be less Microsoft-centric, if I build it using MFC?
    What would be less Microsoft-centric would be coding to an actual standard which is accepted somewhere other than on Windows platforms.

    Show me a single GUI Framework for C++ that cannot be changed by a third party at any time.
    And they force you to upgrade how?

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, 11:39 AM
  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