Click here to Skip to main content
15,867,308 members
Articles
Article
(untagged)

Db - The Future Is Coming

Rate me:
Please Sign up or sign in to vote.
4.49/5 (99 votes)
31 Mar 20067 min read 168.7K   20   51
Where Will You Be?

Db - The Future Is Coming

Download Full Demonstration Application - 1 byte
Download Full Documentation And Examples - 4.01 Terabytes

Introduction

This article describes the next generation object oriented programming language, called Db (pronounced D-flat), which is a minor but key improvement to the C# (pronounced C-sharp) language.  I'm not going to cover all of Db's improvements, just a few to get you started thinking about what's down the road.

Classes

First off, classes have always been confusing with all those pubic, protected, and private fields, properties, and methods.  To make it easier for simple-minded programmers, and to make it more visual (since we use visual tools), the creators of the Db language have decided to create three different kinds of classes: lower, middle, and upper classes.

LowerClass

The LowerClass is differentiated from all other classes in that they have no property and all their interaction is done in fields.  Another differentiation is that a LowerClass has no methods.  Other classes interact with a LowerClass only through its fields, which of course are publicly accessible to the UpperClass instances.  A typical LowerClass would look like this:

LowerClass SomeDemocrat
{
  int rent;
  int debt;
  int[] children;  
  bool education=false;
}

MiddleClass

A MiddleClass has some methods and some private property.  The distinguishing feature here though is that a MiddleClass doesn't have any fields.  A MiddleClass however can own a LowerClass, providing the necessary access to fields.  For example:

MiddleClass Libertarian
{
  Apartment rentals[100];

  void ManageRentals();
}

UpperClass

An UpperClass has completely private property and methods.  In fact, an UpperClass is so private that its property and methods are completely inaccessible to other class types.  All property is not only private but also secured and insured.  An UpperClass only interacts with other UpperClass instances, usually through design patterns such as CountryClub and BoardRoom.  For example:

UpperClass BigShotRepublican
{
  Investments portfolio;
  Yacht coasts[6];
  Lobby<Politicians> inPocket;
}

In C++, classes could be "friends".  Db has a similar concept, automatically applied to UpperClass instances, called the "Lobby", allowing UpperClass instances to communicate with each other.

Exception Handling

In C#, exception handling is used to unroll the stack with the "throw" keyword.  In Db, this is again made more visually intuitive with the following keywords:

  • throwUp
  • upChuck
  • puke
  • ralph
  • hurl

These convey different levels of exception severity and can be used by your application to determine the size of the bucket needed to catch the exception.

System Exceptions

Db includes two exceptions that are used by the .TEN framework to convey exceptional severity:

  • drivingThePorcelainBus
  • technicolorYawn

You will need a very big bucket for these exceptions, as they generally connote a total system failure of the .TEN framework.  Sometimes the bucket can overflow, so you'll need to stack buckets so they catch the overflow.

Delegates And Events

A LowerClass object never has any delegates, but usually has many events.  For example:

LowerClass JoeShmoe
{
  event CarBrokeDown;
  event LostJob;
  event CheckBounced;
  event BillCollectorCalled;
}

whereas an UpperClass object never has any public events, but many delegates.  For example:

UpperClass JosephHenryDickensTheThird
{
  delegate Maid;
  delegate Butler;
  delegate Driver;
  delegate Cook;
  anonymous delegate Wife;  // mistress
}

Generics

Db gives you access to generic Hash, Pot, Coke, Crystal, and other useful collections.  These are cheaper implementations than those found in C#, reducing (if not actually eliminating) memory requirements, and in fact, the new generics actually accelerate the performance of your application.  All the generics are handled in the StreetCorner.Pharmacy namespace.  Another benefit to the new generics is that they automatically spawn additional threads.  The programmer should be careful that these other threads do not result in schizophrenic or psychotic behavior of the application.  However, used in moderation, they can definitely enhance your end-user experience.

Value Types

