Coding For a Living

rss

A place to share and comment about coding for a living.


vRAD Well Known Names– Part 3 Mike McIntyre

In my two previous vRAD posts I explained the concept of well known names and introduced ‘PostalCode’, a well known name I have used for application development since 1992.

  Coding For a Living xRAD Well Known Names– Part 1
  Coding For a Living vRAD Well Known Names– Part 2

At the end of my last xRAD post I asked: Can you think of at least three more ways the well known word PostalCode helps us build applications rapidly?

Here are a few of many correct answers:

  1. Reduces code review time. PostalCode classes and class members which encapsulate data and behavior, were last changed in 2004.
  2. Reduces testing time; PostalCode classes and class members which encapsulate data and behavior, were last tested in 2004.
  3. Avoids elusive names that are open to subjective interpretation.
  4. Promotes self-documenting code and reduces code comments.
  5. Provides a common name across the tiers of a multi-tier application.
  6. Makes it possible to document legacy systems faster.

 

In three posts I have explained the concept of well known names and how a single well known name can speed up application development by promoting re use over new development.image

Since 1992 we have developed 1513 well known names. Examples are:  PhoneNumber, EmailAddress, City, State, Country, Customer, FirstName, LastName, Contact, Url, Product, UnitOfMeasure.

Our well known names are used in schema scripts for databases, in models, in code, generators, in documentation, and much more.  We have code snippets for every well known name.

When we start a new project an average of 88% of the names we need come from our well known names.

In future posts I will explain how the ‘well known’ concept applies to other things used for application development; things like ‘well known tables’, well known methods, well known constants, and more.


Visual Studio 2012– JavaScript Strict Mode Mike McIntyre

Visual Studio 2012’s JavaScript Strict Mode provides better error checking.

Strict Mode

Strict mode is a way to introduce better error-checking into your code. When you use strict mode, you cannot, for example, use implicitly declared variables, or assign a value to a read-only property, or add a property to an object that is not extensible.

For example, in the following example all the code is in strict mode, and the variable declaration outside the function causes the syntax error "Variable undefined in strict mode."

"use strict"; function testFunction(){ var testvar = 4; return testvar; } testvar = 5;
"use strict"; function testFunction(){ var testvar = 4; return testvar; } testvar = 5;