What's the best way to minimize the need of run time checks?

Michael Torrie torriem at gmail.com
Wed Aug 10 20:02:19 EDT 2016


On 08/10/2016 11:29 AM, Michael Selik wrote:
> On Tue, Aug 9, 2016 at 9:31 PM Steven D'Aprano <steve+python at pearwood.info>
> wrote:
> 
>>
>> http://steve-yegge.blogspot.com.au/2008/05/dynamic-languages-strike-back.html
> 
> 
> Great link. I enjoyed the video, too.
> https://www.youtube.com/watch?v=tz-Bb-D6teE
> 
> Buried deep in the QA section, there's a comment from the audience (I'll
> paraphrase), that compiler type-checking is wonderful. Yegge replies that, "I
> realized early in my career that I would actually rather have a runtime
> error than a compile error."

True but sometimes a compile error would save a lot of time and
frustration later on when the runtime error occurs. For example in
Python if I am setting an attribute on an object and mispell the
attribute, there is no compile error, but often I won't get a runtime
error from that, but I will get buggy behavior that sometimes but not
always occurs.  Very frustrating. Pylint catches that of course, so it's
a weaker argument for compilers than some others perhaps.




More information about the Python-list mailing list