[=;15581]
C# on the other hands has memory leaks and you simply have no control over them. C++ gives you power. With that power comes responsibility.
And you know it is not that it is easier to write non - leaking programs in C#/Java - simple example, file management:
In C++ if you use memory management technique called CADRe or RAII - (Constructor Acquires Destructor Releases ) then you put opening file code in constructor, releasing that file to memory in destructor and your done. No more worrying. In C#/Java you have to actually manually close every file you’ve opened. So how is this for easy / hard.
And guys, don’t fool yourself that working with C#/Java is easier than with C++.
It is like with toy tools and real tools really. It is much easier to build castle from than real castle but after the work mounts up, you realize that only real castle is actually livable. The one is unusable.
C# destroyed Visual . Once my beloved IDE, now I simply cannot look at it.
[/]
No offense buddy but you don’t have much of a clue what you’re talking about and you shouldn’t try to give people false information if you don’t have the knowledge or experience to back it up. C# doesn’t inherently have memory leaks. Memory leaks can be found definitely within a couple of classes within the .NET Framework but they are pretty rare. If you get memory leaks in your code, it’s because you are not disposing of the native unmanaged memory properly and is usually caused from programmers not keeping track of the memory.
Also, the misconception that in C# you have no control of your memory is complete BS. You can do a lot of self memory management in C# that negates the GC, and not too mention you can go unsafe and use C++ pointer references and even call into low-level kernel calls so it’s more than doable for people who want more control of their memory within C#.
In C++, you still also have to manage file IO the same exact way. Just because you are using mechanisms that allows you to easily open a file in your constructor while it manages the memory and close it out in your destructor doesn’t mean the same concepts don’t apply for opening the file and self-managing it from a basic standpoint. The only difference here is you having it auto manage the memory for you instead of you doing the manual memory management yourself. Look at any beginner C++ File IO tutorial out there and you’ll understand what I am talking about.
Now in C#, you could even do the following…
using (var MyFile = File.OpenRead(…))
{
// Do some code like read or write to your file here
}
By doing it this way, you are managing the memory of the file automatically by using a “using” statement that disposes of the file after it leaves scope. So its even easier to do in C# and less lines of code than C++. And two more things about File IO is that if you chose to negate the “using” statement, all you need to do is call… MyFile.Close(); That’s it, not too hard for anyone at all
But also the second thing is not in every case are you going to want to have the file open in the constructor and close it during the dispose call. Unless you absolutely need to keep the file handle open for the lifetime of the class and there is a purpose to keeping it around, then it’s bad practice to do that.
I’ve been developing for over 25 years and in over 15 different languages and to say C# is a toy language and not easier than C++ is I can only say one helluva pretty ignorant statement and quite laughable. Now don’t get me wrong, out of every language I’ve ever used, C++ to this day is still the best when it comes to achieving performance if you want that raw low-level access. However, C# is completely a much easier and more elegant programming language than C++ ever was and is much easier to pick up quicker as a starting point then throwing someone into C++ initially as a beginner. And C# is used professionally for a lot more than tools these days. Even in the company I left recently, I would do a lot of our software in C# for them and even a lot of HLSL, OpenCV and advanced CV algorithms while in C#. I’d sometimes do these instead in C++ if I needed that extra ability to optimize the performance but it definitely wasn’t the case all the time and it sure as hell didn’t make our software any less unprofessional.
[=;15581]
It is like with toy tools and real tools really. It is much easier to build castle from than real castle but after the work mounts up, you realize that only real castle is actually livable. The one is unusable.
C# destroyed Visual . Once my beloved IDE, now I simply cannot look at it.
[/]
(…Blank Stare…) You’re kidding me right?! I don’t think you even understand what you just said. Now all joking aside, if you are referring to how the dev environment is setup, you can change it so that C# is not your default dev environment in VS and C++ is. If that’s not what you meant, then you aren’t making any sense as C#'s integration into VS doesn’t have any affect on the IDE in a negative way or in any if you are coding in C++. You do realize there is option when you install to “Not install Visual C#”… when you install Visual ?
I would say to anyone out there thinking about becoming a serious programmer and about using UE4 to create your next big game, don’t worry if you choose to start with something like C#. It’s much easier to pick up than C++ and will help you get the basic fundamentals of programming down. Get a couple example apps running and when you feel ready, transition over and start learning C++. Buy books and use resources like Google and as much as you can as there is a lot of great tutorials out there on C++. Chances are, if you are dealing with a problem in code, there is a good chance that someone has and not only documented it, but teamed up with a forum community to solve the issue.
Also, Blueprints get compiled down so they are just as performant as C++ and will probably be even easier for anyone new to get started with. Just beware, that you can still create un-optimized code based on how you wire everything together so continue to learning the basics of programming and how to optimize your code and what that means to your application. Create little example apps so you are understanding basic concepts and practices then move on when you are ready to rock.
I get that C++ is a much more difficult but once you master it, you’ll be able to do practically anything but as a starting point, stick with the Blueprints and good luck 