learning c++
- Neuromancer
- Member
- Posts: 964
- Joined: Tue Jun 12, 2012 22:28
- GitHub: Neuromancer56
learning c++
So I'm learning c++. I wrote a couple small projects in it 20 plus years ago but reading the Minetest code has been difficult to say the least. Anyway, one of the interesting things I discovered in that the new C++ standard, there is a thing called smart pointers (shared pointers and unique pointers) and these things are in the standard library. They basically are classes that wrap pointers so that you don't have to worry about deleting them when they go out of scope. It removes a lot of the administrative code you have to do when cleaning long lived objects off of the heap/free storage. I'm guessing this is too new for Minetest to use but it seems really cool. Does anyone know if minetest uses C++11 and smart pointers?
Last edited by Neuromancer on Wed Feb 20, 2013 03:29, edited 1 time in total.
Mods:Immersive Sounds
Phonics
Eden Game Natural Beauty Textures
Try out dropbox and get me free space: https://db.tt/JjjTr7fl
Phonics
Eden Game Natural Beauty Textures
Try out dropbox and get me free space: https://db.tt/JjjTr7fl
Python (as a language) has issues too though. I won't argue with you though, as I don't know C++, so I can't compare the two.Jordach wrote:Celeron55 should have took Python since day 1. Oh and yes, compared to C/++ it is nice, clean and frickin readable.
But isn't C++ lower level, and therefore faster running? Also, Python doesn't compile into a nice executable, but into byte code to be run in an interpreter, further slowing it down. Surly the speed boost offered by C++ is worth it?
There used to be a mid-way point, via HipHop, but the HipHop->C++->Native has been discontinued.0gb.us wrote:Python (as a language) has issues too though. I won't argue with you though, as I don't know C++, so I can't compare the two.Jordach wrote:Celeron55 should have took Python since day 1. Oh and yes, compared to C/++ it is nice, clean and frickin readable.
But isn't C++ lower level, and therefore faster running? Also, Python doesn't compile into a nice executable, but into byte code to be run in an interpreter, further slowing it down. Surly the speed boost offered by C++ is worth it?
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.
Minetest uses smart pointers for a small amount of things, but not those found in C++11. It has it's own implementation. Most of the time they aren't worth using though; memory management in constructors and destructors is easy. Also, Irrlicht uses reference counting for it's stuff.Neuromancer wrote:I'm guessing this is too new for Minetest to use but it seems really cool. Does anyone know if minetest uses C++11 and smart pointers?
Python is a nice language, but sucks way more than Lua for embedding. Also, it should be obvious that Python or Lua or anything like that is way too slow for the core things in Minetest. You simply can't do things like mesh or map generation or voxel lighting in realtime in it.Jordach wrote:Celeron55 should have took Python since day 1. Oh and yes, compared to C/++ it is nice, clean and frickin readable.Celeron55 should have took Python since day 1. Oh and yes, compared to C/++ it is nice, clean and frickin readable.
Who is online
Users browsing this forum: No registered users and 6 guests