4 ms·
Of these 3, at least 2 would depend on the language in use: "We used a combination of lexical features (e.g., variable name choices), layout features (e.g., sp
by lisa_henderson 12y ago
Of these 3, at least 2 would depend on the language in use:
"We used a combination of lexical features (e.g., variable name choices), layout features (e.g., spacing), and syntactic features (i.e., grammatical structure of source code)"
In particular, "layout features" is a huge issue in some languages, and not at all in others. For instance, a language like Javascript, or PHP, give great flexibility about layout, so in those languages I can see each developer having a unique style (and I have been involved in style debates regarding those languages), however, a language like Python has a fairly fixed layout, since the whitespace is significant. And also, in Clojure, I think most programmers use Emacs and accept the Emacs clojure-mode indenting as the default.
Variable name choices is another where some environments encourage similarity, and others allow for unpredictability and unique styles. Within the Ruby On Rails framework, for instance, there are norms about the creation of variable names.
I would guess that syntactic features is perhaps the one characteristic that shows a great deal of uniqueness in every language. I am often surprised at the choices my fellow co-workers make, when it comes to how to solve a problem.
- TheLoneWolfling 12y agoPython does not have anywhere near a fixed layout. Off the top of my head: * When / if single-line if / while / etc statements are used * How many blank lines are used between functions * How often blank lines are used in functions * How much indentation is used for initializing lists / etc. * If multiline strings are used. Etc. Some of these are covered by PEPs, yes, but enough people don't follow PEPs religiously that even those offer some information.