Results 1 to 7 of 7

Thread: The question is should I try STL or not

  1. #1
    Join Date
    May 2011
    Posts
    41

    The question is should I try STL or not

    You know I hate the usual Template Library. I disgust the truth that you cannot use DEBUG_NEW with him to locate memory seep outs. I also like all the STD: blah blah kind of obsession when no classes in MFC to do virtually the same work, but a lot, much more enjoyable. So do not even like CArray. Though CPtrArray, CObArray CStringArray and are extremely useful. You cannot inherit any of the STL classes; they do not have implicit destructors so that it cannot, for example, do good things that can be in MFC as:

    Code:
    class CServerNames : public CStringArray
    {
    public:
    CServerNames();
    virtual ~CServerNames();
    } ;
    Where this class is loaded in all the names of the servers from anywhere in one line. Wherever you want to put in the code. In an MFC environment I see no reason to use it. Never! I know my statements are very forward, but I'm invoking the conversation.

  2. #2
    Join Date
    Jun 2009
    Posts
    1,518

    Re: The question is should I try STL or not

    Thus, namespaces are meant to clarify things. You can write def std:: vector what you like and write a using STD declaration. I also read somewhere that the STL classes are designed so that they perform very well (which may be very important), while the MFC classes that virtually all the staff I have no doubt that they are so good. But I have to do specific tests on the performance of the MFC - STL, and if someone has done something like this would be very happy to hear some comparative results. In addition, you can write STL everything (no UI) classes that are portable. You never know what compiler you may need to use.

  3. #3
    Join Date
    Nov 2008
    Posts
    1,514

    Re: The question is should I try STL or not

    This is a very interesting discussion. I have to say I'm VC + + programming professionally for just about 8 months and I'm not as experienced as you. On the other hand I've never used STL. Well, if also the Windows program using Borland C + + I do not believe there can be used MFC. I have not handled Borland C + + ever since version 5.0, so I'm not certain. Nonetheless, I be firm that we must locate if there is a considerable difference between the effectiveness MFC - STL. But it is true that the legacy of STL is not allowed? I thought that this library was designed to be extensible. This is a very serious problem if it is real.

  4. #4
    Join Date
    Mar 2009
    Posts
    1,360

    Re: The question is should I try STL or not

    I'm a little confused as to what the problem is with DEBUG_NEW. I believe he has by now been pointed out my confusion. STL containers do not comprise virtual destructors, since they are designed for efficiency. Including a virtual destructor means that there is now a vtable vptr and processes in line is effectively eliminated. I do not see why it is so important to write a wrapper class for an STL container if you want to add functionality. As you said he had written lots of MFC extension classes for the functionality proposed by the STL. It's not the point. No need to write anything if you presently use the STL directly.

  5. #5
    Join Date
    Nov 2008
    Posts
    1,259

    Re: The question is should I try STL or not

    I do not want to get involved too deeply because this is more a religious issue to discuss how the OS is better Windows or Linux? However, there is a point that basically plays an important role in considering whether to use MFC or STL and is platform reliance. If I have to write software that is supposed to run on different operating systems, the MFC does not help at all. STL is part of the C + + standard, which is portable without any problems.

  6. #6
    Join Date
    Nov 2008
    Posts
    1,185

    Re: The question is should I try STL or not

    What compilation errors? I'm assuming you mean the illegal use of STL in this case, the same applies to the MFC or anything else. If you use something in a way that was not the intention of using the result will be the same compilation or execution errors. Well, although this depends on the specific situation, even Microsoft had to admit that the STL classes are most effective in most cases.

  7. #7
    Join Date
    Nov 2008
    Posts
    1,221

    Re: The question is should I try STL or not

    All we can contrast MFC and STL containers is since you cannot do user interface with just STL. So our first discussion on the container. Here MFC and STL are dissimilar in design, but I must speak different paradigm. STL is the use of templates is polymorphism, generic programming, inheritance by using MFC otherwise (i.e., the virtual function) to the polymorphism. So these are two different forms of programming. The template will do the polymorphism at compile time and get MFC runtime polymorphism.

Similar Threads

  1. Replies: 8
    Last Post: 27-01-2012, 01:14 PM
  2. PCI-E 2.0 Question
    By fochdion in forum Monitor & Video Cards
    Replies: 1
    Last Post: 26-08-2010, 08:59 PM
  3. VB.net question
    By Daren in forum Software Development
    Replies: 4
    Last Post: 12-03-2009, 05:40 PM
  4. .pst question
    By bac15 in forum Windows Software
    Replies: 2
    Last Post: 03-03-2009, 07:09 PM
  5. USB 3 Question
    By bigboy in forum Hardware Peripherals
    Replies: 3
    Last Post: 16-12-2008, 08:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,966,291.06766 seconds with 16 queries