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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.98.103 with SMTP id eh7mr1249261wib.3.1364344871446; Tue, 26 Mar 2013 17:41:11 -0700 (PDT) Path: p18ni19808wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!216.40.29.245.MISMATCH!novia!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsgate.cuhk.edu.hk!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Fri, 22 Mar 2013 20:29:00 -0600 Organization: Aioe.org NNTP Server Message-ID: References: <99929f93-b80f-47c3-8a37-c81002733754@googlegroups.com> <87ec4b1d-f7cd-49a4-8cff-d44aeb76a1ad@googlegroups.com> <78103a2f-5d19-4378-b211-1917175d5694@googlegroups.com> <3p6p8k0yfly7.ctazdw7fc5so$.dlg@40tude.net> <1jtvzi1v65aqm.1k5ejsveno59f.dlg@40tude.net> <1hvv2kd9smnfx.6spgz9thd1mh$.dlg@40tude.net> <1raubw1sk48ca$.69rdgczvnnf.dlg@40tude.net> <2qwq2cdeuvhu$.qtnb8zyhuob9$.dlg@40tude.net> <39766694-798c-483e-b068-f3f88a00cac4@googlegroups.com> Reply-To: nma@12000.org NNTP-Posting-Host: rJix4pvAwSwJzPKFwj2OTA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2013-03-22T20:29:00-06:00 List-Id: On 3/22/2013 2:51 PM, Dmitry A. Kazakov wrote: > Anyway all boils down to run-time > checks (faults) vs. compile-time checks (errors/bugs). A failed run-time > check is a program state to anticipate. More such checks you do, more > states you have, more difficult it becomes to design tests covering these > states, or just to keep in mind that such states exist and are reachable. > > I don't buy run-time checks unless *proven* that compile-time check would > be impossible to have. And this is not an optimization issue. > In languages like Matlab and others like it, which do not have static type checking and everything is done at run-time, you'll typically see more than 50% of the code just doing manual checks on function parameters to make sure it is the 'correct input' needed by the function. Since there is no compiler to check statically, what ends happening is that now the programmer is doing what the compiler could have done and much better. The programmer spends more time adding code to check that types match (is this a structure? is this a string? is this a 1D vector etc...) I am not even talking about checking that the range of the values makes sense, just to check that the input is even of the correct 'kind' that is all. All of this is such a waste of time and energy, as a strongly typed static language will not need all this, and one will simply declare variables of needed types and be done with it and then spend the time thinking on the problem domain itself and on the algorithm. The sad thing, is that more and more languages are going to this 'write anything you want and leave the checking for when the code runs' way of doing things. --Nasser