<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: static-typing</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/static-typing.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2026-02-18T18:56:56+00:00</updated><author><name>Simon Willison</name></author><entry><title>Typing without having to type</title><link href="https://simonwillison.net/2026/Feb/18/typing/#atom-tag" rel="alternate"/><published>2026-02-18T18:56:56+00:00</published><updated>2026-02-18T18:56:56+00:00</updated><id>https://simonwillison.net/2026/Feb/18/typing/#atom-tag</id><summary type="html">
    &lt;p&gt;25+ years into my career as a programmer I think I may &lt;em&gt;finally&lt;/em&gt; be coming around to preferring type hints or even strong typing. I resisted those in the past because they slowed down the rate at which I could iterate on code, especially in the REPL environments that were key to my productivity. But if a coding agent is doing all that &lt;em&gt;typing&lt;/em&gt; for me, the benefits of explicitly defining all of those types are suddenly much more attractive.&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/programming"&gt;programming&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/programming-languages"&gt;programming-languages&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai-assisted-programming"&gt;ai-assisted-programming&lt;/a&gt;&lt;/p&gt;



</summary><category term="programming"/><category term="programming-languages"/><category term="static-typing"/><category term="ai-assisted-programming"/></entry><entry><title>Tests aren’t enough: Case study after adding type hints to urllib3</title><link href="https://simonwillison.net/2021/Oct/18/case-study-after-adding-type-hints-to-urllib3/#atom-tag" rel="alternate"/><published>2021-10-18T19:03:38+00:00</published><updated>2021-10-18T19:03:38+00:00</updated><id>https://simonwillison.net/2021/Oct/18/case-study-after-adding-type-hints-to-urllib3/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://sethmlarson.dev/blog/2021-10-18/tests-arent-enough-case-study-after-adding-types-to-urllib3"&gt;Tests aren’t enough: Case study after adding type hints to urllib3&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Very thorough write-up by Seth Michael Larson describing what it took for the urllib3 Python library to fully embrace mypy and optional typing and what they learned along the way.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mypy"&gt;mypy&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/seth-michael-larson"&gt;seth-michael-larson&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="static-typing"/><category term="mypy"/><category term="seth-michael-larson"/></entry><entry><title>Datasette unit tests: monkeytype_call_traces</title><link href="https://simonwillison.net/2018/Aug/2/datasette-monkeytype/#atom-tag" rel="alternate"/><published>2018-08-02T21:03:27+00:00</published><updated>2018-08-02T21:03:27+00:00</updated><id>https://simonwillison.net/2018/Aug/2/datasette-monkeytype/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://datasette-monkeytype.now.sh/monkeytype-436d0dc/monkeytype_call_traces?_facet=module&amp;amp;_facet=qualname"&gt;Datasette unit tests: monkeytype_call_traces&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Faceted browse against every function call that occurs during the execution of Datasette’s test suite. I used Instagram’s MonkeyType tool to generate this, which can run Python code and generates a SQLite database of all of the traced calls. It’s intended to be used to automatically add mypy annotations to your code, but since it produces a SQLite database as a by-product I’ve started exploring the intermediary format using Datasette. Generating this was as easy as running “monkeytype run `which pytest`” in the Datasette root directory.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/simonw/status/1025081051360583680"&gt;@simonw&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sqlite"&gt;sqlite&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/testing"&gt;testing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/datasette"&gt;datasette&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mypy"&gt;mypy&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="sqlite"/><category term="static-typing"/><category term="testing"/><category term="datasette"/><category term="mypy"/></entry><entry><title>Pyre: Fast Type Checking for Python</title><link href="https://simonwillison.net/2018/May/11/pyre/#atom-tag" rel="alternate"/><published>2018-05-11T17:47:26+00:00</published><updated>2018-05-11T17:47:26+00:00</updated><id>https://simonwillison.net/2018/May/11/pyre/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.facebook.com/notes/protect-the-graph/pyre-fast-type-checking-for-python/2048520695388071/"&gt;Pyre: Fast Type Checking for Python&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Facebook’s alternative to mypy. “Pyre is designed to be highly parallel, optimizing for near-instant responses so that you get immediate feedback, even in a large codebase”. Like their Hack type checker for PHP, Pyre is implemented in OCaml.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=17048446"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/facebook"&gt;facebook&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mypy"&gt;mypy&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ocaml"&gt;ocaml&lt;/a&gt;&lt;/p&gt;



