The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Is Your Code Acceptable?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jeremy Voorhis

Posts: 212
Nickname: jvoorhis
Registered: Oct, 2005

Jeremy Voorhis is a Rubyist in northeast Ohio.
Is Your Code Acceptable? Posted: May 3, 2006 12:05 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jeremy Voorhis.
Original Post: Is Your Code Acceptable?
Feed Title: JVoorhis
Feed URL: http://feeds.feedburner.com/jvoorhis
Feed Description: JVoorhis is a Rubyist in northeast Ohio. He rambles about Ruby on Rails, development practices, other frameworks such as Django, and on other days he is just full of snark.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jeremy Voorhis
Latest Posts From JVoorhis

Advertisement

In his book, Aspects of the Theory of Syntax, Noam Chomsky insists that we make a distinction between language competence and performance. Competence refers to one’s knowledge of a language, while performance refers to one’s ability to practice that language. When discussing language performance, Chomsky introduces the term acceptability. In Chomsky’s words, utterances are acceptable when they are “perfectly natural and immediately comprehensible without paper-and-pencil analysis, and in no way bizarre or outlandish.” Chomsky goes on to describe some structural heuristics for acceptability of the written word. Some things that contribute to the decay of acceptability are repeated nesting of an element, self-embedding of an element and nesting of a long and complex element.

He goes on to suggest that these patterns limit acceptability because they work against the finiteness and decay of human memory. He may not have had programming languages in mind while he wrote this passage, but the same limitations when communicating in English stand when communicating in Ruby or some other programming language.

Simply put, if you are writing software “for a human first and a computer second1”, keep your statements concise and refrain from gratuitous nesting and run-on statements when possible. The interpreter may find your code very acceptable, but you also have a human audience which includes yourself. Look back on some code you have written two weeks ago and ask yourself – is it acceptable?

1 Refactoring, Martin Fowler

Read: Is Your Code Acceptable?

Topic: TupleSpace Replicator Previous Topic   Next Topic Topic: Jeremy signs a book deal

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use