Date class wanted

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gh57
    New Member
    • Aug 2007
    • 8

    Date class wanted

    Hi, all!

    I am brandnew to this forum. Currently I am trying to learn C++. I am reading "The C++ Programming Language" (special edition, written by Bjarne Stroustrup) and trying to solve the excercises.

    Excercise 3 of chapter 10 says: "Find a Date class that is in commercial use. Critique the facilities it offers. If possible, then discuss that Date with a real user."

    To do that excercise: Can anybody give me a pointer to the source code of an industrial strength Open Source Date class?

    (FYI, I did already excercise 2 and implemented my own Date class and I want to compare,)

    Thanks in advance!

    Sincerely,
    Gerhard

    P.S. Sorry, I am not a native speaker. Please apologize any errors.
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Did you try Google yet?

    Comment

    • RRick
      Recognized Expert Contributor
      • Feb 2007
      • 463

      #3
      Take a look at the boost project. They do a lot of work with C++ objects.

      Comment

      • gh57
        New Member
        • Aug 2007
        • 8

        #4
        Originally posted by RedSon
        Did you try Google yet?
        No, I didn't, because I hoped that "a real user" - as the excercise states - would give me a hint to the date class that s/he uses.

        But I am probably overestimating the importance of this part of the excercise. Prof. Stroustrup's excercises have sometimes (more or less hidden) didactic purposes which go far beyond the learning of the particular language detail. Reportedly (Kent Beck's books), in Object Oriented Programming is the interaction between developers more important than ever (CRC Cards, Extreme Programming...) . Perhaps this exercise is supposed to be a starter to such interaction techniques.

        My other bias was that my main workhorse is currently SQL and PL/SQL. There I have to use the "date" datatype and its operations rather heavily.

        So my question should have been "Does anybody use heavily a C++ date class comparable to "date" dataype of SQL and can give me a pointer to its source code?"

        But anyway, this Google list of date classes is very interesting. I will it investigate.

        Thank you very much!
        Gerhard

        P.S. Checking with a dictionary, I found that "didactic" has in the English language also a pejorative meaning. Please note that I want to use "didactic" only in the sense of "belonging to the science/scholarship/art of being a good teacher/instructor".

        Comment

        • gh57
          New Member
          • Aug 2007
          • 8

          #5
          Originally posted by RRick
          Take a look at the boost project. They do a lot of work with C++ objects.
          Thank you for your advice. I will investigate...
          Gerhard

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            Originally posted by gh57
            No, I didn't, because I hoped that "a real user" - as the excercise states - would give me a hint to the date class that s/he uses.

            But I am probably overestimating the importance of this part of the excercise. Prof. Stroustrup's excercises have sometimes (more or less hidden) didactic purposes which go far beyond the learning of the particular language detail. Reportedly (Kent Beck's books), in Object Oriented Programming is the interaction between developers more important than ever (CRC Cards, Extreme Programming...) . Perhaps this exercise is supposed to be a starter to such interaction techniques.

            My other bias was that my main workhorse is currently SQL and PL/SQL. There I have to use the "date" datatype and its operations rather heavily.

            So my question should have been "Does anybody use heavily a C++ date class comparable to "date" dataype of SQL and can give me a pointer to its source code?"

            But anyway, this Google list of date classes is very interesting. I will it investigate.

            Thank you very much!
            Gerhard

            P.S. Checking with a dictionary, I found that "didactic" has in the English language also a pejorative meaning. Please note that I want to use "didactic" only in the sense of "belonging to the science/scholarship/art of being a good teacher/instructor".
            Oh, I was under the impression that your task was two fold. First find and analyze a data class that is being used in a production environment. Then share that information with another person and discuss that with them.

            We are all happy to discuss the merits of a certain piece of software, but I don't think any of us want to take the time to research and find a Date class for you to examine. If you want to do your own research then post your research and then ask everyone to please comment on the finer points of your research then I think that is satisfactory. I also think it would be a good candidate for an article to be posted to our articles section.

            Comment

            • gh57
              New Member
              • Aug 2007
              • 8

              #7
              Originally posted by RedSon
              Oh, I was under the impression that your task was two fold. First find and analyze a data class that is being used in a production environment. Then share that information with another person and discuss that with them.
              The book says "... If possible, then discuss that Date with a real user." I thought that that means ".. real user of that class".

              Finding a Date class will be easy. To decide if it is used in a production environment could be harder without help.

              Originally posted by RedSon
              We are all happy to discuss the merits of a certain piece of software, but I don't think any of us want to take the time to research and find a Date class for you to examine.
              Sorry for this misunderstandin g (it must be my poor English). To me it was always crystal clear that doing time-consuming work is my duty.

              But I thought that my question was: "Which Date class you are using at work?" and that answering it would generate as much (less) work to Date-class-using forum members as for example answering the question: "Which compiler and which version of that compiler you are using?"

              Originally posted by RedSon
              If you want to do your own research then post your research and then ask everyone to please comment on the finer points of your research then I think that is satisfactory.
              OK. I will try. But naturally, my search will be limited to Open Source Date classes (and perhaps commercial software with published include files).

              Originally posted by RedSon
              I also think it would be a good candidate for an article to be posted to our articles section.
              If you really think that this is a task for a newbie, I will consider that.

              Thank you!
              Gerhard

              Comment

              • RedSon
                Recognized Expert Expert
                • Jan 2007
                • 4980

                #8
                Originally posted by gh57
                I thought that my question was: "Which Date class you are using at work?"
                The problem is that any class we are using at work is going to be the intellectual property of that company so we wouldn't be able to share it with you. But open source would be a good way to go. But just because we are not using it in our work environment does not mean that we cannot evaluate it using our best professional judgment.

                I think that the essence of the question is this: Find a Date class that is robust enough to be used in a production environment. If you can find a Date class that is actually in use in a mature project then that is even better. Then discuss the merits of the class with either a professional who is using that class or someone who can describe their professional opinions about it. There are several opinionated developers on this forum and they will be more then happy to share their thoughts either good or bad.

                Originally posted by gh57
                If you really think that this is a task for a newbie, I will consider that.

                Thank you!
                Gerhard
                Articles can come from any place. I think articles written by newbies would be especially valuable given that they are still learning. They can describe some of the pitfalls that they encountered besides everyone loves a good intellectual discussion about software design.

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #9
                  Bjarne Stroustrup is more like a computer scientist and a mathematician than he
                  is a software engineer. Which is a good thing if you want to develop a more or
                  less consistent and powerful programming language. On the other hand, those
                  folks are mean rascals: they ask a more or less 'open' question, asking you to
                  take a 'position' (pick a commercial data/time package you like). Once you do
                  so, they slaughter you by mentioning the deficiencies, stupidity, false assumptions
                  and what have you, about that particular thing you innocently picked.

                  When the dust has settled they just ask the following 'open' question and forget
                  all about the carcases they've left behind. That's how those scientists are. It's
                  just a little trick they use. In the mean time they've succeeded hiding the
                  deficiencies and failures of their *own* little pet peeve project. (C++).

                  Scientific progress goes *boink* that way; take it from me, I've been there, done that.
                  No matter which implementation of whatever domain you choose, there's something
                  wrong with it. Humans and such, you know ;-)

                  kind regards,

                  Jos

                  Comment

                  • RedSon
                    Recognized Expert Expert
                    • Jan 2007
                    • 4980

                    #10
                    Originally posted by JosAH
                    Bjarne Stroustrup is more like a computer scientist and a mathematician than he
                    is a software engineer. Which is a good thing if you want to develop a more or
                    less consistent and powerful programming language. On the other hand, those
                    folks are mean rascals: they ask a more or less 'open' question, asking you to
                    take a 'position' (pick a commercial data/time package you like). Once you do
                    so, they slaughter you by mentioning the deficiencies, stupidity, false assumptions
                    and what have you, about that particular thing you innocently picked.

                    When the dust has settled they just ask the following 'open' question and forget
                    all about the carcases they've left behind. That's how those scientists are. It's
                    just a little trick they use. In the mean time they've succeeded hiding the
                    deficiencies and failures of their *own* little pet peeve project. (C++).

                    Scientific progress goes *boink* that way; take it from me, I've been there, done that.
                    No matter which implementation of whatever domain you choose, there's something
                    wrong with it. Humans and such, you know ;-)

                    kind regards,

                    Jos
                    Heh, leave it to Jos to pull aside the curtain to expose the wizard hiding behind. If you are studying on your own out of a book you should be pretty safe from the ridicule of your professors and scientists. Don't let their method discourage you. Everyone makes assumptions about everything, even those professors. Go ahead you pick any assumption, *any* assumption, and someone will be able to find a way to poke a hole in it to make your assumption less valid. It doesn't mean anything.

                    Comment

                    • gh57
                      New Member
                      • Aug 2007
                      • 8

                      #11
                      Originally posted by RedSon
                      Heh, leave it to Jos to pull aside the curtain to expose the wizard hiding behind. If you are studying on your own out of a book you should be pretty safe from the ridicule of your professors and scientists. Don't let their method discourage you. Everyone makes assumptions about everything, even those professors. Go ahead you pick any assumption, *any* assumption, and someone will be able to find a way to poke a hole in it to make your assumption less valid. It doesn't mean anything.
                      Sorry for the time lag of my reply, but real life (aka boss) distracted me. I am working on the replies.

                      Thank you!
                      Gerhard

                      Comment

                      • gh57
                        New Member
                        • Aug 2007
                        • 8

                        #12
                        Originally posted by RedSon
                        The problem is that any class we are using at work is going to be the intellectual property of that company so we wouldn't be able to share it with you.
                        Hm, I thought that - due to the "informatio n hiding principle", which reportedly is one of the central building blocks of the OOP paradigma - a user of a class sees that class only as a black box. If the class (library) is only available in compiled form, it is (nearly) impossible to take a look under the hood and inspect the implementation.

                        Although Prof. Stroustrup's book is obviously usable as an academic text book in a college course, according to the Preface to the First Edition: "This book is primarily intended to help serious programmers learn the language and use it for nontrivial projects."

                        With that notions in mind, I think that the meaning of "discussing a class with a real user" can only be "discussing the class properties which can be found in the documentation". In my experience, even "closed source" :-) products like Oracle have openly readable documentation - [A href="http://download.oracle .com/docs/cd/B12037_01/nav/portal_3.htm"] Oracle Database Online Documentation 10g Release 1 [/A] (OTH, how can I correctly insert links as you did it with the Google search?)

                        So, I am not convinced that the answer to the question "Which product (i.e. class library) do you use?" would infringe intellectual property. (Perhaps if the business decision of selecting this special product should be kept secret if the decision was unfortunate... :-))

                        But (although I own the 9th printing of the Special Edition which is from January 2004), the first edition of the book was published 1985. At that time, open source was in its infancy and clearly not an option to be addressed in a text book excercise.

                        Originally posted by RedSon
                        But open source would be a good way to go.
                        100% agree.

                        Originally posted by RedSon
                        But just because we are not using it in our work environment does not mean that we cannot evaluate it using our best professional judgment.
                        OK.

                        I think that the essence of the question is this: Find a Date class that is robust enough to be used in a production environment. If you can find a Date class that is actually in use in a mature project then that is even better.
                        OK. I will try it with Google as you proposed. Surely the Boost library (thanks again, RRick) will be investigated.

                        Originally posted by RedSon
                        Then discuss the merits of the class with either a professional who is using that class or someone who can describe their professional opinions about it. There are several opinionated developers on this forum and they will be more then happy to share their thoughts either good or bad.
                        OK. (Have I already said "thank you" this day? This forum is fantastic!)

                        Originally posted by RedSon
                        Articles can come from any place. I think articles written by newbies would be especially valuable given that they are still learning.
                        OK. I will try, but I'm skeptical that with this special topic *I* can give much added value to the community. (I didn't told you that Prof. Stroustrup's estimate for the whole excercise is only ONE hour but I didn't anticipiate the whole thread).

                        OTH, is there a possibility to insert html tables into a forum post? Would be great for comparison.

                        Originally posted by RedSon
                        They can describe some of the pitfalls that they encountered besides everyone loves a good intellectual discussion about software design.
                        Now, that is really important for me. I must admit that I haven't looked around enough in thescripts. So, there is no separate forum for (object oriented) software design and it is OK to discuss this matters in the language-related forums?


                        Thank you!
                        Gerhard

                        Comment

                        • gh57
                          New Member
                          • Aug 2007
                          • 8

                          #13
                          Originally posted by JosAH
                          Bjarne Stroustrup is more like a computer scientist and a mathematician than he
                          is a software engineer. Which is a good thing if you want to develop a more or
                          less consistent and powerful programming language.
                          Yes, of course, but didn't he work for the Bell Labs half a lifetime, the people who developed UNIX and C? Isn't that industry, not university?

                          Originally posted by JosAH
                          On the other hand, those
                          folks are mean rascals: they ask a more or less 'open' question, asking you to
                          take a 'position' (pick a commercial data/time package you like). Once you do
                          so, they slaughter you by mentioning the deficiencies, stupidity, false assumptions
                          and what have you, about that particular thing you innocently picked
                          .

                          Hey, is it that what happens when one has to "defend his/her thesis"? :-)

                          Then you cannot start early enough preparing for that "slaughter" . So, even if the aim of the exercise is really the preparation for that specific academic/scientific behavior, it would be very valuable.

                          Originally posted by JosAH
                          When the dust has settled they just ask the following 'open' question and forget
                          all about the carcases they've left behind. That's how those scientists are. It's
                          just a little trick they use. In the mean time they've succeeded hiding the
                          deficiencies and failures of their *own* little pet peeve project. (C++).

                          Scientific progress goes *boink* that way; take it from me, I've been there, done that.
                          No matter which implementation of whatever domain you choose, there's something
                          wrong with it. Humans and such, you know ;-)
                          Yes, I think I know what you mean. It is rather well-documented in literature.

                          But I do not believe that that is the case with this book. I think that Prof. Stroustrup's aims in the excercises are really strictly didactic.

                          For example in Chapter 7 ("Functions" ) there is the following exercise 10:
                          "Write a program to help decipher messages encrypted with the method described in [the exercise 9] without knowing the key. Hint: See David Kahn: The Codebreakers, Macmillan, 1967, New York pp. 207-213"

                          Clearly, Prof. Stroustrup wants that his students/trainees have to use a library, looking up for a narratively expressed algorithm - a very valuable experience, I think.

                          Of course, for an Middle-European the page number reference generates a hurdle. A German translation of the book is useless due to different pagination, the 1967 version is no more buyable, a library with the English version out of reach.

                          (So, guys, does anybody have access to the 1967 version of The Codebreakers? Whats there at pp 207-213? Is it about how Charles Babbage broke the Vigenère Cipher? :-). I think so because my solution works.)

                          Or the last excercise of appendix D, "Locales": "Learn another natural language. Estimated time to solve: 3-4 years".

                          OK, perhaps that exercise have to be taken with a grain of salt...

                          In summary, I am convinced that Prof. Stroustrup is a skilled teacher and his book is great opportunity to learn C++. Prof. Stroustrup's (hidden or not) aims of text and exercises are solely in the interest of the reader, be it for scientific or practitioners' purposes.

                          But there is one drawback: since the amount of information in this book is so huge and the book is polished to the utmost in the long time since its first edition 1985, that there is meaning in every sentence and every word. You have to concentrate sharp.

                          At first reading, I didn't that. Then I bought Scott Meyers's Effective C++. Great reading, too. Very humorous, very instructive. You miss something if you don't
                          have read Scott Meyers's books.

                          But after that I reread The C++ Programming language, and I found everything there, too. Sometimes very concise, only one sentence, but the information is present.

                          But if you have some constraint, perhaps due to budget or weight or something, and are allowed to take only one book about C++, then in my opinion, you should stick with The C++ Programming Language.

                          As a prerequisite awk or Perl experience would of couse be rather helpful.
                          And doing as much exercises as possible is a must. (Therefore I started this thread...)

                          Oops. Sorry for being so massive off-topic. But I love that book...

                          Thank you for your patience!
                          Gerhard

                          Comment

                          • JosAH
                            Recognized Expert MVP
                            • Mar 2007
                            • 11453

                            #14
                            Originally posted by gh57
                            Yes, of course, but didn't he work for the Bell Labs half a lifetime, the people who developed UNIX and C? Isn't that industry, not university?

                            [ ... ]
                            Oops. Sorry for being so massive off-topic. But I love that book...

                            Thank you for your patience!
                            Gerhard
                            Bell labs was, and maybe still is, a play garden of MIT and other universities.
                            ut I agree: Bjarne Stroustrup's book should be read from cover to cover. At least
                            two or three times; the book started off as thick as K&R's the C Programming
                            Language in the first edition but it got thicker and thicker because the language
                            did the same. ;-) It's a "must read" IMHO.

                            kind regards,

                            Jos

                            Comment

                            Working...