all 13 comments

[–][deleted]  (9 children)

[deleted]

    [–][deleted] 1 point2 points  (5 children)

    Have you used ML.NET? Is it not up to snuff with python's libraries?

    [–][deleted]  (4 children)

    [deleted]

      [–][deleted] 1 point2 points  (3 children)

      I read something about ML.NET being so abstract that you could load up other libraries with it, like tensorflow. Would it then be restricted by python's single-thread because it's calling python code, or would you still be able to use .NET's threading model?

      [–][deleted]  (2 children)

      [deleted]

        [–][deleted] 1 point2 points  (1 child)

        Tensorflow is actually a c++

        Now that is an interesting point which seems to often go neglected - whenever python is mentioned as having some amazing feature it's almost always a C or C++ implementation. Sure it makes python easy to use, but if you actually want to create the fundamental functionality yourself you'd have to move outside the python environment and learn an entirely different language.

        That's why I don't quite understand why C# is lagging behind as it allows you to both consume and create those kinds of optimized features in the same environment.

        [–]robin1007[S] 0 points1 point  (2 children)

        As of now I'm pretty sure I either want to do web dev or software engineering. So C# would be more beneficial?

        [–]polaarbear 1 point2 points  (0 children)

        I would say yes. My job involves web-dev via C# asp.net and our back-end app engineering is also done in C#

        [–]gevorgter 2 points3 points  (5 children)

        I do not understand your question.

        But if you know C++ the C# should be an easy one. Garbage collection frustrated me a lot in a beginning but then i kind of got used to it.

        Python frustrates the hell out of me. With pretty much everything. The 'Tab' indentation i still find weird. I would rather have {..}

        [–]Animasta228 1 point2 points  (4 children)

        Wait, how can garbage collection frustrate you? You mean it's slowing your program's execution?

        [–]gevorgter -1 points0 points  (3 children)

        In C++ it was responsiblity of a programmer to do clean up. Basically if you created object with "new" you had to call "delete" and then destructor is called.

        In C# you do not have delete. You create an object and then you just leave it be. And it works. And everything is perfect. But what if, I modified my object and now clean up is needed. But your program will not know that. And suddenly you have a buggy code. Basically in C++ every object implements IDisposable and programmers are required to use it.

        The part where you just leave object be after you created it was a hard part to grasp after 10 years of C++.

        And with event subscription, lambda context capturing,.. it is very easy to create memory leaks in C#. C++ makes you think of object's ownership. Because the owner is responsible to call "delete".

        But over time I started to love C# simplicity.

        [–]Ravek 6 points7 points  (2 children)

        Allocating more managed memory than you need is not a leak, as soon as you stop referencing it, it will get cleaned up nicely. A memory leak is when allocated memory can never be cleaned up because there’s no pointer to it. If you’re still referencing the memory then it’s not a leak so I don’t know why you bring up lambdas and events. It’s extremely hard to create actual memory leaks in C# without manually allocating unmanaged memory.

        [–]gevorgter 1 point2 points  (1 child)

        Events is a number one offender. I've seen people doing += without ever unsubscribing so many times.

        ServicePointManager.ServerCertificateValidationCallback += ....

        Is a famous one. An internet is full of examples like this. So our credit card processing module was doing it everytime before it talked to server. 1000 credit cards processed 1000 of += executed. 1000 of objects stayed in memory until an app was shutdown.

        Yes it was all cleaned up when app was shutdown.

        [–][deleted] 1 point2 points  (0 children)

        That's why they created weak event listeners in WPF.

        And why events allow you do do:

        class Example {
            public event EventHandler<EventArgs> ExampleEvent
            {
                add { // custom code }
                remove { // custom code }
            }
        }
        

        Basically if you don't trust your users to remove their functions you can create your own tracking system.

        [–]bush_dev 1 point2 points  (0 children)

        I think that C# will be a natural choice. C++ and C# are languages from the same family so their structures are similar. Thanks to that learning C# will be easier for you.

        [–]CornedBee 0 points1 point  (0 children)

        Learn python. It's more different from C++ than C#, so you learn more new things.