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. STL Poll

STL Poll

Scheduled Pinned Locked Moved The Lounge
22 Posts 11 Posters 0 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.
  • P peterchen

    [rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]

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

    You can't blame the STL for M$ putting little to no clear docs in the MSDN. They want you to use THEIR poxy containers, and tie you to THEIR platform. I have three STL books, all Addison Wesley as it happens, and I have never had any difficulty between them and Stroustrup getting any answers I need, and the more I use STL, the worse CArray/CMap/etc. looks. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

    Sonork ID 100.10002:MeanManOz

    I live in Bob's HungOut now

    P 1 Reply Last reply
    0
    • N Nish Nishant

      ??? What's this all about? We, WinCE programmers, don't use too much STL ;-) ;-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

      T Offline
      T Offline
      Tim Smith
      wrote on last edited by
      #9

      ACK!!! WHY NOT? We use STLPort on WinCE with no problems. Hell, I haven't used the brain dead STL included in VC6 in ages. Tim Smith Descartes Systems Sciences, Inc.

      1 Reply Last reply
      0
      • P peterchen

        [rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]

        P Offline
        P Offline
        Peter Godec
        wrote on last edited by
        #10

        Waah, my first post to The Lounge and it's about programming :) . I thought I'd make myself useful first. Besides, I can't just look while you're putting down my favorite library. Anyway, it->second doesn't return anything. It can't because it is not a method/function, it's a member object of the class map<T1, T2>::value_type, that is, a member of pair<T1, T2>. So if you want a reference use it->second to initialize a reference of the corresponding type. No need for copies there. HTH.

        C P 2 Replies Last reply
        0
        • C Christian Graus

          You can't blame the STL for M$ putting little to no clear docs in the MSDN. They want you to use THEIR poxy containers, and tie you to THEIR platform. I have three STL books, all Addison Wesley as it happens, and I have never had any difficulty between them and Stroustrup getting any answers I need, and the more I use STL, the worse CArray/CMap/etc. looks. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

          Sonork ID 100.10002:MeanManOz

          I live in Bob's HungOut now

          P Offline
          P Offline
          peterchen
          wrote on last edited by
          #11

          STL sucks anyway ;) The MSDN documentation is not bad as reference - admittedly useless for learning. Where I blame STL is the complex non-intuitive design, trying to solve all problems of the world in one template. I'm coding C++ for over a decade, and I'm not bad at this, still, anytime I say "hey, why not using STL" I bump into something stupid. I'm at easy with heavy templating, I got used to the awkward syntax, I got used to the huge error messages (yes I know the prettyfier), I got used to the though that I'd probably have to digest an entire STL book, but how the hell shall a newbie get along with this library, and accept it as "standard"? I finally fired up the debugger, checked what the stuff does, and prayed that it's either standard or I never have to port (the latter being highly unlikely). Peter P.S. who is M$ ?

          J C 2 Replies Last reply
          0
          • P peterchen

            [rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]

            T Offline
            T Offline
            Todd Smith
            wrote on last edited by
            #12

            Pointers are your friend.

            Todd Smith

            1 Reply Last reply
            0
            • P peterchen

              STL sucks anyway ;) The MSDN documentation is not bad as reference - admittedly useless for learning. Where I blame STL is the complex non-intuitive design, trying to solve all problems of the world in one template. I'm coding C++ for over a decade, and I'm not bad at this, still, anytime I say "hey, why not using STL" I bump into something stupid. I'm at easy with heavy templating, I got used to the awkward syntax, I got used to the huge error messages (yes I know the prettyfier), I got used to the though that I'd probably have to digest an entire STL book, but how the hell shall a newbie get along with this library, and accept it as "standard"? I finally fired up the debugger, checked what the stuff does, and prayed that it's either standard or I never have to port (the latter being highly unlikely). Peter P.S. who is M$ ?

              J Offline
              J Offline
              Jamie Nordmeyer
              wrote on last edited by
              #13

              That's exactly why I don't use STL; the syntax sucks! If I'm writing a C++ app without MFC and need an array, list, or stack class, I've got my own implementations that I use. No iterators for me, thank you. Jamie Nordmeyer Portland, Oregon, USA

              C 1 Reply Last reply
              0
              • P peterchen

                STL sucks anyway ;) The MSDN documentation is not bad as reference - admittedly useless for learning. Where I blame STL is the complex non-intuitive design, trying to solve all problems of the world in one template. I'm coding C++ for over a decade, and I'm not bad at this, still, anytime I say "hey, why not using STL" I bump into something stupid. I'm at easy with heavy templating, I got used to the awkward syntax, I got used to the huge error messages (yes I know the prettyfier), I got used to the though that I'd probably have to digest an entire STL book, but how the hell shall a newbie get along with this library, and accept it as "standard"? I finally fired up the debugger, checked what the stuff does, and prayed that it's either standard or I never have to port (the latter being highly unlikely). Peter P.S. who is M$ ?

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

                peterchen wrote: STL sucks anyway Those are SERIOUS fighting words. The STL rules in so many ways, it's beyond my comprehension that something could be so *cool*. peterchen wrote: but how the hell shall a newbie get along with this library, and accept it as "standard"? By not biting off more than they can chew. Vector is very intuitive, you push onto it, you pop off it. Iterators are the most logical thing in the world - they define a range, and for vector are probably pointers anyhow. You use pointers, don't you ? peterchen wrote: I finally fired up the debugger, checked what the stuff does, and prayed that it's either standard or I never have to port Use STL Port, it's a better STL implimentation, has hash tables and is cross platform. peterchen wrote: P.S. who is M$ ? Company run by Bill Gate$. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

                Sonork ID 100.10002:MeanManOz

                I live in Bob's HungOut now

                P 1 Reply Last reply
                0
                • J Jamie Nordmeyer

                  That's exactly why I don't use STL; the syntax sucks! If I'm writing a C++ app without MFC and need an array, list, or stack class, I've got my own implementations that I use. No iterators for me, thank you. Jamie Nordmeyer Portland, Oregon, USA

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

                  Why don't you write your own bitmap class then ? It's a lot easier than writing a map, for example. How about your own operating system. Why use MFC, why not write your own class library ? It's the SAME THING. Why waste time refining your own containers when a ready made set is wating for you. If you're using MFC and use CArray, how do you go about sorting it ? How about if you have an array of numbers and want their sum ? I don't get why people would waste time writing such trivial stuff when it's sitting there. Jamie Nordmeyer wrote: That's exactly why I don't use STL; the syntax sucks! That is just pathetic. Yes, it might take you a day to learn how to syntax works, but why would you put the time into learning C++ syntax and not STL ? It's really quite intuitive once you've taken the time to learn how it works. Jamie Nordmeyer wrote: No iterators for me, thank you. So you don't use pointer arithmetic then ? That's what pretty much every vector iterator known to man uses. I just don't get it. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

                  Sonork ID 100.10002:MeanManOz

                  I live in Bob's HungOut now

                  J 1 Reply Last reply
                  0
                  • P Peter Godec

                    Waah, my first post to The Lounge and it's about programming :) . I thought I'd make myself useful first. Besides, I can't just look while you're putting down my favorite library. Anyway, it->second doesn't return anything. It can't because it is not a method/function, it's a member object of the class map<T1, T2>::value_type, that is, a member of pair<T1, T2>. So if you want a reference use it->second to initialize a reference of the corresponding type. No need for copies there. HTH.

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

                    Peter Godec wrote: Waah, my first post to The Lounge and it's about programming Welcome - nice to meet you. :-) Peter Godec wrote: Besides, I can't just look while you're putting down my favorite library. Well, double welcome. Can't have too many STL fans here, IMO. Have you read Scott Meyers 'Effective STL' yet ? I reckon it's the best book I bought this year. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

                    Sonork ID 100.10002:MeanManOz

                    I live in Bob's HungOut now

                    P 1 Reply Last reply
                    0
                    • P Peter Godec

                      Waah, my first post to The Lounge and it's about programming :) . I thought I'd make myself useful first. Besides, I can't just look while you're putting down my favorite library. Anyway, it->second doesn't return anything. It can't because it is not a method/function, it's a member object of the class map<T1, T2>::value_type, that is, a member of pair<T1, T2>. So if you want a reference use it->second to initialize a reference of the corresponding type. No need for copies there. HTH.

                      P Offline
                      P Offline
                      peterchen
                      wrote on last edited by
                      #17

                      a) thanks for your points. "returning a" was a bit sloppy b) I'm not puttng down STL as such (I appreciate the design & the power), I only have my regular rant anytime I "just try to use it". Peter P.S. welcome to the lounge!

                      1 Reply Last reply
                      0
                      • C Christian Graus

                        peterchen wrote: STL sucks anyway Those are SERIOUS fighting words. The STL rules in so many ways, it's beyond my comprehension that something could be so *cool*. peterchen wrote: but how the hell shall a newbie get along with this library, and accept it as "standard"? By not biting off more than they can chew. Vector is very intuitive, you push onto it, you pop off it. Iterators are the most logical thing in the world - they define a range, and for vector are probably pointers anyhow. You use pointers, don't you ? peterchen wrote: I finally fired up the debugger, checked what the stuff does, and prayed that it's either standard or I never have to port Use STL Port, it's a better STL implimentation, has hash tables and is cross platform. peterchen wrote: P.S. who is M$ ? Company run by Bill Gate$. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

                        Sonork ID 100.10002:MeanManOz

                        I live in Bob's HungOut now

                        P Offline
                        P Offline
                        peterchen
                        wrote on last edited by
                        #18

                        ****Christian Graus wrote: Those are SERIOUS fighting words Your quote missed the smiley! Seriously, I do appreciate the power and cleverness of STL, and it's elegance (in a baroque sense). However, it has some things that make it (in my eyes) unfit for a standard library. And anytime I try to use it I'm stuck with something I consider "should be intuitive", but which takes me quite some time to figure out. Peter

                        1 Reply Last reply
                        0
                        • C Christian Graus

                          Why don't you write your own bitmap class then ? It's a lot easier than writing a map, for example. How about your own operating system. Why use MFC, why not write your own class library ? It's the SAME THING. Why waste time refining your own containers when a ready made set is wating for you. If you're using MFC and use CArray, how do you go about sorting it ? How about if you have an array of numbers and want their sum ? I don't get why people would waste time writing such trivial stuff when it's sitting there. Jamie Nordmeyer wrote: That's exactly why I don't use STL; the syntax sucks! That is just pathetic. Yes, it might take you a day to learn how to syntax works, but why would you put the time into learning C++ syntax and not STL ? It's really quite intuitive once you've taken the time to learn how it works. Jamie Nordmeyer wrote: No iterators for me, thank you. So you don't use pointer arithmetic then ? That's what pretty much every vector iterator known to man uses. I just don't get it. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

                          Sonork ID 100.10002:MeanManOz

                          I live in Bob's HungOut now

                          J Offline
                          J Offline
                          Jamie Nordmeyer
                          wrote on last edited by
                          #19

                          Whoa there! TRUCE!!! TRUCE!!! :) :) Hey, we're all programmers here, right? I have my opinion, and you have yours. I have my style of doing things, you have yours. Many people would say that anyone who uses MFC is a moron, others say that anyone who DOESN'T use MFC is a moron. It's all about your own particular style, in my very humble opinion. You like STL (actually, considering the way that you're defending it, I have to ask if you wrote it ;) ). OK, then use it. I don't particularly like it, so I don't use it. I want a Dodge Prowler, you may think they're garbage. It's in the opinion. I never claimed that STL sucks, just the syntax. From what I've used of it, and from what I've read about it, it's a very efficient library. But, like MFC (hell, Windows, for that matter), it's not for everybody. Frankly, I've been doing a lot of C style SDK programming as of late, just to learn how Windows operates behind the mask that is MFC, so neither CArray or std::vector will work for me. :rolleyes: Just good 'ol malloc and free. Keep coding Christian, and don't take it so personally.:cool: Jamie Nordmeyer Portland, Oregon, USA

                          C 1 Reply Last reply
                          0
                          • C Christian Graus

                            Peter Godec wrote: Waah, my first post to The Lounge and it's about programming Welcome - nice to meet you. :-) Peter Godec wrote: Besides, I can't just look while you're putting down my favorite library. Well, double welcome. Can't have too many STL fans here, IMO. Have you read Scott Meyers 'Effective STL' yet ? I reckon it's the best book I bought this year. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

                            Sonork ID 100.10002:MeanManOz

                            I live in Bob's HungOut now

                            P Offline
                            P Offline
                            Peter Godec
                            wrote on last edited by
                            #20

                            Have you read Scott Meyers 'Effective STL' yet ? I reckon it's the best book I bought this year. I've heard only good things about Meyers' Effective... books, but Stroustrup's bible and occasional visits to the comp.lang.c++ are sufficient for me right now (there are some really smart people on that newsgroup). While we're at it, another free source of great C++ info is the C++ Experts Forum on the CUJ website (quite advanced stuff though:omg: ). --peter

                            C 1 Reply Last reply
                            0
                            • J Jamie Nordmeyer

                              Whoa there! TRUCE!!! TRUCE!!! :) :) Hey, we're all programmers here, right? I have my opinion, and you have yours. I have my style of doing things, you have yours. Many people would say that anyone who uses MFC is a moron, others say that anyone who DOESN'T use MFC is a moron. It's all about your own particular style, in my very humble opinion. You like STL (actually, considering the way that you're defending it, I have to ask if you wrote it ;) ). OK, then use it. I don't particularly like it, so I don't use it. I want a Dodge Prowler, you may think they're garbage. It's in the opinion. I never claimed that STL sucks, just the syntax. From what I've used of it, and from what I've read about it, it's a very efficient library. But, like MFC (hell, Windows, for that matter), it's not for everybody. Frankly, I've been doing a lot of C style SDK programming as of late, just to learn how Windows operates behind the mask that is MFC, so neither CArray or std::vector will work for me. :rolleyes: Just good 'ol malloc and free. Keep coding Christian, and don't take it so personally.:cool: Jamie Nordmeyer Portland, Oregon, USA

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

                              Jamie Nordmeyer wrote: Many people would say that anyone who uses MFC is a moron, others say that anyone who DOESN'T use MFC is a moron. Would they ? I like both, myself, depending on the app. Jamie Nordmeyer wrote: You like STL (actually, considering the way that you're defending it, I have to ask if you wrote it ) Fair enough - I admit to being a zealot when it comes to STL. It becomes almost a religious choice in the sense that I certainly seek to help others 'see the light' as I did. Jamie Nordmeyer wrote: Frankly, I've been doing a lot of C style SDK programming as of late, just to learn how Windows operates behind the mask that is MFC, so neither CArray or std::vector will work for me. You mean using C, not C++ at all ? Man, that's brave. I do a lot of C++ SDK programming ( no MFC), but the only time I bother to write a program in C is when I need to for a WDJ article. It's precisely because of our not using MFC that I finally converted everyone in our office to STL. Jamie Nordmeyer wrote: Keep coding Christian, and don't take it so personally. Fair call. I'll just get back into my box over here in the corner.... Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

                              Sonork ID 100.10002:MeanManOz

                              I live in Bob's HungOut now

                              1 Reply Last reply
                              0
                              • P Peter Godec

                                Have you read Scott Meyers 'Effective STL' yet ? I reckon it's the best book I bought this year. I've heard only good things about Meyers' Effective... books, but Stroustrup's bible and occasional visits to the comp.lang.c++ are sufficient for me right now (there are some really smart people on that newsgroup). While we're at it, another free source of great C++ info is the C++ Experts Forum on the CUJ website (quite advanced stuff though:omg: ). --peter

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

                                Peter Godec wrote: (there are some really smart people on that newsgroup). Hell, yes. I lurk there, too, but I'm rarely brave enough to offer any replies... The Effective STL book is great, because unlike the other sources you cite, it talks about how to get the most out of STL, rather than just telling you what your options are. I recommend it. Another great site is www.boost.org, it contains stuff likely to make the next C++ Standard, and all sorts of (STL and non-STL) cool stuff. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

                                Sonork ID 100.10002:MeanManOz

                                I live in Bob's HungOut now

                                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