Skip to content

Comment on Go: a nice language with an annoying personalityparent

Comments

> It's documentation - that can be checked by the compiler for correctness.

Exactly. This was a convention used by Smalltalk shops. It came about because of the appearance of the Refactoring Browser, which caused a 10X increase in the rate and ease of refactoring. Before, Smalltalkers used to put snippets of code in comments with the exhortation to "run this" or "debug this" to clarify how a certain part of the API worked. The problem arose that refactorings would often break those snippets. However,

    false ifTrue: 
        ["Debug this"
        myObj := MyClass new.
        myObj myWonderfulMethod.].
...was very fast (it was a jump on many VMs) and would never break even if refactorings hit it.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.