On Fri, 16 Oct 2009 03:10:00 +0200, Alan Grimes <agri...@speakeasy.net> wrote:
> > Also, I realized that in my work on the component library (really all > parts of ktechlab), I had been continuing a bad legacy design decision > to use pointers for everything everywhere, and to manually instantiate > things each time the class was loaded. A much more elegant solution is > to simply make the classes members of the class you are working on. Depends... it's not that obvious. One should put the question: could the member exist outside/wihtout the class? If it could, a pointer might be a better solution. > > One especially tricky concept is the standard template libraries should > not be used to store pointers to objects but rather directly contain the > objects themselves. (a practice violated universally by ktechlab's > current code). We have also Qt's collection classes: http://doc.trolltech.com/3.0/collection.html#collection-classes Now which ones should be used? :D > > When done correctly, you can go to std::vector and say "I need 20 > logic-outs", and it will give you 20 logic-outs. =P You don't, > necessarily, have to loop through, create and add each one. Crazy. I don't see any object that _should_ be instanciated in such quantities and all objects the same. If this is a problem, we should document it. > > Anyway, look for opportunities to get rid of pointers to things, they're > inherently buggy and This is what the people at Sun thought, and invented Java. :) > take up waaaay too much space on 64 bit > architectures!!! LOL. You can't get away witout pointers, if you don't write your memory manager. I've stated my opinion before: let's have something maintainable, then optimize / work on high efficiency. I'd say if it's good enough for now, let's not change it. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Ktechlab-devel mailing list Ktechlab-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ktechlab-devel