</summary><category term="facebook"/><category term="python"/><category term="static-typing"/><category term="mypy"/><category term="ocaml"/></entry><entry><title>How to Use Static Type Checking in Python 3.6</title><link href="https://simonwillison.net/2018/Apr/19/how-use-static-type-checking-python-36/#atom-tag" rel="alternate"/><published>2018-04-19T18:30:37+00:00</published><updated>2018-04-19T18:30:37+00:00</updated><id>https://simonwillison.net/2018/Apr/19/how-use-static-type-checking-python-36/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://medium.com/@ageitgey/learn-how-to-use-static-type-checking-in-python-3-6-in-10-minutes-12c86d72677b"&gt;How to Use Static Type Checking in Python 3.6&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Useful introduction to optional static typing in Python 3.6, including how to use mypy, PyCharm and the Atom mypy plugin.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://medium.freecodecamp.org/python-collection-of-my-favorite-articles-8469b8455939"&gt;Gergely Szerovay&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mypy"&gt;mypy&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="static-typing"/><category term="mypy"/></entry><entry><title>Let your code type-hint itself: introducing open source MonkeyType</title><link href="https://simonwillison.net/2017/Dec/15/monkeytype/#atom-tag" rel="alternate"/><published>2017-12-15T02:22:30+00:00</published><updated>2017-12-15T02:22:30+00:00</updated><id>https://simonwillison.net/2017/Dec/15/monkeytype/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://engineering.instagram.com/let-your-code-type-hint-itself-introducing-open-source-monkeytype-a855c7284881"&gt;Let your code type-hint itself: introducing open source MonkeyType&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Instagram have open sourced their tool for automatically adding type annotations to your Python 3 code via runtime tracing. By default it logs the types it sees to a SQLite database, which means you can browse them with Datasette!


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python3"&gt;python3&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;&lt;/p&gt;



</summary><category term="python"/><category term="python3"/><category term="static-typing"/></entry><entry><title>Why is Java perceived as not cool for startups? We seem to be getting a lot of feedback lately that a startup should be using Ruby on Rails, PHP, Python, etc., if they want to be agile and iterate quickly.</title><link href="https://simonwillison.net/2010/Nov/14/why-is-java-perceived/#atom-tag" rel="alternate"/><published>2010-11-14T12:21:00+00:00</published><updated>2010-11-14T12:21:00+00:00</updated><id>https://simonwillison.net/2010/Nov/14/why-is-java-perceived/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;em&gt;My answer to &lt;a href="https://www.quora.com/Why-is-Java-perceived-as-not-cool-for-startups-We-seem-to-be-getting-a-lot-of-feedback-lately-that-a-startup-should-be-using-Ruby-on-Rails-PHP-Python-etc-if-they-want-to-be-agile-and-iterate-quickly/answer/Simon-Willison"&gt;Why is Java perceived as not cool for startups? We seem to be getting a lot of feedback lately that a startup should be using Ruby on Rails, PHP, Python, etc., if they want to be agile and iterate quickly.&lt;/a&gt; on Quora&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;I believe what takes the longest time in software engineering is not actually writing the code, but untangling it to find bugs, and Java is much more conducive to that, and the tooling is much stronger than for other languages.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;You should re-evaluate your beliefs. Dynamic language programmers spend a great deal of time thinking about code quality and maintainability. &lt;a href="http://en.wikipedia.org/wiki/Test-driven_development"&gt;TDD&lt;/a&gt; (and &lt;a href="http://en.wikipedia.org/wiki/Behavior-driven_development"&gt;BDD&lt;/a&gt;), which I believe was first popularised within the Ruby community) are extremely widespread, and profiling and debugging tools are widely used and constantly improved. A strong test suite provides far more effective protection against bugs than static typing and an IDE.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/java"&gt;java&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/programming"&gt;programming&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/programming-languages"&gt;programming-languages&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rails"&gt;rails&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/startups"&gt;startups&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/quora"&gt;quora&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/careers"&gt;careers&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="java"/><category term="programming"/><category term="programming-languages"/><category term="rails"/><category term="startups"/><category term="static-typing"/><category term="quora"/><category term="careers"/></entry><entry><title>Quoting Damien Katz</title><link href="https://simonwillison.net/2008/Jun/11/damien/#atom-tag" rel="alternate"/><published>2008-06-11T06:51:21+00:00</published><updated>2008-06-11T06:51:21+00:00</updated><id>https://simonwillison.net/2008/Jun/11/damien/#atom-tag</id><summary type="html">
    &lt;blockquote cite="http://damienkatz.net/2008/06/epiphany.html"&gt;&lt;p&gt;Static typing in OO languages isn't the solution to software complexity, rather it's an enabler of it. Static typing is like giving a drunk a bunch of breath mints and saying "Don't drive drunk. But if you must, use these breath mints in case you get pulled over."&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="http://damienkatz.net/2008/06/epiphany.html"&gt;Damien Katz&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/complexity"&gt;complexity&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/damien-katz"&gt;damien-katz&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;&lt;/p&gt;



