Coffeehouse Thread

42 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

C# is not needed anymore....

Back to Forum: Coffeehouse
  • User profile image
    NuTcAsE

    http://grumpyoldprogrammer.myblogsite.com...

    Interesting viewpoint. Me, id happily jump off a cliff before I go back to C++... just my $.02

  • User profile image
    Minh

    How is Managed C++ faster than C# if both compiles to MSIL?

  • User profile image
    rhm

    Kang Su Gatlin of the Visual C++ group has tirelessly promoted the new C++/CLI as "the best langugae for .NET programming". In terms of performance for managed code, the only real advantage is that they have leveraged high-level optimizations developed for regular C++ in the managed code generation. Although C++/CLI and C# both produce MSIL different compilers can produce better or worse code of course and since the optimizations the JIT can make at runtime are limited, it can make a difference. How the C# team feels about this effective dissing of their compiler isn't documented (maybe a job for Channel9 embedded reporters).

    I doubt that it makes C# redundant though. For a start C# is more comfortable to programmers that have come from Java and probably a lot of other langauges.

    There are some thing I prefer about C++ such as it draws a distinction in it's syntax between operating on a member of a value type (using '.') and a member of a reference type (using '->'). C# and Java make no such distinction which I think is a mistake as it is misleading.

    There are other things I dislike about C++ like the way it uses "public:" instead of having to specify visibility modifiers on each member seperately.

  • User profile image
    geekling

    Boo makes them both redundant.

    Hee, hee!

  • User profile image
    Manip

    Here is some managed C++ code:

    #using<mscorlib.dll>
    using namespace System;
    #using<System.DLL>
    #using<System.Windows.Forms.dll>
    using namespace System::Windows::Forms;

    // __gc class garbage collected derived from Form
    __gc class Hello : public Form
    {
        // Visibility as public
    public:
        Hello()
        {
            Text="Hello World";
            m_p=new Button();
            m_p->Text="Click";
            m_p->Top=120;
            m_p->Left=100;
            m_p->Click += new EventHandler(this, button_click);
            this->Controls->Add(m_p);
        }
        // Button click event
        void button_click(Object* sender, EventArgs* e)
        {
            MessageBox::Show("Hello World!");
        }
    private:
        //Button class as a private
        Button *m_p;
    };

    // Main function
    int main()
    {
        Application::Run(new Hello);
        return 0;
    }
    // end of program

    Enough said.
  • User profile image
    ScanIAm

    I do sometimes miss the control of C++ and some of the tricks that allowed you to pass pointers to functions, but I sure don't miss chasing down memory leaks.

  • User profile image
    geekling

    Hey Beer, guess what: not everyone enjoys C++'s syntax and its "special features." Wink C# isn't going to go away because its simply more convient to use in many cases.

    I know, I know, hamsandwich < cheeseburger, but we've been over this a million times! I'd scream "BOO!" to scare you, but then I would have to take my rigorious punishments in stride.

    I think - although it is very sexy in a "I'm banging the slow girl on the Fry-O-Lyzer" way - that C++ gives me hives; I have noticed that after a dirty coding session I have these unexplainable warts on my backside. Is it because I forgot to wrap myself in saron-wrap?

    Java, thankfully, only gives me athelete's foot 3 out of 6 times.


  • User profile image
    ScanIAm

    geekling wrote:
    Hey Beer, guess what: not everyone enjoys C++'s syntax and its "special features." Wink C# isn't going to go away because its simply more convient to use in many cases.

    I know, I know, hamsandwich < cheeseburger, but we've been over this a million times! I'd scream "BOO!" to scare you, but then I would have to take my rigorious punishments in stride.

    I think - although it is very sexy in a "I'm banging the slow girl on the Fry-O-Lyzer" way - that C++ gives me hives; I have noticed that after a dirty coding session I have these unexplainable warts on my backside. Is it because I forgot to wrap myself in saron-wrap?

    Java, thankfully, only gives me athelete's foot 3 out of 6 times.




    Dude, meds.

  • User profile image
    ScanIAm

    OK, I got tired of not having a clue when someone 'boo'd me, so I took a look.  (admittedly, for about 5 seconds).


    import System
    name = Console.ReadLine()
    print "Hello, $\{name\}"

    I guess the scary part (get it, boo?) is that this looks far too similar to scripting.

    No thanks.

  • User profile image
    geekling

    Don't worry.

    One of these days you're going to be using a Boo-based assembly and never even know it. Wink

    By the way, you meant to write:

    name = prompt("What's yo' name, dawg? >")
    print "Hello, ${name}!"

  • User profile image
    DarkByte

    geekling wrote:
    Boo makes them both redundant.

    Hee, hee!


    I believe that all languages have their reasons to be, some will prefer the way C++ for its greater flexibility. Some will prefer C# for its readability. Some prefer perl because you can write more in less characters. Lots of choices for lots of different people.

    Reminds me of the Linux/Mac/Windows war. Let the OS makers make their war and accept that others might be different from you. Heck, i could make an OS and i would have people that would love it. Difference is good because it gives us a challenge and forces us to improve ourself in most cases.

  • User profile image
    geekling

    No offense DarkByte but that is a kind of boring philosophy.

    I prefer the mayhem and destruction of lesser programming languages to further cement my value in society.

  • User profile image
    leighsword

    the PDB(program debug database) file of C# is based on Microsoft C/C++ MSF 7.00.

    by the way, what's the difference between debug and release version of .Net?the same file size , the same depends, the same ....

  • User profile image
    Steve411

    Someone hould tell this guy NOT TO DRINK VODKA BEFORE POSTING. Stupid idiot. C# ROCKS> Smiley

  • User profile image
    TommyCarlier

    I used to program in C++ and Java, at school, but my first (and current) job after I graduated, was in C#, so I had to learn C#. I have to say it was a lot easier to learn and use C#, than C++ or Java. The big advantage of C# is also that it's a new language, and it doesn't need to support any backward compatibility with a previous version. That makes it a lot cleaner than C++.

  • User profile image
    Dr. Shim

    Wasn't it Gatlin who said, that if you want to do a pure .NET solution you should use C#. If you have to use unmanaged libraries most of the time, use managed C++?

    I'm not going to use C++ for purely managed solutions. I'm not going to use J# either. I'll use C#, which is very familure to C++, while being completly managed.

    Besides, C# is yet another language which is CLS compliant, aiding in giving a broader range of choices. You can not see CLS compliant languages has being tools for specific purposes. Some may be, but the good ones are yet another choice for people familure with a certain syntax.

  • User profile image
    Dr Herbie

    Well, C# is a fully object oriented language while C++ is a procedural language with OO extensions.

    I've seen so much dreadful part-OO/part-procedural C++ code mixed together to make that a good reason to stick with C#.  I find it cleaner and easier to code with.

    There will be times when the extra 'hardcoreness' of C++ is needed, but I mainly don't write that sort of software (I write desktop apps mostly so the user is the speed bottleneck).

    Horses for courses, folks.  Learn more than one language and use the right language for the right occasion.

    Dr Herbie

  • User profile image
    Tensor

    Surely its nto a case of "needing" more or less languages. If it were that simple, there would not be any language proliferation at all.

    Most applications that people are going to use .net for is going to be line-of-bussiness apps. Putting data in, pulling data out.

    Performance is not a primary concern for apps like this. They dont need to perform amazingly well, they need to perform well enough - ie just faster than the human user works. What is more important in apps like this is the ability to develop them quickly, and react to change requests quickly. I would argue that a more abstract language than c++ is better for this requirement - so c# has a place and allways will.
     
    would go on to argue that VB is even better for this kind of thing, but you wouldnt want to hear it.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.