|
|
|
|
|
by mike_hock
942 days ago
|
|
Are we reading the same article? There is zero concern for syntax. The first point is literally what you said. Write functions with clear interfaces. If your function doesn't handle None, make its argument type reflect that (Walrus instead of Option<Walrus>). The second point is about performance. Hoist branches out of loops, and process batches so any constant cost is amortized over the batch. Is that even controversial? > the author makes an effort to give their functions names such as "frobnicate" Yes, and that's good, because it keeps the focus on his actual points rather than the minutiae of a contrived example. |
|
By "syntactical" I mean "concerned with the surface level appearance of low-level code structure".
> Yes, and that's good, because it keeps the focus on his actual points rather than the minutiae of a contrived example.
Only if you think that guidelines about how to write code should be devoid of the context of the problem you're trying to solve. I happen to think that this is mostly wrong.