The creators of Db took the advice of "Nine Reasons Not To Use Int" to heart, and have therefore omitted the integer value type.  All numbers are expressed as rational factorials, in the form of n! + m! ... / a! + b! ...  This approach handles real, imaginary, rational, and irrational expressions.  It seems those monks were right.  By the way, generics are useful when working with these value types.  It makes the concept a lot more understandable.

Serialization

The creators of Db also took the advice of "Nine Reasons Not To Use Serialization" to heart, by omitting all ability to actually save any of your data in any format whatsoever.  There is absolutely no serialization support in the .TEN framework, and in fact, it actively ensures that you do not write your own.  This completely eliminates any issues with versioning, mysterious operations, etc., and should be welcomed by all programmers.  No more serialization hell!

Other Keywords

The following keywords, found in C#, have been replaced with better ones.

Abstract

All classes in Db are automatically abstract.  If you really need to do something real, you have to use the "concrete" or "cement" keywords.

As

In C#, the "as" keyword is way of casting, and will return null if the object cannot be cast to the desired type.  In Db, the "like, you know" keyword is used instead.  This keyword will only fail if you are actually working with concrete classes.

Catch

The catch keyword has been replaced with "bucket", so that throwUp can be properly handled.

Lock

C#'s lock keyword has been replaced with lockdown.  This immediately prevents any I/O from occurring, safely ensuring that nothing can come in or out of your application until the security administrator removes the lockdown.  This also prevents non-concurrent threads from simultaneously accessing the same fields and creating mass confusion and hysteria among the LowerClass instances.

Try

The C# try keyword has been replaced with "hope" (alternatively, "pray"), as in (see below for brace syntax):

hope
{}
  // this works
{}
bucket
{}
  // ewwww.
{}

Syntax

All the "C" languages have been plagued with confusion regarding brace style.  Db completely and forever resolves this problem by enforcing different brace styles depending on what the code is doing.  For example, there are three kinds of loop expressions, "for", "do", and "while".  In Db, these require different brace styles:

For

for (something)
{
}

Do

do
{{
  // something
}}

While

while (foo)
{{{
  // something
}}}

This has the wonderful advantage of not needing to put those stupid // end "for" comments at the end of a loop, because know you know what kind of loop is being used by the brace format!  This format is enforced by the compiler and will generate a syntax error if you do not comply. 

To differentiate with other code blocks, like "if" and and "hope-bucket", the following brace styles are used:

If

