473,466 Members | 1,565 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Date class wanted

8 New Member
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.
Aug 22 '07 #1
13 1795
RedSon
5,000 Recognized Expert Expert
Did you try Google yet?
Aug 22 '07 #2
RRick
463 Recognized Expert Contributor
Take a look at the boost project. They do a lot of work with C++ objects.
Aug 23 '07 #3
gh57
8 New Member
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".
Aug 23 '07 #4
gh57
8 New Member
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
Aug 23 '07 #5
RedSon
5,000 Recognized Expert Expert
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.
Aug 23 '07 #6
gh57
8 New Member
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.

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 misunderstanding (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?"

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).

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
Aug 23 '07 #7
RedSon
5,000 Recognized Expert Expert
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.

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.
Aug 23 '07 #8
JosAH
11,448 Recognized Expert MVP
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
Aug 23 '07 #9
RedSon
5,000 Recognized Expert Expert
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.
Aug 24 '07 #10
gh57
8 New Member
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
Aug 25 '07 #11
gh57
8 New Member
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 "information 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.

But open source would be a good way to go.
100% agree.

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.

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!)

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.

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
Aug 25 '07 #12
gh57
8 New Member
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?

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.

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
Aug 25 '07 #13
JosAH
11,448 Recognized Expert MVP
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
Aug 25 '07 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: The Biscuit Eater | last post by:
Just started "playing" with php and have a question. I currently have a csv list such as this: 11-08-03 | Tournament | Chapman rules 12-18-03 | Beat The Pro | pick your partner etc. Is there...
1
by: Raskolnikow | last post by:
Hi! I have some beginner questions about C++, so please be gentle if the things I ask are trivial. What I want to do is a program that - changes the current (system) date, - calls an...
7
by: Adrian | last post by:
I hit on this problem converting a VB.NET insurance application to C#. Age next birthday calculated from date of birth is often needed in insurance premium calculations. Originally done using...
7
by: | last post by:
I am trying to validate a textfield to ensure it holds a time. I use a try/catch block to see if I can convert to a time & if it works then I blindly 'assume' it was OK. This single line Dim...
2
by: Avanti | last post by:
I have a date property in the class and I wanted to assign it a min date. Public class test Public Property CreatedBy() As String Get Return mCreatedBy
12
by: Rob Meade | last post by:
Hi all, Ok - I've come from a 1.1 background - and previously I've never had any problem with doing this: Response.Write (Session("MyDate").ToString("dd/MM/yyyy")) So, I might get this for...
1
by: George Eapen | last post by:
Folks.. just wanted to know which class can be used to change the format of a date . eg..Date is given in dd/mm/yy min:sec format.. i want to trim it to "April 20,1995" format. can any...
2
by: Simon | last post by:
Dear reader, The presentation of a date field is possible with short date, long date etcetera. But as you know the presentation of a date field in a report is still be depending on the...
6
by: lptl | last post by:
I know the title is misleading. I am working on a class project where we are trying to setup a notification system written in PHP and using an MySQL database. We are trying to set-up a notification...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.