A-Rod Should be Ashamed

Clearly the umpires made the right call.

Cheaters never win and winners never cheat.

A-Rod, I expected more from you.

I’m sitting here at 11:29pm watching the [[Red Sox]] beating the [[Yankees]] in game 6 of the [[2004 ALCS]]. Jeter makes a clutch hit to drive in a run with one out to make the score 4-2. Suddenly, A-Rod hits a little squib shot down the first base line and while tagging him out, Bronson Arroyo drops the ball. Yikes… here we go again.

Then we get to see the replay. Alex took an illegal swipe at Bronson’s glove to knock the ball out.

First off, why would you cheat like that Alex? I lost a lot of respect for you at that moment. Also, you have a lot of gaul to act surprised like that.

Kudos to the umpires for getting the call right!

C++ Coding Standard

The C++ coding standards were developed to insure consistency throughout our C++ source code. It is the intention of these standards to provide necessary source code consistency, while not being overly restrictive. The standards are conveyed as a set of general rules and source code examples. The standards, as supplied, do not comprise a definitive list. They do however, provide general guidelines to coding style.

##File Layout
###Standard File Header
All C++ source files shall contain the following comment at the top of the file:

//====================================
// Instrumentation Laboratory
// Copyright (C) 2002. All Rights Reserved.
//
// SUBSYSTEM:
// FILE:
//
// DESCRIPTION:
//
//
//====================================

###Header Files

Header files should always be bracketed by #ifdef, #define, and #endif to ensure that if they are never included more than once.

// Above header comment
# ifndef **_HPP
# define **_HPP

# endif

###Commenting Code
####Interface Documentation

Typically, header files (either .h or .hpp) contain the interface spec for a piece of functionality, whether it is a class, a collection of functions, or a set of global variable extern declarations. The purpose of this file is to describe to the user of this functionality how to use it.

Each class should have a descriptive comment describing what the class is used for. Each function/member function should have a comment describing its functionality and its interface.

Publicly accessible functionality (whether global functions, public member functions or protected member functions) requires the most complete descriptions in the header file. Private, implementation oriented comments should be put in the implementation file (typically a .c or .cpp file).

####Strategic Comments

Strategic comments are used to describe the intended functionality of a block of code, not to describe what the code does (see below). These are meant to help a code maintainer understand the purpose of the code, not the implementation details.

####Tactical Comments

Tactical comments describe what individual pieces of code do. They are especially useful in complicated pieces of code. These are meant to help a code maintainer understand the implementation details of the code.

##Coding Conventions

The purpose of coding conventions is the make code from different developers have a similar appearance making it easier to understand the code. It is not intended to make the code look perfect, as there is no such thing.

* Never use tabs in code. Always use spaces.
* Standard indentation level is 3 spaces
* All control structures shall be indented on level deeper than the level containing them.
* All braces should be on lines by themselves indented to the same level as the block that contains them.
* Complex expressions should be fully parenthesized.
* Line breaks in complex expressions should be before an operator
* Class member names (either functions or variables) should begin with “m_”
* Global variable names should begin with “g_”
* The first letter of the name of a variable of a simple type (not including the above prefix) should be a letter indicating the basic type:
**** “i” for integer types
**** “f” for floating point types
**** “b” for Boolean
**** “e” for enumeration
**** “c” for character

###General Rules
####Prefer Includes in .cpp files

The more that header files include other header files, the more dependencies are created that are not needed. As much as possible, header files should only include other header files that are necessary for the interface being defined.

####Avoid #define
The #define provides no type safety and no scoping.

* Prefer inline functions to macros
* Prefer static const to defined constants
* Prefer enumerations
* Prefer templates
* Use #define only for conditional compilation

####Scoping

Variables should be scoped as tightly as possible. The rationale is that it is trivial to increase the scope of a variable if needed, but reducing the scope can be next to impossible (i.e. the genie is out of the bottle).

####Use const as much as possible

Similar to scoping, taking away constness is trivial, but adding it later is next to impossible. This is especially important with the use of reference variables.

####Prefer exceptions to assert

Assert is non-recoverable. On failure it exits the process. Therefore:

* If the assert is not encountered during testing, the only thing that is known is that the error condition didn’t happen during testing. We don’t know if it will never happen.
* Since we don’t know that it will never happen, we need to write code to properly recover from that error condition.
* Therefore, throw a c++ exception rather than using an assert.

####Always provide a bool expression in control statements

The fact that any non-zero expression results in a true value in control statements should not be depended on.

####When comparing a variable against a constant, the constant shall be to the left of the comparison operator.

This helps ensure that the variable isn’t accidentally assigned to during the comparison by leaving out one of the ‘=’.

####All subsystems should be enclosed in namespaces of the same name.

By enclosing subsystems in namespaces, the use of third party products is easier since the chance of name clashes is greatly reduced.

####Prefer dynamic*cast and static*cast to C-style Casting

C++ provides type-safe casting as part of the language. A c-style cast breaks type safety and makes it more difficult to write robust code

####Prefer descriptive variable names to short names

The more descriptive a variable name is, the easier maintenance is later. This does not mean that variable names should be made artificially long, but rather however long they end up being they should be very descriptive of their intended use.

##C++ Classes
###Prefer STL

STL (The Standard Template Library) is a collection of proven C++ classes that provide functionality for many common programming techniques, for instance stacks, queues, maps, vectors, etc. These are well debugged, well documented classes and should be used instead of re-implementing their functionality.

A good reference for STL can be found at: http://www.cppreference.com/cpp_stl.html
Class Specific Coding Rules

* All classes shall be declared in header files of the same base name
* All classes shall be implemented in source files of the same base name
* Always provide an initialization for every member variable in a constructor
* The C++ language specification specifies that the order of construction of member variables is in the order they are declared, not in the order specified in the constructor. Therefore, in order to avoid invalid implications, the order that the member variables are listed in the constructors should be in the order declared in the class. This is a visual reminder as to the actual construction order which is always the order declared in the class.
* Construct each member on a line by itself. This makes it easier to find.
* Always call a constructor for a base class.
* Avoid multiple inheritance.
* Avoid the use of friends as much as possible. It breaks encapsulation.

####Class Organization

The purpose of a class definition is two-fold

* The first is to tell the compiler information about the class
* The second, and more important from a developers perspective, is to tell a user of the class everything needed in order to use the class. In this sense, it is to be considered a document which describes the usage of the class.
Given that, the class should be organized with this in mind.

###Interface

* The entire public interface should be defined first. This is the code that any usage of the class requires
* The protected interface is second. This is the code that a derived class implementation needs to understand
* The private interface is third. This is only relevant to the implementation of the class.

###Scoping

In order to preserve as much encapsulation as possible, the scoping in classes should be as tight as possible.

* Every member (either function or variable) should be private unless it is needed by derived classes or public users.
* If not private, every member should be protected, unless it is needed by a public user
* Anything needed by a public user.

###Constructors and Destructors

####Always declare default constructors and assignment operators

C++ provides default implementations for the default construct, the copy constructor, and the assignment operator if not declared in the class specification. These default implementations are wrong most of the time. By providing at least a declaration of these, it prevents the automatic creation of them by the compiler.
If the class has no use for any of these, the declarations should still be made in the private interface, and no implementation needs to be provided. This will catch at compile time any external reference to these, and at link time any reference in the class.

####All destructors should be virtual

Vanila Markup Language

You don’t need anything fancy to produce beautiful documents in Vanila.

##Text markup

Test surrounded by:
** ***: rendered as bold.
* ”: rendered as italic
* **: rendered as underlined

***’This””” ”is” ””a”” ””””””test”””’***.

is rendered as:

***’This””” ”is” ””a”” ””””””test”””’***.

##Block Quotes

Consecutive lines beginning with whitespace are grouped together as a blockquote.

This is a

blockquote

Note that the blank lines above have

blank whitespace so that they end up

inside the blockquote.

Renders as:

This is a

blockquote

Note that the blank lines above

have blank whitespace so that they end up

inside the blockquote.

##Headines

Headlines are used to divide a document into sections. Headlines in Vanila are defined by beginning lines with 3 or more asteriks. the more asteriks, the higher the level of headling.

###Examples

##Level 1
###Level 2
####Level 3
####Level 4

Renders as:
##Level 1
###Level 2
####Level 3
####Level 4

##Lists

* Bulleted lists are specified by a group of lines beginning with ‘-‘
* Number lists are specified by a group of lines beginning with ‘#’
* Definition lists are specified by a group of lines beginning with ‘?’. A ‘:’ separates the term from the definition.
* Lists are nested by indenting the ‘-‘ or ‘#’ by multiples of 2 spaces (once for each nest level).

###Examples
####Bulleted List

* This
* Is
* A
* List

Renders as:
* This
* Is
* A
* List

####Ordered List

# One
# Two
# Three
# Four

Renders as:
# One
# Two
# Three
# Four

####Definition List

? One : Definition of One
? Two : Definition of Two

Renders as:
? One : Definition of One
? Two : Definition of Two

####Mixing and Matching

* Bullet 1
* Bullet 2
# number 1
# number 2
? One : Definition of One
? Two : Definition of Two
# number 3
* Bullet 3

Renders as:
* Bullet 1
* Bullet 2
# number 1
# number 2
? One : Definition of One
? Two : Definition of Two
# number 3
* Bullet 3

##Tables

Tables are described by lines starting with ‘|’. Each ‘|’ represents the beginning of a new cell in the table. Optionally, immediately after the ‘|’:
** **h* means that the cell is a header
** **c followed by a number* means that the cell spans that many columns
** **r followed by a number* means that the cellspans that many rows

Leading and trailing spaces in each of the cells is ignored, so that you can use this space to help align the columns visually in the text.

###Example

|h This |hc3 Is
|r2 A | Test of | the |r2 Emergency
| Broadcast | System

Renders as:
|h This |hc3 Is
|r2 A | Test of | the |r2 Emergency
| Broadcast | System

##Cross References

* Enclose text in quotation marks
* Enclose text in double [ brackets

###Example

[[Vanila Markup Language]] is a cross reference to [[Vanila Markup Language]],
and [[Example Forward Reference]] makes a link to an undefined page.

Renders as:

[[Vanila Markup Language]] is a cross reference to [[Vanila Markup Language]], and [[Example Forward Reference]] makes a link to an undefined page (please don’t define this page so that the above reference makes sense). Note that if you are not logged in as a member, the forward cross reference example will appear as plain text.

###Special Cross References

Certain document types have special cross reference handling. Using the above syntax with a reference to a Picture document includes the picture in the page. A cross reference to a Shortcut inserts a reference to the URL specified in the shortcut.

For instance, typing:

[[Apple]] [[mac]]

Inserts:

[[Apple]] [[mac]]

##Horizontal Lines

Horizontal lines are made a line of three ‘-‘ by themselves.

###Example

This is a horizontal rule
*–

Renders as:

This is a horizontal rule
*–

##Verbatim text
Text that is surrounded by:

Why Not a Real Debate?

The candidates from the Libertarian and Green parties were arrested while trying to get into the presidential debate last night.

The first report from St. Louis is in – and presidential candidates Michael Badnarik (Libertarian) and David Cobb (Green Party) were just arrested. Badnarik was carrying an [order to show cause](http://thelfactor.org/arizona*state*lawsuit.html

)

which he intended to serve the Commission on Presidential Debates (CPD). Earlier today, Libertarians attempted to serve these same papers at the Washington, D.C. headquarters of the CPD – but were stopped from approaching the CPD office by security guards.

Exactly… how can it possibly be a valid debate when a candidate that is on [nearly every states’ ballot](http://badnarik.org/ballotaccess.php) isn’t allowed to participate?

This is why we as citizens never have any choice except what the Republicrats wish us to have. That’s not very democratic.

What Has Been Accomplished in Iraq

This is what the mainstream press hasn’t told you about what we’ve accomplished in Iraq since the end of major combat operations was declared.

* The first battalion of the new Iraqi Army has graduated and is on active duty (~60,000 Iraqis providing security to citizens).
* Nearly all of Iraq’s 400 courts are functioning.
* The Iraqi judiciary is fully independent.
* Power generation hit 4,518 megawatts (Oct), exceeding prewar output.
* All 22 Universities &43 technical institutes/colleges are open
* Nearly all primary and secondary schools are open.
* Coalition has “rehabbed” 1,500+ schools (500 ahead of schedule).
* Teachers earn from 12-25 times their former salaries.
* All 240 hospitals and more than 1200 clinics are open.
* Doctors salaries are at least 8 times what they were under Saddam.

And this list goes on. But you’d never know any of this if you just read the [[New York Times]] or the [[Boston Globe]].

We Need Straight Talkers

The one thing that struck me with the debate the other night is that neither candidate was willing to just speak the plain truth.

Once upon a time in America, there were public figures like Barry Goldwater. He was a rock-ribbed conservative Republican. I disagreed with almost all of his political positions and could never have voted for him.


Above all his other qualities, I miss Goldwater’s extraordinary penchant for straight talk. He was one of those old-fashioned Americans who absolutely believed that our freedoms of speech were there to be used. He understood that clear, declarative sentences, unencumbered by evasive qualifiers and legalese, were the sinewy muscles of our democracy, and like muscles, they grew flabby and weak if they were not used. In his long career (five terms in the U.S. Senate), Goldwater always said what he believed. He didn’t submit to the slippery guidance of media consultants, who have turned so many of today’s politicians into ciphers. He went forth and spoke his mind, even when his blunt opposition to the prevailing New Deal orthodoxies brought forth mockery.


That is why we must cherish those people who have the guts to speak the truth: mavericks, whistle-blowers, disturbers of the public peace. And it’s why, in spite of my own continuing (though chastened) liberal faith, I miss Barry Goldwater. More than ever.

I’d vote for any candidate that avoided equivocations with every phrase uttered. Where are they?