Peter_vdL

Ada Lovelace Day

by Peter_vdL Motorola 10-07-2011 11:17 AM - edited 10-08-2011 03:06 PM

Today, October 7th, is Ada Lovelace Day.  Today is a day for recognizing the inspirational example of women working in science, engineering, technology, or mathematics.

 

As you probably know, based on her pioneering work on algorithms for the Difference Engine, Ada Lovelace is generally recognized as the world's first computer programmer.  The Ada programming language was named in her honor.  And you can actually read the first computer programmer ever written - In 1842, Ada translated and annotated the report of a presentation on the Difference Engine.  John Walker, founder of Autodesk, located this seminal document and put it online.  Ada's notes are at the end, labeled "a" through "g".  Note g contains the code to compute a sequence of Bernoulli numbers with the engine.  That is the world's first computer program, and it was written by Ada Lovelace - it is astonishing that we can look over the shoulder of the world's first programmer.


Ada Lovelace is a most interesting historical figure - she was the daughter of the poet Byron (famously and accurately described by a former lover as "mad, bad, and dangerous to know").  Byron was certainly uninhibited - he clashed with his college at Cambridge University, over a rule forbidding pet dogs.  When the college declined to make an exception for Byron's beloved Newfoundland dog, he acquired a pet bear, and kept that at the college instead. (my take on it: a gorilla would have made the point more effectively, and been a lot more fun to take on walks, but Byron chose a bear.  "They have made their rules, now bear the consequences, fools," Byron did not reportedly quip in rhyme, but he should have).

 

Ada never knew her eccentric poet father. He separated from Ada's mother a few weeks after Ada was born, and exiled himself to Greece, where he died young, at the age of 36.   When the literati talk about "Byronic heroes", they mean someone who is brash, moody, passionate, energetic, handsome, artistic, charismatic and ultimately flawed. Ada's mother made sure that Byron had no influence on their daughter, and Mrs Byron also arranged early math tuition partly as a distraction for Ada.


They didn't have IDEs in Victorian times, so Ada Lovelace had to do her programming work the time-honored way, by chewing a pencil, while reflecting on the next lines to code.  I like to think if she had used an IDE, she would have chosen MOTODEV Studio, and used its code snippets feature.  The code snippet feature lists several dozen code idioms, and lets you paste them directly into your code, just by clicking.  It is an awesome feature!   Here's the code snippet for a GPS reading, that I just clicked into place

LocationManager locationManager = 
     (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates(
      LocationManager.GPS_PROVIDER, 0, 0, new LocationListener() {
  public void onStatusChanged(String provider, int status, Bundle b) {  }
  public void onProviderEnabled(String provider) {  }
  public void onProviderDisabled(String provider) {  }
	
  public void onLocationChanged(Location location) {
	double latitute = location.getLatitude();
	double longitude = location.getLongitude();
	// do whatever you want with the coordinates
  }
});

 The code needs an AndroidManifest.xml  permission:
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

and Studio conveniently offers to put this in the manifest for you.

 

The Lovelace family seat is in Ockham, Surrey.  On a recent trip to England, I made a side trip to visit that stately pile, because of its association with Ada and programming.   Here it is.

ockham.park.sm.jpg

The Lovelace Family Seat, Ockham Park, England

It's an enormous country house, one wing of which burned down decades ago.  The house is located right behind the village church, although changing demographics mean there really isn't an Ockham village any more, just a string of a few tiny cottages.  I like to think of Ada Lovelace sitting in that vanished wing of that grand country house, chewing a pencil, and musing over "shift right and then 2's complement? Or take the complement and then do an unsigned shift?"

You can see a working replica of the Difference Engine that Ada Lovelace programmed, in the Computer History museum on Shoreline Ave in Mountain View, California.  I suggested to a curator that they could raise money by selling trig tables that had been printed by the engine.  He pooh-poohed the idea, claiming that they didn't want to get the engine all inky.

 

The engine was never realized in Ada's lifetime - I guess the hardware project slipped, the way they sometimes do.  The replica construction was funded by a Microsoft millionaire, and built by Doron Swade of the British Science museum.  Swade wrote a fascinating book on the topic, and unlike many hardware designs, this one worked perfectly after correcting a single error in the blueprints (some have speculated that it's not an error, but a copyright trap).   It's Ada Lovelace Day all day long, so please celebrate and support it.

Peter van der Linden

Android Technology Evangelist



Notes

1.  The "method of differences," which gave the Difference Engine its name, is explained here (poorly).  Here's a better explanation.

Comments
by Eliud (anon) on 10-10-2011 05:32 AM

Hey Peter,

 

Amazing,amazing,awesome stuff....thanks.

 

I'm new to motodev and I'm staying...I just love Motorola phones and android!

 

Best regards,

Eliud. 

 

 

by Peter_vdL Motorola 10-10-2011 05:00 PM - edited 10-10-2011 05:04 PM

Thanks for the great feedback, Eliud.   I'm glad to see someone who values the amazing history as much as I do!   Stick around the blogs and forums, and I'll blog about more great finds when I can.

 

These are rare and unexpected treasures.  I live in the next town to the Computer History Museum, and have often seen the difference engine, but I know others are not so fortunate.   My big regret is that Babbage was too obdurate a man to succeed in a project that required the help of others.    If he had built a working engine, it would have been a trivial step to connect it to a steam engine, and really get that mill cranking!   With that kind of computing power, the Victorians might have conquered flight decades before Kittyhawk.   Certainly, a lot more bridges would have stayed up (through better simulation of models).   It's a pipe dream, but who can resist thinking about it!

 

   Peter

Post a Comment
Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
reCAPTCHA challenge image
Type the characters you see in the picture above.Type the words you hear.
About MOTODEV Blog
The MOTODEV blog keeps you updated on mobile app development news from MOTODEV and the Android developer community.

Subscribe to our RSS feed Subscribe via RSS

Follow Us:
Fan MOTODEV on Facebook Join the MOTODEV LinkedIn Group MOTODEV on YouTube

motodev profile

motodev @david_latham what specifically are you trying to download? 7 days ago · reply · retweet · favorite

motodev profile

motodev RT @StackMob: Join StackMob and Salesforce at the MOTODEV Google + Hangout today at noon. Register here l2cloud-stackmob.eventbrite.com 7 days ago · reply · retweet · favorite

motodev profile

motodev G+ Hangout: Migrating ur legacy systems to the cloud & mobile is at @ 12pm PDT today. Join us and bring your questions. #l2cloud 7 days ago · reply · retweet · favorite

Our Blog & Comment Policy
Opinions expressed here and in any corresponding comments are the personal opinions of the original authors, not of Motorola. The content is provided for informational purposes only and is not meant to be an endorsement or representation by Motorola or any other party.

Remember, when you comment, please stay on topic and avoid spam, profanity, and anything else that violates our user guidelines. All comments require approval by Motorola and can be rejected for any reason.

For customer support issues with your Motorola phone go to the Motorola customer support website.