SDL - Moving to C++ from C#/Java

Mar 26, 2014 at 5:09am
Hi everyone, I'm new to this forum and I hope this is the proper place to put this topic. I want to start using SDL but I don't know what language I should. So I started writing Java a few years ago and have gotten pretty good at it (If I do say so myself) and eventually moved over to C# to use for Unity3D as well as dabbling in SharpDX which was no big deal and so I caught on quickly. So here I am, about 5 months later and am as comfortable with C# as I am with Java and I feel like I'm ready to move on to C++ and SDL. So my question is, when I make the jump to SDL2, should I also make the move to C++ or stay with what I'm comfortable with(SDL2#)?
Last edited on Mar 26, 2014 at 5:18am
Mar 26, 2014 at 5:50am
Why not use SFML instead of SDL? SDL is more C-oriented and is in fact a C library, whereas SFML is more C++-oriented and, of course, is a C++ library.
Mar 26, 2014 at 6:17am
I'm open to anything and it does seem simpler so I'll give that a go, thanks!
But my question still remains. Even-though SFML has C# bindings as well, should I continue using C#? I'd be able to get considerably more functionality out of C++ but it does seem quite intimidating.
Mar 26, 2014 at 8:54am
I thought people tended to use XNA with C#. Also it wouldn't hurt to learn a secondary language such as c++.
Mar 26, 2014 at 12:16pm
Learning C++ won't bee too hard coming from C#/Java, you will just have to get used to the fact that variables alias objects instead of referencing them.
Mar 26, 2014 at 12:40pm
As more up-to-date libraries become available, I think people simply have better solutions to use.
Last edited on Mar 26, 2014 at 12:40pm
Mar 27, 2014 at 5:12am
get used to the fact that variables alias objects instead of referencing them.


Could you elaborate on this, please?
Mar 27, 2014 at 5:30am
MrSuicideFish wrote:
Could you elaborate on this, please?
http://www.LB-Stuff.com/alias.html
How's that for elaboration? ;)

In other languages like Java and C#, variables are just references (equivalent to C++ pointers) rather than aliases.
Last edited on Mar 27, 2014 at 5:31am
Mar 28, 2014 at 5:51am
http://www.LB-Stuff.com/alias.html
How's that for elaboration? ;)

In other languages like Java and C#, variables are just references (equivalent to C++ pointers) rather than aliases.


Wow! Took me a few reads to wrap my head around it but it now makes sense to me. The only thing I don't understand is this:

"An example of an object with a strong alias is a variable on the stack"

what does he mean by "On the stack"?
Mar 28, 2014 at 5:55am
This is stack:

 
int a;


this is on the heap:

 
int *a = new int;


http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/

Topic archived. No new replies allowed.