Ecere SDK/eC Forums
http://ecere.org/community/
Print view

Multi inheritance or interface in eC
http://ecere.org/community/viewtopic.php?f=1&t=209
Page 2 of 2
Author:  jerome [ Wed Oct 02, 2013 1:02 am ]
Post subject:  Re: Multi inheritance or interface in eC

Yes, though I hope to add more features to eC (e.g. to support functional paradigms), I hope it remains simple, with one 'proper' way to do things which the language naturally guides you to use, versus what I see as many wrong ways to do things in C++.

Objects on the stack -- you can use structs in eC to create objects on the stack.

eC guides you here by making a decision when you design a type: you decide whether these objects should be allocated individually on the heap or on the stack (or contiguously in arrays). And this ensures that anyone using your type will not wonder whether he should be using them on the stack or on the heap, the type makes the decision.

Objects that structs are good for are small objects without references to other objects that would need to be released upon destroying the struct ( eC structs don't have destructors , at least so far ).
All times are UTC-05:00 Page 2 of 2