if (something)
}
  // do something
{

Bucket

hope
{}
  // something
{}
bucket
{}
  // eww.
{}

As you can see, the bracing style now conveys useful information.

Lamb-huh?

This extension should only be used if you, and everyone on your team, speaks with a lisp.  Otherwise, mixing Lamb-huh and Db will simply result in a lot of confused looks.

Linq

Linq stands for Language INtegrated Query.  We prefer that you simply don't ask.  That way, we don't have to tell you.  Ignorance is bliss, as they say.  What do you want to query anyways that you don't already know if you just meditated?

Refactoring

Refactoring--sounds like a remake of a B-rated movie.  OK, so maybe your code is a B-rated movie.  But do you really want to just remake your code with some MaxFactor lip gloss?  The Integrated Everything Environment! (IEE!) provided with Db comes with a revolutionary new technology called NEUROFACTOR (trademarked, patented, copyrighted, we'll sue your unborn child before he's a bulge in your pants.  Some restrictions may apply.  Works only on the male brain.  The male rodent brain to be precise.  No animals were harmed in testing).  With NeuroFactor, simply type what you mean, and the IEE! will automatically translate it into beautiful, fully functional, no need to test, code.  Throw away your unit tests, improve productivity by 10000%!  Warning.  Entering Visual Basic code with NeuroFactor enabled will permanently damage the heuristic AI algorithms. 

Conclusion

We hope this has given you a taste of the advancements coming your way in computing languages!  And as a final note to the Db language, we'd like to thank the language creators for writing this article in time for the April Fools Day deadline.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect Interacx
United States United States
Blog: https://marcclifton.wordpress.com/
Home Page: http://www.marcclifton.com
Research: http://www.higherorderprogramming.com/
GitHub: https://github.com/cliftonm

All my life I have been passionate about architecture / software design, as this is the cornerstone to a maintainable and extensible application. As such, I have enjoyed exploring some crazy ideas and discovering that they are not so crazy after all. I also love writing about my ideas and seeing the community response. As a consultant, I've enjoyed working in a wide range of industries such as aerospace, boatyard management, remote sensing, emergency services / data management, and casino operations. I've done a variety of pro-bono work non-profit organizations related to nature conservancy, drug recovery and women's health.

Comments and Discussions

 
Questionhmmm Pin
Member 1074887222-May-14 11:39
Member 1074887222-May-14 11:39 
AnswerRe: hmmm Pin
Marc Clifton27-May-14 3:18
mvaMarc Clifton27-May-14 3:18 
GeneralWonderful language Pin
EmoBemo31-Mar-10 23:15
EmoBemo31-Mar-10 23:15 
GeneralMy vote of 1 Pin
ProJester121-Jan-09 9:57
ProJester121-Jan-09 9:57 
General[Message Deleted] Pin
Danny Rodriguez27-Jan-08 9:44
Danny Rodriguez27-Jan-08 9:44 
[Message Deleted]
GeneralRe: ai Pin
Marc Clifton27-Jan-08 10:10
mvaMarc Clifton27-Jan-08 10:10 
Generaloh common Pin
simply_joe6-Nov-07 18:59
simply_joe6-Nov-07 18:59 
GeneralRe: oh common Pin
Marc Clifton6-Nov-07 23:58
mvaMarc Clifton6-Nov-07 23:58 
Generalpiano players [modified] Pin
Corinna John20-Jun-06 22:29
Corinna John20-Jun-06 22:29 
GeneralRe: piano players Pin
Marc Clifton21-Jun-06 2:20
mvaMarc Clifton21-Jun-06 2:20 
GeneralRe: piano players Pin
Scott McChesney10-Jul-06 3:40
Scott McChesney10-Jul-06 3:40 
QuestionWTF? Pin
RK KL12-Jun-06 6:26
RK KL12-Jun-06 6:26 
GeneralGot good laughs Pin
Juha Silmujarvi7-Jun-06 5:10
Juha Silmujarvi7-Jun-06 5:10 
Generalhahahaha Pin
Raj Lal25-Apr-06 18:54
professionalRaj Lal25-Apr-06 18:54 
GeneralI can't wait! Pin
Josh Smith23-Apr-06 16:54
Josh Smith23-Apr-06 16:54 
GeneralRe: I can't wait! Pin
Marc Clifton24-Apr-06 1:30
mvaMarc Clifton24-Apr-06 1:30 
GeneralTypo Pin
Emma Burrows7-Apr-06 1:07
Emma Burrows7-Apr-06 1:07 
GeneralVery Clever Pin
Colin Angus Mackay6-Apr-06 11:06
Colin Angus Mackay6-Apr-06 11:06 
GeneralTop Pin
David Pritchard5-Apr-06 11:30
David Pritchard5-Apr-06 11:30 
GeneralGood One. Pin
Chris Meech4-Apr-06 2:37
Chris Meech4-Apr-06 2:37 
GeneralTime Waster Pin
AbuseByUnkindPeople3-Apr-06 20:37
AbuseByUnkindPeople3-Apr-06 20:37 
GeneralRe: Time Waster Pin
Spiff Dog4-Apr-06 7:02
Spiff Dog4-Apr-06 7:02 
GeneralRe: Time Waster Bah Bah Pin
AbuseByUnkindPeople4-Apr-06 21:19
AbuseByUnkindPeople4-Apr-06 21:19 
GeneralRe: Time Waster Bah Bah Pin
Spiff Dog6-Apr-06 7:15
Spiff Dog6-Apr-06 7:15 
GeneralRe: Time Waster Pin
AbuseByUnkindPeople6-Apr-06 15:05
AbuseByUnkindPeople6-Apr-06 15:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.