TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: I am looking for academic studies about computer program readability?

3 pointsby ldbabout 6 years ago
I wonder if there are any scientific studies that indicate whether the human brain is better suited to perceive a formula written as e.g. (1) "a * (b + c)", vs. (2) "mult(a, plus(b, c))", vs. (3) "(mult a (plus b c))".

1 comment

RNeffabout 6 years ago
FORTRAN was short for FORmula TRANslator. Its design goal was programmers would write normal math statements. This was copied by many other languages. Then languages started using the math symbols for other things. C++ allows programmers to define the math symbols to other types. Java and others use &#x27;+&#x27; for string concatenate.<p>The problem occurs when: 1. the function has more than two arguments; 2. the function is semantically different from the meaning implicit in a math symbol.<p>One solution is use the same syntax for all functions. In Lisp, every thing is a list, so ( function ( parameters )). In Smalltalk, every thing is an object, so send a message to an object with parameters.<p>Read the Lisp manual, and the SmallTalk-80 book about the language design theory.<p>The big boost in program readability is following a style guide with the rules for naming, indentation, commenting, and other important features, plus automated or manual style reviews.<p>The Hungarian notation for variables was an attempt to document the type of a variable in a language, &#x27;C&#x27;, which had loose typing rules.
评论 #19962522 未加载