So I have a background in C++, but a professional indie game developer who has been in the field for years used to teach me programming. He was always using mixed C and C++, using just the bits he needed of the C++ language to get the job done.
That was probably 8 or more years ago, but now I find myself playing with handheld hardware again, and have found that most code for the 3ds/libctru is in fact in C. So I was wondering if there is any good reason to go out of my way to write in C as opposed to C++?
why C
Re: why C
for the 3ds I do not think that it really matters. I think the issue is primarily aimed at more resource constrained devices like the gba or even the ds - be that limited amounts of ram or memory access issues, like not having byte addressable memory for certain regions. I suspect the libraries are in C as it will work with both C and C++ rather easily. I would also imagine that it is easier considering that they are building this as they reverse engineer the device - just my opinion though.
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: why C
Keeping the libraries in C means that developers aren't forced to use C++ while still working equally well for those who want to write C++. It's really no more complicated than that.
Just bear in mind that the libraries are statically linked and STL code can get very large, very quickly. http://www.coranac.com/2009/02/some-int ... code-size/ might be of interest.
Just bear in mind that the libraries are statically linked and STL code can get very large, very quickly. http://www.coranac.com/2009/02/some-int ... code-size/ might be of interest.
Who is online
Users browsing this forum: No registered users and 1 guest