Multi inheritance or interface in eC

General help with the eC language.
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: Multi inheritance or interface in eC

Post by jerome »

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 ).
Post Reply