From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c9d5fc258548b22a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!news-xxxfer.readnews.com!news-out.readnews.com!postnews3.readnews.com!postbox2.readnews.com!not-for-mail Date: Wed, 02 Mar 2011 13:59:30 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.14) Gecko/20110221 Thunderbird/3.1.8 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <31c357bd-c8dc-4583-a454-86d9c579e5f4@m13g2000yqb.googlegroups.com> <05a3673e-fb97-449c-94ed-1139eb085c32@x1g2000yqb.googlegroups.com> <4d4c232a$0$28967$882e7ee2@usenet-news.net> <4D4D6506.50909@obry.net> <4d50095f$0$22393$882e7ee2@usenet-news.net> <4d6d56c4$0$11509$882e7ee2@usenet-news.net> <16u9ka51wbukr$.1fj2sb73j9rv6.dlg@40tude.net> <4d6d627b$0$11509$882e7ee2@usenet-news.net> <29c4lixc0ght$.14kkfz1kij135.dlg@40tude.net> <4d6d6afb$0$11509$882e7ee2@usenet-news.net> <1gz9984wwizn5.r619fw4z9o56.dlg@40tude.net> <4d6e5614$0$21954$882e7ee2@usenet-news.net> <4d6e64f5$0$21954$882e7ee2@usenet-news.net> <4d6e6f79$0$7657$9b4e6d93@newsspool1.arcor-online.net> <4d6e7313$0$21956$882e7ee2@usenet-news.net> <4d6e902b$0$6760$9b4e6d93@newsspool3.arcor-online.net> In-Reply-To: <4d6e902b$0$6760$9b4e6d93@newsspool3.arcor-online.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4d6e9393$0$17952$a8266bb1@postbox2.readnews.com> NNTP-Posting-Host: 198.186.190.52 X-Trace: 1299092371 postbox2.readnews.com 17952 198.186.190.52:59627 Xref: g2news1.google.com comp.lang.ada:17739 Date: 2011-03-02T13:59:30-05:00 List-Id: On 3/2/2011 1:44 PM, Georg Bauhaus wrote: > I was told that today's programmers have grown accustomed > to handling calendar dates as strings. It's not intrinsically horrible to do things this way provided you have proper control over your inputs so that you know you are starting with valid data. But it obviously makes it easier to lose that control, because people will be tempted to start fiddling with the data outside of what the library offers. I can't say that I've ever written code that way, nor seen others do so. I've always used data types to hold dates and times. The only problem is that I've had to deal with many such types and conversions between them. > The difficulty is the silent bugs introduced when some subsystem of > a program produces "legacy calendar date" strings. They tend to be > of some non-standard form, one that is not compatible with MySQL's > expectations, but that MySQL does not reject. You might then > notice the effects when it is too late. Yes. If you can't trust your library do to date conversion properly, then you must add your own validation module and sanitize all inputs before passing them along. And then it becomes easy to miss a case and let an error slip through.