</summary><category term="complexity"/><category term="damien-katz"/><category term="static-typing"/></entry><entry><title>Size Is The Enemy</title><link href="https://simonwillison.net/2007/Dec/24/coding/#atom-tag" rel="alternate"/><published>2007-12-24T10:50:53+00:00</published><updated>2007-12-24T10:50:53+00:00</updated><id>https://simonwillison.net/2007/Dec/24/coding/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.codinghorror.com/blog/archives/001025.html"&gt;Size Is The Enemy&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Jeff Atwood: “I’ve started a cottage industry mining Steve [Yegge]’s insanely great but I-hope-you-have-an-hour-to-kill writing and condensing it into its shorter form points.” Lots of verbose static typing apologists in the comments.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/dynamic-languages"&gt;dynamic-languages&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/java"&gt;java&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/jeff-atwood"&gt;jeff-atwood&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/steve-yegge"&gt;steve-yegge&lt;/a&gt;&lt;/p&gt;



</summary><category term="dynamic-languages"/><category term="java"/><category term="jeff-atwood"/><category term="python"/><category term="static-typing"/><category term="steve-yegge"/></entry><entry><title>The Fishbowl: Type Inference and Java</title><link href="https://simonwillison.net/2004/May/18/fishbowl/#atom-tag" rel="alternate"/><published>2004-05-18T05:45:18+00:00</published><updated>2004-05-18T05:45:18+00:00</updated><id>https://simonwillison.net/2004/May/18/fishbowl/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://fishbowl.pastiche.org/2004/05/18/type_inference_and_java"&gt;The Fishbowl: Type Inference and Java&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Why Java’s implementation of static typing is stupid.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/java"&gt;java&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;&lt;/p&gt;



</summary><category term="java"/><category term="static-typing"/></entry><entry><title>ML Types Explained</title><link href="https://simonwillison.net/2003/Aug/27/ml/#atom-tag" rel="alternate"/><published>2003-08-27T07:16:35+00:00</published><updated>2003-08-27T07:16:35+00:00</updated><id>https://simonwillison.net/2003/Aug/27/ml/#atom-tag</id><summary type="html">
    &lt;p&gt;From a link on the mailing list edition of comp.lang.python, &lt;a href="http://perl.plover.com/yak/typing/notes.html" title="Strong Typing"&gt;this talk on strong typing&lt;/a&gt; (in the form of heavily annotated slides) is an explanation of the &lt;acronym title="Meta Language"&gt;ML&lt;/acronym&gt; type system and why it really doesn't suck. From the same thread, &lt;a href="http://felix.sourceforge.net/"&gt;Felix&lt;/a&gt; is a new high level C++ style language with an &lt;acronym title="Meta Language"&gt;ML&lt;/acronym&gt; style type system which looks like it could be worth experimenting with.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="static-typing"/></entry><entry><title>Strong Typing vs Strong Testing</title><link href="https://simonwillison.net/2003/May/4/strongTesting/#atom-tag" rel="alternate"/><published>2003-05-04T20:32:56+00:00</published><updated>2003-05-04T20:32:56+00:00</updated><id>https://simonwillison.net/2003/May/4/strongTesting/#atom-tag</id><summary type="html">
    &lt;p&gt;In &lt;a href="http://mindview.net/WebLog/log-0025"&gt;Strong Typing vs. Strong Testing&lt;/a&gt;, Bruce Eckel reconsiders the old idea that languages without strong typing can't be relied on to create large programs:&lt;/p&gt;

&lt;blockquote cite="http://mindview.net/WebLog/log-0025"&gt;&lt;p&gt;This became a puzzle to me: if strong static type checking is so important, why are people able to build big, complex Python programs (with much shorter time and effort than the strong static counterparts) without the disaster that I was so sure would ensue?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;His conclusion is that type checking by the compiler does not garauntee the correctness of a program in the first place; it's just another test. Comprehensive unit testing can more than compensate for the lack of type checking in languages such as Python, especially since the huge productivity bonus provided by Python allows more tests to be written starting at an earlier stage in development.&lt;/p&gt;

&lt;p&gt;Incidentally, Bruce recently &lt;a href="http://mindview.net/WebLog/log-0022" title="RSS Feed up"&gt;added an RSS feed&lt;/a&gt;.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/dynamic-languages"&gt;dynamic-languages&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/bruce-eckel"&gt;bruce-eckel&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="dynamic-languages"/><category term="python"/><category term="static-typing"/><category term="bruce-eckel"/></entry></feed>