3 ms·
Almost every time foo/bar/etc used I think there are better alternatives. For example, when I see syntax explained like this if (foo) { bar; baz; } I would
by songshu 12y ago
Almost every time foo/bar/etc used I think there are better alternatives. For example, when I see syntax explained like this
if (foo) { bar; baz; }
I would always prefer something like this
if (someCondition) { /* statements */ }
I like it even less when people use them completely outside metasyntactic contexts, for example saying "company foo can sue" rather "BigCorp Inc can sue". In both cases the reader has to think about what foo stands for.
- peterwwillis 12y agoIs your point that we should have more informative pseudocode or that readers should not have to think?
- songshu 12y agoWe should have more informative example code. Readers should only have to think about the idea being explained, rather than -- for example -- pondering why the writer chose to use "foo" for a condition and "bar" for a statement.
- coldpie 12y agoI completely agree. I find concrete examples far easier to understand than random sequences of characters. Take some time to come up with a toy situation in which I would want to use your code, and use the nouns and verbs appropriate for that situation. It's much easier to translate concepts from a concrete example to my own situation than to try to figure out how "Foo" maps into my problem.