Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. MFC.

MFC.

Scheduled Pinned Locked Moved The Lounge
csharpc++questiondelphilinux
24 Posts 16 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R ROK_RShadow

    What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

    N Offline
    N Offline
    Navin
    wrote on last edited by
    #13

    There are good and bad things about MFC. The good things are that it's relatievly easy to use if you don't go "outside the box", or want to get something up and runing quickly. Here are the things I don't like about MFC: :bob: Message maps. If you can do all your message maps with the wizard, you are golden. But when you have to write custom ones, it sucks big time. You have to look up the proper line to put in your message map (it is NEVER intuitive), and if you get it wrong, your app will mysteriously crash in release mode. As a comparison, I've also used wxWindows, and its message maps are much easier. For instance, all keyboard events expect a wxKeyEent object, etc. :bob: As others have said, it's tied very closely to Win32. This is cool if all you want to do is write apps that use regular Windows controls and will never be ported to other platforms.. but not all of us want to be that tied down. :bob: The collection classes suck compaired to STL. When first looking at STL it seemed kind of confusing and complicated, but once I actually started using it, I found out quickly why they did a lot of the things they did. Code beocmes much more compact and easier to follow, you haev to take fewer unnecessary steps. :bob: MFC serialization is evil, but don't get me started on thjat. :) All in all, I use MFC if I need to get something out the door quickly... or if it is temporary code... or to maintain old code. For any new real projects, I try to avoid it, though. You can pick your friends, and you can pick your nose, but you can't pick your friend's nose.

    1 Reply Last reply
    0
    • R ROK_RShadow

      but isn't it true that most Microsoft apps use these same DLL's ?? So chances are if you dynamicly link to the Library .. the end user most likely has the release builds of the DLL's allready on their machine. -------------------------------------------------------- IMHO: C# a poor attempt at bringing C++ to the VB masses --------------------------------------------------------

      R Offline
      R Offline
      Rob Manderson
      wrote on last edited by
      #14

      If you follow that you're really hoping the end user has the 'right' set of release DLL's. Unfortunately there are dozens of different versions of release DLL's hanging about out there and some have slight incompatibilities. Worse, if your install blindly installs 'your' set of release DLL's over the users existing set of DLL's you run the risk of breaking their other applications. MFC DLL's became a mess and most of the folk I know or have worked with who use MFC also use static linking to avoid the problems. Rob Manderson http://www.mindprobes.net

      1 Reply Last reply
      0
      • R ROK_RShadow

        What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #15

        ROK_RShadow wrote: IMHO: C# a poor attempt at bringing C++ to the VB masses Do you realise that this statement is as bigoted as the statements by people who blanket hate MFC ? Christian NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma Anonymous wrote: OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window. I think you are a good candidate for Visual Basic. - Nemanja Trifunovic

        R 1 Reply Last reply
        0
        • C Chris Maunder

          Like any tool MFC is an excellent library as long as it's used correctly. Developers often disparage is because it's large (I guess .NET has reset the bar on that argument), or unweildy, or not sufficiently object oriented, or doesn't provide enough control where control is needed, or all manner of other things. If you want to get a Windows app up and running - complete with toolbars, printing support and serialisation then you can't go past MFC, but if you don't need that then ATL (and subsequently WTL) or STL can be an excellent alternative provided you are willing to work with templates. MFC isn't what you would want to use if writing a lightweight ActiveX control, or a numerical methods library (though I'll admit I'm guilty of the latter), but it can save a hell of a lot of time, and at least provide a robust framework within which you can embed components using other libraries written using libraries best suited to that task. The whole "I don't like technology XYZ" seems, to me at least, to often mean "I don't like technology XYZ when writing apps best suited to being developed using technology ABC". cheers, Chris Maunder

          N Offline
          N Offline
          Navin
          wrote on last edited by
          #16

          The whole "I don't like technology XYZ" seems, to me at least, to often mean "I don't like technology XYZ when writing apps best suited to being developed using technology ABC". I agree. Though Microsoft often has the tendency to push technology or frameworks on people, even when they aren't necessarily the best fit. You can pick your friends, and you can pick your nose, but you can't pick your friend's nose.

          1 Reply Last reply
          0
          • R ROK_RShadow

            What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

            M Offline
            M Offline
            Marc Clifton
            wrote on last edited by
            #17

            MFC promotes bad coding practices. It is not a framework suiteable for large projects because the compile times are very long as a result of class definition interdependencies. It does not provide a framework/toolset in which to avoid this, leaving even the experienced programmer unaware of these problems until it's too late. Often, it gets in the way of doing anything custom or unique. One of my favorite examples is that the framework asserts if you don't create an application with three top level menu items, because Microsoft wants to enforce the "File/Edit/View" menu design. It also does not provide any implementation for a lot of the "cool" GUI features that are present in Microsoft's own applications, requiring that you invest additional $$$ in third party toolkits or problematic freeware. Among other things, it also reduces code re-use by making it too easy to embed what should be "business logic" within GUI event handlers. It promotes product "rigidity" because unaware programmers will not properly seperate business logic from application logic, for example, by embedding database I/O and SQL statements directly in application code. Yes. It really is that bad. A framework should have it's equivalent of the Hippocratic Oath: "first, do no harm". MFC does considerable harm to the inexperienced programmer. Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
            Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus
            Every line of code is a liability - Taka Muraoka
            Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"

            R 1 Reply Last reply
            0
            • C Christian Graus

              ROK_RShadow wrote: IMHO: C# a poor attempt at bringing C++ to the VB masses Do you realise that this statement is as bigoted as the statements by people who blanket hate MFC ? Christian NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma Anonymous wrote: OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window. I think you are a good candidate for Visual Basic. - Nemanja Trifunovic

              R Offline
              R Offline
              ROK_RShadow
              wrote on last edited by
              #18

              LOL, Absolutly. But hey.. I'm human right? I didn't say anything was wrong with people that don't like MFC. I just wanted to know why. :rolleyes:

              1 Reply Last reply
              0
              • M Marc Clifton

                MFC promotes bad coding practices. It is not a framework suiteable for large projects because the compile times are very long as a result of class definition interdependencies. It does not provide a framework/toolset in which to avoid this, leaving even the experienced programmer unaware of these problems until it's too late. Often, it gets in the way of doing anything custom or unique. One of my favorite examples is that the framework asserts if you don't create an application with three top level menu items, because Microsoft wants to enforce the "File/Edit/View" menu design. It also does not provide any implementation for a lot of the "cool" GUI features that are present in Microsoft's own applications, requiring that you invest additional $$$ in third party toolkits or problematic freeware. Among other things, it also reduces code re-use by making it too easy to embed what should be "business logic" within GUI event handlers. It promotes product "rigidity" because unaware programmers will not properly seperate business logic from application logic, for example, by embedding database I/O and SQL statements directly in application code. Yes. It really is that bad. A framework should have it's equivalent of the Hippocratic Oath: "first, do no harm". MFC does considerable harm to the inexperienced programmer. Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
                Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus
                Every line of code is a liability - Taka Muraoka
                Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"

                R Offline
                R Offline
                ROK_RShadow
                wrote on last edited by
                #19

                I can't agree with your whole statment. I have replaced the File/Edit/View menu a lot of times, and in some cases have removed the menu all together from my SDI apps. Where you talk about the "cool" GUI features I have seen almost is not all of those features implemented using MFC.. (Do you read MSJ? errr.. MSDN mag now). As far as seperating buisness logic from application logic. I don't belive this has much to do with the framework, but more of programming style. The way I design my apps, in most cases I design my classes and libraries and keep those logics very seperate, however there are instances were I will agree, I have had to change things to get my ideas to work withing the framework. IMHO: C# a poor attempt at bringing C++ to the VB masses

                1 Reply Last reply
                0
                • R ROK_RShadow

                  So were are some good refrences for STL? A good beginners text or something. I started out programming C++ for DOS 6.2 with Borland.. but I never really used templates before. As far as windows programming I started with MFC.. Learing Microsoft Visual C++ 6.0 by Chuck Spar (really like that book. was easy to follow).. anyways now if I could go back, I think I would have learning the API first (I am doing that now).. but back to my question.. STL.. that is Standard Template Library correct? what is so great about templates? IMHO: C# a poor attempt at bringing C++ to the VB masses

                  N Offline
                  N Offline
                  Neville Franks
                  wrote on last edited by
                  #20

                  ROK_RShadow wrote: So were are some good refrences for STL? "The C++ Standard Library - A Tutorial and Refrence" by Nicolai M. Josuttis. Published by Addison Wesley. Best book by far IMHO. Mr. Josuttis has also just coauthored a book on C++ Templates which I bought last week, and it looks good as well. Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program

                  1 Reply Last reply
                  0
                  • R ROK_RShadow

                    What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

                    G Offline
                    G Offline
                    Gary Kirkham
                    wrote on last edited by
                    #21

                    ROK_RShadow wrote: What is MFC so hated? I don't hate it, I love it. Sure, like any library, one size doesn't fit all. Over time I have developed my own library of MFC derived classes to overcome deficiencies in MFC, especially in the collection classes. Gary Kirkham A working Program is one that has only unobserved bugs I thought I wanted a career, turns out I just wanted paychecks

                    1 Reply Last reply
                    0
                    • R ROK_RShadow

                      What is MFC so hated? I can understand why somebody programming for linux would not like MFC, I can even understand why a borland fan would not like MFC. But somebody using MSVC and programming for Windows?? That does not make sense. Not if the only thing from the MFC library you are using is a CString, Ok I can understand that. Not much sense in including the library for a CString. I understand that MFC is a little bloated. But why do developers not like MFC? I have been seeing that a lot of articles being posted (outside the .NET crap) are MFC biased. is MFC really that bad? IMHO: C# a poor attempt at bringing C++ to the VB masses

                      J Offline
                      J Offline
                      Joe Woodbury
                      wrote on last edited by
                      #22

                      For writing GUI apps, MFC is fantastic and I use it all the time. In the past eight years, I've written two UI applications not using MFC. One was a edutainment game extremely heavy in graphics and the other was a tiny applet that I wanted to make as small as possible (it's 40k) and was bored that day anyway. Unlike many of the vocal posters, I much prefer the MFC collection classes over STL (I really dislike STL.) I do have two collection classes of my own that I tend to favor over either even in MFC applications. (One of which I could have derived from an MFC class, but didn't since I also do lots of DLL and systems programming where MFC isn't applicable.)

                      1 Reply Last reply
                      0
                      • F Frank Liao

                        Jörgen Sigvardsson wrote: It's more like 66.6% If you round it to the nearest 100th, then it would be 66.67%;P Frank http://www.frankliao.com

                        J Offline
                        J Offline
                        Jorgen Sigvardsson
                        wrote on last edited by
                        #23

                        <father-merrin-voice>Evil knows only truncation, my son.</father-merrin-voice> -- Shine, enlighten me - shine Shine, awaken me - shine Shine for all your suffering - shine

                        1 Reply Last reply
                        0
                        • C Chris Losinger

                          i like MFC just fine. it does 66% what it tries to do. for everything else, there's the STL. -c


                          Image tools: ThumbNailer, Bobber, TIFFAssembler

                          realJSOPR Offline
                          realJSOPR Offline
                          realJSOP
                          wrote on last edited by
                          #24

                          But unlike MFC, STL truly sucks. ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups