PherricOxide/test — Issue #48: Eliminate global variables wherever possible
Author: PherricOxide
Created: 2012-02-08 18:22:36+00:00
State: open

Our files such as ClassificationEngine have a huge number of global variables in them. This is a bad thing for any program, but especially one which is multithreaded like ours.

There seem to be a couple of different cases:

A) Unused variables. Some variables are declared and then never used. Or maybe they're set with a value but never read. These ones just need to be deleted.

B) Unneseccary globals. There are some vars like u_char GUIData[MAX_MSG_SIZE] which don't need to be global. It's a buffer of data used by a function, and should be declared by and passed around in that function.

C) Groups of valid globals. These need to be moved together into some kind of structure so that they can be logically grouped. Like a "KNN_Config" class that holds all the constants and loaded values for KNN. (IE: k, eps, maxPts, classificationThreshold, etc..)