4 ms·
> You definitely need to be smart to write the code the way Norvig does, but it takes a certain skill to write code that other people can understand Just as fu
by kragen 6y ago
> You definitely need to be smart to write the code the way Norvig does, but it takes a certain skill to write code that other people can understand
Just as functionality is relative to a purpose, readability is relative to an audience; Edmund Spenser is difficult for most of us to read today, and Dan Brown is incomprehensible if you speak only Chinese. The code of Norvig's that I've read (if we include the comments) is very readable to me, but I'm not a senior in college. (Without the comments I think I would have a terrible time.)
If I'm writing code with people like Norvig as an audience, I'll write it differently than if my audience consists of relative novices.
- peterashford 6y agowhich means if you're working with other people in a business, a whole class of programmers won't be able to work well with your code. I think this makes the OP's point for them
- kragen 6y agoYes, that's always the case. Whenever you're writing, your writing is more accessible to some audiences than to others, according to how familiar the vocabulary and conceptual framework you're using are to them. So it's important to know what audience you're writing for so you can tailor your style to be maximally accessible to them. It's tempting to think that you can organize kinds of writing on a one-dimensional continuum of levels from "more recondite" to "less recondite", with people being able to read anything at or (more easily) below their level, but it's totally false. Yesterday I went to check out some power usage statistics in the datasheet for a microcontroller I wanted to use for a project. To my dismay, it said, and I quote, "电流消耗是多种参数和因素的综合指标,这些参数和因素包括工作电压、环境温度、I/O引脚的负载、产品的软件配置、工作频率、I/O 脚的翻转速率、程序在存储器中的位置以及执行的代码等。" I mean, that's surely understandable to many more people than what I'm writing here. But I'm not one of them. (Fortunately, in this case the data tables mostly answered my questions.)