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. Just wishful thinking...

Just wishful thinking...

Scheduled Pinned Locked Moved The Lounge
c++xml
20 Posts 8 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.
  • N Offline
    N Offline
    Norman Fung
    wrote on last edited by
    #1

    If Code Project can get organized, submit a petition and... 1. get "foreach" construct as part of ANSI standard for C++ 2. augment stdio with an XML parser :) Norman Fung

    J R I L J 5 Replies Last reply
    0
    • N Norman Fung

      If Code Project can get organized, submit a petition and... 1. get "foreach" construct as part of ANSI standard for C++ 2. augment stdio with an XML parser :) Norman Fung

      J Offline
      J Offline
      jan larsen
      wrote on last edited by
      #2

      If those features are something you want to see in your programming language, why not use Java or C# instead of polluting C++? "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

      N 1 Reply Last reply
      0
      • J jan larsen

        If those features are something you want to see in your programming language, why not use Java or C# instead of polluting C++? "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

        N Offline
        N Offline
        Norman Fung
        wrote on last edited by
        #3

        I do. But I also program C/C++/Win32/MFC. And a great deal of existing inventories are still written in C/C++, not to mention that you can compile your ANSI C++ library and get it run on UNIX box. Norman Fung

        J 1 Reply Last reply
        0
        • N Norman Fung

          If Code Project can get organized, submit a petition and... 1. get "foreach" construct as part of ANSI standard for C++ 2. augment stdio with an XML parser :) Norman Fung

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

          Norman Fung wrote: get "foreach" construct as part of ANSI standard for C++ A useful construct in C#, which is a language designed with knowledge of the .NET framework. Wouldn't work in C++ unless you're willing to see C++ mandate enumerable interfaces to arrays. I'm not willing to see such a mandate :) I don't find it that difficult to write a for loop or a do/while loop that takes into account the peculiarities of the container object I'm working with. Rob Manderson **Paul Watson wrote:**What sense would you most dislike loosing? Ian Darling replied. Telepathy Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003

          N 1 Reply Last reply
          0
          • N Norman Fung

            I do. But I also program C/C++/Win32/MFC. And a great deal of existing inventories are still written in C/C++, not to mention that you can compile your ANSI C++ library and get it run on UNIX box. Norman Fung

            J Offline
            J Offline
            jan larsen
            wrote on last edited by
            #5

            But do we need foreach?, I admit that I haven't given it a lot of thought, but there is bound to be a lot of issues involving the implementation. What kind of container should be the parameter?, and what would be the bloody point of it, if the runtime support for type checking (RTTI), as i recall is possible, is turned off? "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus

            1 Reply Last reply
            0
            • R Rob Manderson

              Norman Fung wrote: get "foreach" construct as part of ANSI standard for C++ A useful construct in C#, which is a language designed with knowledge of the .NET framework. Wouldn't work in C++ unless you're willing to see C++ mandate enumerable interfaces to arrays. I'm not willing to see such a mandate :) I don't find it that difficult to write a for loop or a do/while loop that takes into account the peculiarities of the container object I'm working with. Rob Manderson **Paul Watson wrote:**What sense would you most dislike loosing? Ian Darling replied. Telepathy Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003

              N Offline
              N Offline
              Norman Fung
              wrote on last edited by
              #6

              Rob Manderson wrote: ...enumerable interfaces to arrays. I'm not willing to see such a mandate... Yes, I'd agree. Norman Fung

              1 Reply Last reply
              0
              • N Norman Fung

                If Code Project can get organized, submit a petition and... 1. get "foreach" construct as part of ANSI standard for C++ 2. augment stdio with an XML parser :) Norman Fung

                I Offline
                I Offline
                Ian Darling
                wrote on last edited by
                #7

                Norman Fung wrote: get "foreach" construct as part of ANSI standard for C++ Take a shufty at <algorithm> header for the following template:

                template
                   Function for_each(
                      InputIterator _First, 
                      InputIterator _Last, 
                      Function _Func
                   );
                

                It's already part of the standard. If you really want a foreach rather than a for_each, add in:

                #define foreach for_each
                

                :-) Norman Fung wrote: 2. augment stdio with an XML parser And a CSV parser, and an EDI parser, and a Word parser, and an Excel parser, and a SQL Server database file parser, and an AVI parser, and a ZIP parser, and a BMP parser, and a JPG parser, and an MP3 parser, etc etc Our survey says uh-uh


                Ian Darling "The different versions of the UN*X brand operating system are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0, III, 4.1, V, 4.2, V.2, and 4.3" - Alan Filipski

                R T 2 Replies Last reply
                0
                • I Ian Darling

                  Norman Fung wrote: get "foreach" construct as part of ANSI standard for C++ Take a shufty at <algorithm> header for the following template:

                  template
                     Function for_each(
                        InputIterator _First, 
                        InputIterator _Last, 
                        Function _Func
                     );
                  

                  It's already part of the standard. If you really want a foreach rather than a for_each, add in:

                  #define foreach for_each
                  

                  :-) Norman Fung wrote: 2. augment stdio with an XML parser And a CSV parser, and an EDI parser, and a Word parser, and an Excel parser, and a SQL Server database file parser, and an AVI parser, and a ZIP parser, and a BMP parser, and a JPG parser, and an MP3 parser, etc etc Our survey says uh-uh


                  Ian Darling "The different versions of the UN*X brand operating system are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0, III, 4.1, V, 4.2, V.2, and 4.3" - Alan Filipski

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

                  Ian Darling wrote: a CSV parser, and an EDI parser, and a Word parser, and an Excel parser, and a SQL Server database file parser, and an AVI parser, and a ZIP parser, and a BMP parser, and a JPG parser, and an MP3 parser Greedy!!! :) Rob Manderson **Paul Watson wrote:**What sense would you most dislike loosing? Ian Darling replied. Telepathy Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003

                  I N 2 Replies Last reply
                  0
                  • R Rob Manderson

                    Ian Darling wrote: a CSV parser, and an EDI parser, and a Word parser, and an Excel parser, and a SQL Server database file parser, and an AVI parser, and a ZIP parser, and a BMP parser, and a JPG parser, and an MP3 parser Greedy!!! :) Rob Manderson **Paul Watson wrote:**What sense would you most dislike loosing? Ian Darling replied. Telepathy Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003

                    I Offline
                    I Offline
                    Ian Darling
                    wrote on last edited by
                    #9

                    Rob Manderson wrote: Greedy!!! Well, how am I going to write that amazing program that does everything without being given the exact bits I need as part of the toolset? <WHINGE CLASS=VB_PROGRAMMER IDIOCY=MORE_MORONIC_THAN_USUAL> Why can't I write a media player that exports playlists as XML for my blog, generates JPG images on the fly for trippy visualisations and streams the audio to a thousand listeners in 10 lines of code and some controls on Form1? Then records all the statistics in SQL Server and processes them into a report for other people, transferred using EDI. In a second 10 lines of code and another control on Form1. And a third set of 10 lines of code can manipulate the Bluetooth dongle into a molecularising nano-constructer, and make me a real, live pony called Blossom Flower. </WHINGE> And this is why C++ shouldn't have a standardised, builtin, XML parser - because then the VBers would demand to be able to do the above :-)


                    Ian Darling "The different versions of the UN*X brand operating system are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0, III, 4.1, V, 4.2, V.2, and 4.3" - Alan Filipski

                    R 1 Reply Last reply
                    0
                    • R Rob Manderson

                      Ian Darling wrote: a CSV parser, and an EDI parser, and a Word parser, and an Excel parser, and a SQL Server database file parser, and an AVI parser, and a ZIP parser, and a BMP parser, and a JPG parser, and an MP3 parser Greedy!!! :) Rob Manderson **Paul Watson wrote:**What sense would you most dislike loosing? Ian Darling replied. Telepathy Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003

                      N Offline
                      N Offline
                      Norman Fung
                      wrote on last edited by
                      #10

                      Greedy, yes. ;P Would you recommend an Open Source C/XML parser though? Norman Fung

                      R I M 3 Replies Last reply
                      0
                      • I Ian Darling

                        Rob Manderson wrote: Greedy!!! Well, how am I going to write that amazing program that does everything without being given the exact bits I need as part of the toolset? <WHINGE CLASS=VB_PROGRAMMER IDIOCY=MORE_MORONIC_THAN_USUAL> Why can't I write a media player that exports playlists as XML for my blog, generates JPG images on the fly for trippy visualisations and streams the audio to a thousand listeners in 10 lines of code and some controls on Form1? Then records all the statistics in SQL Server and processes them into a report for other people, transferred using EDI. In a second 10 lines of code and another control on Form1. And a third set of 10 lines of code can manipulate the Bluetooth dongle into a molecularising nano-constructer, and make me a real, live pony called Blossom Flower. </WHINGE> And this is why C++ shouldn't have a standardised, builtin, XML parser - because then the VBers would demand to be able to do the above :-)


                        Ian Darling "The different versions of the UN*X brand operating system are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0, III, 4.1, V, 4.2, V.2, and 4.3" - Alan Filipski

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

                        :laugh::laugh::laugh::laugh: You remind me of someone over on http:/www.dvdrhelp.com[^] about a year ago. At the time a couple of programs had been released that did amazing things in compressing a 2 layer DVD to a single layer without losing all that much quality. Anyway, this guy was somewhat dissatisfied with either offering and had this 'amazing' idea of how it could be much better. All he needed was a programmer to write a couple of 'easy' pieces to his grand scheme. I must confess I did play with his mind a bit :) Rob Manderson **Paul Watson wrote:**What sense would you most dislike loosing? Ian Darling replied. Telepathy Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003

                        1 Reply Last reply
                        0
                        • N Norman Fung

                          Greedy, yes. ;P Would you recommend an Open Source C/XML parser though? Norman Fung

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

                          If I could I would. Alas, I haven't dabbled in XMS yet (but it will happen) :) Rob Manderson **Paul Watson wrote:**What sense would you most dislike loosing? Ian Darling replied. Telepathy Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003

                          1 Reply Last reply
                          0
                          • N Norman Fung

                            Greedy, yes. ;P Would you recommend an Open Source C/XML parser though? Norman Fung

                            I Offline
                            I Offline
                            Ian Darling
                            wrote on last edited by
                            #13

                            Norman Fung wrote: Would you recommend an Open Source C/XML parser though? Given my XML experiences starts with me trying to write my own, and ending with MSXML and System.Xml, I'm afraid not. I keep hearing about this SAX thing though.


                            Ian Darling "The different versions of the UN*X brand operating system are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0, III, 4.1, V, 4.2, V.2, and 4.3" - Alan Filipski

                            N 1 Reply Last reply
                            0
                            • I Ian Darling

                              Norman Fung wrote: Would you recommend an Open Source C/XML parser though? Given my XML experiences starts with me trying to write my own, and ending with MSXML and System.Xml, I'm afraid not. I keep hearing about this SAX thing though.


                              Ian Darling "The different versions of the UN*X brand operating system are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0, III, 4.1, V, 4.2, V.2, and 4.3" - Alan Filipski

                              N Offline
                              N Offline
                              Norman Fung
                              wrote on last edited by
                              #14

                              Thanks. Will look it up. In case if someone is curious: SAX[^] Norman Fung

                              1 Reply Last reply
                              0
                              • N Norman Fung

                                Greedy, yes. ;P Would you recommend an Open Source C/XML parser though? Norman Fung

                                M Offline
                                M Offline
                                Mike Dimmick
                                wrote on last edited by
                                #15

                                How about Xerces[^], from the Apache group? OK, C++ rather than C.

                                1 Reply Last reply
                                0
                                • N Norman Fung

                                  If Code Project can get organized, submit a petition and... 1. get "foreach" construct as part of ANSI standard for C++ 2. augment stdio with an XML parser :) Norman Fung

                                  L Offline
                                  L Offline
                                  Lost User
                                  wrote on last edited by
                                  #16

                                  std::for_each already exists in <algorithm> My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers

                                  1 Reply Last reply
                                  0
                                  • I Ian Darling

                                    Norman Fung wrote: get "foreach" construct as part of ANSI standard for C++ Take a shufty at <algorithm> header for the following template:

                                    template
                                       Function for_each(
                                          InputIterator _First, 
                                          InputIterator _Last, 
                                          Function _Func
                                       );
                                    

                                    It's already part of the standard. If you really want a foreach rather than a for_each, add in:

                                    #define foreach for_each
                                    

                                    :-) Norman Fung wrote: 2. augment stdio with an XML parser And a CSV parser, and an EDI parser, and a Word parser, and an Excel parser, and a SQL Server database file parser, and an AVI parser, and a ZIP parser, and a BMP parser, and a JPG parser, and an MP3 parser, etc etc Our survey says uh-uh


                                    Ian Darling "The different versions of the UN*X brand operating system are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0, III, 4.1, V, 4.2, V.2, and 4.3" - Alan Filipski

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

                                    The STL for each is a primitive excuse for a for each. The construct is a kludge. Not to mention that even people like Meyers produce slower and more obscure bugs with this nasty construct trying to get it to do what they want. A true for each would be nice. Tim Smith I'm going to patent thought. I have yet to see any prior art.

                                    J 1 Reply Last reply
                                    0
                                    • N Norman Fung

                                      If Code Project can get organized, submit a petition and... 1. get "foreach" construct as part of ANSI standard for C++ 2. augment stdio with an XML parser :) Norman Fung

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

                                      Boo! Hiss! If we're going to have a petition, why not get rid of the absurd abbreviations for wide string functions and, while at it, change wchar_t to wchar? By rule, unicode equivilants of standard library functions should simply have a 'w' in front of them. Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

                                      N 1 Reply Last reply
                                      0
                                      • J Joe Woodbury

                                        Boo! Hiss! If we're going to have a petition, why not get rid of the absurd abbreviations for wide string functions and, while at it, change wchar_t to wchar? By rule, unicode equivilants of standard library functions should simply have a 'w' in front of them. Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

                                        N Offline
                                        N Offline
                                        Norman Fung
                                        wrote on last edited by
                                        #19

                                        haha.. but it's the underscore that make us proud C++ programmers. Norman Fung

                                        1 Reply Last reply
                                        0
                                        • T Tim Smith

                                          The STL for each is a primitive excuse for a for each. The construct is a kludge. Not to mention that even people like Meyers produce slower and more obscure bugs with this nasty construct trying to get it to do what they want. A true for each would be nice. Tim Smith I'm going to patent thought. I have yet to see any prior art.

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

                                          Tim Smith wrote: produce slower and more obscure bugs What are slower bugs? Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

                                          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