Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET 4.5
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Amazon Web Services
Analysis Services
Android
Architecture
Arduino
ASP .NET Web API
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
BDD
Big Data
Bing
BizTalk
Book Excerpts
Build and Deploy
Business Intelligence
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE Framework Info - non Technical
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Debugger
Design Patterns
Development Process
Display Technologies
Distributed Computing
Document Database
DotNetNuke
DSL
Dynamic Languages
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
HTML 5
Internet Explorer 8.0
Interviews
IOS
iPhone
Iron Ruby
Java
Java Script
JavaScript
jQuery
JSON
Lightswitch
LINQ
Linux
LUA
Mac OS X
MDX
Messaging
Metro
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
MVVM
MySQL
Network
NHibernate
node.js
NOSQL
Nuget
Object Oriented Development
Objective C
Odata
OLAP
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
PHP
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Prolog
Python
Q&A
Rails
Rake
Razor
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Scheme
Search
Security
Services
SharePoint
SignalR
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server 2012
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
TFS
Tips
TypeScript
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 11
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio 2011
Visual Studio 2012
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WebMatrix
WF
Whitepapers
Windows 7
Windows 8
Windows Azure
Windows Live
Windows Phone 7
Windows Phone SDK
Windows Server
Windows Vista
WinForms
WinRT
Workflow
WPF
XAML
Xiine Documentation
XML
XNA
XSLT



LearnNow


XAMALOT
 


SSWUG

Reader rating:
Click here to read 1 comment about this article.
Article source: CoDe (2010 Jul/Aug)

Managed Coder: Yes or No (But Maybe…)


Ted Neward

Let’s take an easy question for a moment: what do you call a man with no hair on his head? Bald. (You were expecting a punchline, weren’t you? Admit it.)

Baldness, for all of its negative qualities involving aging and the diminishing of the male ego, intrinsically is a pretty simple concept: when a man (or a woman, though a far less common case) loses the hair on their head, they are considered to be bald, and there’s not much to it.

So exactly when does a head become bald? If I pluck a single hair out of my head, does that make me bald? Most would say no. If I pluck a second hair, then a third, and then a fourth? Still no. In fact, I can probably pluck hundreds of my hair off my head, and still not be considered bald. After all, on the typical human head, hundreds of thousands of strands of hair sprout and rest (and in my case, generally form an unruly mass that defies most sorts of organization other than the ponytail or the crew-cut).

But at some point, if I continue to pluck hairs from my head, some kind of interesting threshold is crossed, and suddenly one day my youngest son looks up at me and says, “Daddy, you don’t have any more hair on your head!” I’m bald. Or I’m said to have a receding hairline. Or I have a bald spot. Or…

Suddenly, what was once a binary quantity, isn’t.

The Sorites Paradox

In philosophy, the above is given the name “Sorites paradox”, the idea that there is some kind of unmeasurable threshold in a continuum that suddenly transforms an entity from one condition into another condition-in other words, we can point to men who are bald, and men who are not, but we can’t really precisely define how many hairs have to be lost before the man can be called bald, or even what percentage of hair must be lost before a man is bald, and so on.

This paradox isn’t quite as ridiculous to contemplate as you might think-consider the canonical human resources system, which sometimes wants to capture employee racial information (purely voluntarily, of course) for purposes of identifying the company as a “minority-owned” or “minority-operated” firm, for purposes of PR, insurance, or state or federal government categorical qualifications. The US Census also likes to voluntarily track racial breakdowns, as a means of identifying trends within the population and so forth.

And here again we run into the paradox: if you’ll pardon the (perhaps) crude way of putting this, how “black” do you have to be, in order to be “black”? If one of your parents was white, are you still “black”? If one of your grandparents was black, and the rest white/Caucasian, are you still “black”? What if one of your great-grandparents was Asian in an otherwise entirely European lineage? Can you still claim to be Asian? My own grandfather came over from Poland when he was a small child, and his racial legacy is the strongest I can claim, since the rest of my grandparents being best described as “European mutt”. Does that make me Polish?

Leaving the politics of race alone for a moment, this presents quite a distressingly difficult problem to the system modeler, because somehow, we have to capture this unquantifiable in a quantifiable manner. And we have to use ones and zeroes to do it.

The Fallacy of the Binary

In programming, we make decisions based on binary logic-the “if/else” construct stands at the heart of almost all decision-making capabilities in every programming language we use. Even for more complex constructs like the switch/case construct in C#, the try/catch/finally exception-handling we see in any .NET language, or even the “On Error Gosub” from way back in the very old Visual Basic days, all of them fundamentally have some kind of if/else construct at the heart-if an exception is thrown, jump to this location and start a series of if/else tests: if the exception is of this type, else if the exception is of this other type, else if the exception is of this third type….

This love of the binary carries over into the constructs we build, too. Consider the user-interface constructs we use: the ubiquitous check box and its cousin, the radio button, both indicate binary selections-either the checkbox is “selected” or it’s “not”. The radio button is almost always collected into a group of other choices, only one of which is “on”, the rest by design being “off”.

(Does anybody remember the 3-way checkbox from back in the Windows 3.0/3.1 days? A checkbox could be either “checked” with an X in the box, “unchecked” where the box was empty, and the third state, “indeterminate”, which was just shaded gray in the box? Anybody ever find a good use for it?)

Few things in life are actually binary, yet we as developers and architects often force-fit them to be that way. Consider the notion of gender: you’re either male or female, right? All issues and discussions of sexual preference and gender identity aside, physically, a human being is either one or the other, labeled according to the body’s plumbing. Despite the apparently obvious binary modeling situation here, nature has a different story to tell. Some people are born with a genetic condition that renders them, chromosomally, equally male and female at birth. And fetuses which haven’t reached a particular stage of development aren’t really either gender (yet). And in some systems (such as software to help track bodies at the coroner’s office, where a former neighbor of mine works), gender simply can’t be determined right away.

Or consider the notion of “transactionally guaranteed”. For years, if not decades, software developers have been holding up the notion of your bank account as a transactional system, pointing out that “when you transfer money from one account to another, there’d better not be any money lost-it either all goes through, or it doesn’t”. And yet, this isn’t really true in real life, either. As the NoSQL movement likes to call it, bank accounting is more on the order of “eventually correct”, meaning that given enough time, all the credits and debits line up correctly. Eventually.

After all, if bank accounts were transactionally accurate, then as soon as I wrote a check the balance online would reflect the new balance. Or, for those who care to discount the analog mechanism as anachronistic, when I deposit a check, regardless of amount, the funds would be available immediately for use, rather than tied up in a 5-day hold to verify the funds’ source.

Sorites moves in strange and mysterious ways.

The lesson for the software developer? Next time you start reaching for an either/or situation, stop to consider the “other”. Consider giving up the “if/else” and replacing it with “switch”, just to make sure you open yourself up to the possibility.

(For those interested in a light introduction to the paradox, I highly recommend the book 50 Philosophy Ideas You Really Should Know (Ideas You Really Need to Know) by Ben Dupre.)


How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
3.3 out of 5

3 people have rated this article.

Instantly Search Terabytes Of Text
“Lightning Fast”
– Redmond Mag
“Covers all data
sources” – eWeek
25+ fielded & full-text search options
dtSearch’s own document filters highlight hits in popular file types
Web Spider supports static & dynamic data
APIs for .NET, Java, C++, SQL, etc.
Win / Linux (64-bit & 32-bit)
www.dtSearch.com
 

      AppsWorld Europe

 

SSWUG