learning c++

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

learning c++

by Neuromancer » Wed Feb 20, 2013 03:29

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.
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Tue Mar 12, 2013 07:54

Celeron55 should have took Python since day 1. Oh and yes, compared to C/++ it is nice, clean and frickin readable.

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

User avatar
0gb.us
Member
 
Posts: 841
Joined: Sun Sep 16, 2012 01:55

by 0gb.us » Tue Mar 12, 2013 09:17

Jordach wrote:Celeron55 should have took Python since day 1. Oh and yes, compared to C/++ it is nice, clean and frickin readable.


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.

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?
 

rarkenin
Member
 
Posts: 668
Joined: Tue Nov 20, 2012 20:48

by rarkenin » Tue Mar 12, 2013 11:14

0gb.us wrote:
Jordach wrote:Celeron55 should have took Python since day 1. Oh and yes, compared to C/++ it is nice, clean and frickin readable.


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.

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.
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.
 

celeron55
Member
 
Posts: 430
Joined: Tue Apr 19, 2011 10:10

by celeron55 » Tue Mar 12, 2013 15:44

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?


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.

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.


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.
 


Return to Minetest Engine

Who is online

Users browsing this forum: No registered users and 17 guests

cron