God No! ...The ReBuilder
secretGeek .:dot Nuts about dot Net:.
home .: about .: sign up .: sitemap .: secretGeek RSS

God No! ...The ReBuilder

Do you ever have a software idea so horrible that you feel physically sick?

At times like that, you can block out the idea immediately, but I find it's best to follow the idea through to it's logical conclusion.

So here's a repulsive idea I had, which I've since discussed with a bunch of people who helped flesh it out a little more, making it extra terrible.

var person = new Person();

Introducing 'The ReBuilder'

Ah, yes. It's called 'The ReBuilder'

Here's an example of what happens when you're foolish enough to use it.

So, you open up Visual Studio and choose to create a new console application.

You type the line:

var person = new Person();

Try to compile and see an error, essentially 'Person? No such type!'

"Error 1 The type or namespace name 'Person' could not be found (are you missing a using directive or an assembly reference?)"

Rather than have the programmer waste his or her precious time creating this new class, the Rebuilder does it for you. It goes right ahead and creates a class with the name 'Person'. It doesn't ask you to confirm the action, it just goes ahead and does it. No ifs or buts. Where does it put this new class? Wherever is the most conventional place. It builds the application again, right away. There's no new compilation errors, so it rests.

person.FirstName = "Jim";

You type another line of code... you now add:

person.FirstName = "Jim";

The rebuilder picks up on this straight away. (Actually, screw it, you don't need to specifically try and build... this is a background compilation. It's always present.)

Rebuilder notices the resulting error...

"Error 1 'Person' does not contain a definition for 'FirstName' and no extension method 'FirstName' accepting a first argument of type 'Person' could be found (are you missing a using directive or an assembly reference?)"

Clearly you're not after a method called FirstName, you're after a property. So rebuilder adds a property named FirstName of type string. No magic.

Next you try to save your object...

person.FirstName = "Jim";

person.Save();

This yields a fresh error:

"Error 1 'Person' does not contain a definition for 'Save' and no extension method 'Save' accepting a first argument of type 'Person' could be found (are you missing a using directive or an assembly reference?)"

This time the missing method is, indeed, a missing method. So ReBuilder gets in builds a method with the appropriate signature.

And it doesn't flesh out the body of the method with some dodgy 'Throw New NotImplementedException()' bullshit like the 'Generate Method Stub' feature in Visual Studio. It analyzes the name of the method, and implements it on your behalf.

"Hmmm, 'Save'," thinks the ReBuilder. "I guess you want to 'save' a person." So rebuilder writes a save method, saving to the most conventional place it knows: the database.

If there's a useful database connection in the application, then it uses that. If not, it creates one.

If the database contains a table named 'person', it will save to there. If not, it will build a table.

If there's no database to begin with -- well the ReBuilder goes ahead and builds it.

Obviously, you wouldn't do all this without any code coverage, so hell, RB churns out a sweet suite of tests to cover all the branches of the save routine.

(If the database, and the person table already exist, then we make sure all the relevant properties exist. This might include creating a migration script for updating any other environments with previous versions of our database)

Next you type:

person.GetByFirstName("Jim");

"Hmmm. Judging by the name GetBy<PropertyName>(<string>)..."

It looks like you expect a well understood pattern to be implemented.

(Yes, this bit is blatantly inspired by Ruby on Rails use of method_missing...

"def method_missing(method_id, *arguments)
   if match = /find_(all_by|by)_([_a-zA-Z]\w*)/.match(method_id.to_s)")

And rebuilder will add an index to the Person table, on the column indicated by the property name, plus create the relevant goo for performing the expected retrieval. (And again, whatever tests are needed to cover all paths.)

Finally, you branch out a little and type:

Satellite.ReCalibrateAfterSolarFlare(magnitude:=237);

ReBuilder, naturally, doesn't have a freakin clue what that means. It doesn't fit any known convention -- so it falls back on its "Convention_Missing" convention.

Convention_Missing

First, ReBuilder looks on Koders, Krugle, codase, google codesearch... every last place it can to see if any indexed open source code contains a method like the one we're after.

Failing that, RB opens your email account and writes to a few of your coder buddies (on your behalf) to see if any of them have experience with a similar problem.

Failing that, it sends a polite (though assertive) email to Scott Hanselman, asking him if he can (a)help out, or (b)point you in the direction of someone who can.

When a suitable method is located as a starting point for 'ReCalibrateAfterSolarFlare' -- it is pasted into the code, and a new compilation is attempted.

Rebuilder attempts to complete any compiler errors at this point through simple deducation, through the use of markov chains, through Any compiler errors at this point are submitted as polite (though assertive) questions at StackOverflow, in the persona of a very awkward but honest noob, struggling to solve this one temporary and specific problem.

While waiting for the responses there, ReBuilder runs a logo competition online at 99designs or crowdSpring, then holds back, letting the community provide the content as well as picking the winner.

Once the responses from StackOverflow are sufficient to get the code compiling, ReBuilder checks that all the unit tests (written by the lowest bidder at www.RentABusinessAnalyst.com ) are beginning to pass.

Once all code compiles and all tests pass, the logo is in place and the typical page layout and css are fully baked (munged together from every cool site mentioned on every cool design blog) the app is shunted onto the first available cloud computing platform, cross promoted at your facebook and twitter profiles, cross posted to reddit, hacker news and digg, where it's upvoted and astroturfed by a distributed swarm of sockpuppets launched by every other PC on the planet running a copy of Rebuilder Zombie daemon, promoted with whatever relevant google adwords are cheap enough to suit your budget, and plastered with enough punch the monkey ads to bring in a steady trickly of cold cash.

You, meanwhile, sipping cocktails on the beaches of Tahiti, receive an SMS telling you the app is done, and your resume is automatically updated with glowing details of the amazing "ReCalibrate After Solar Flare" 2.0 app.

No magic. None.





'Dylan Wolf' on Mon, 20 Jul 2009 13:50:49 GMT, sez:

You left out one key piece of functionality: typo detection. After all, you wouldn't want to end a very long coding session with the classes Person, Preson, Perosn, and Persno, each with some combination of the methods Save, Saev, and Svae. ReBuilder should realize what you meant in each case without cluttering up your namespace with useless classes.

If possible, this feature should be implemented with a friendly MS Office-like interface. "It looks like you were trying to create a 'Person' class! Would you like some help?"



'Kristopher Johnson' on Mon, 20 Jul 2009 13:51:32 GMT, sez:

This tool should automatically generate user documentation via conventions. For example, if there is a button titled "Recalibrate" which is hooked up to the ReCalibrateAfterSolarFlare() function, then the user-guide text " Click the Recalibrate button to recalibrate after solar flare."

Given the average programmer's skill at selecting good descriptive names, the need for technical writers may be eliminated entirely, unless the technical writing community creates a tool that generates code from user guides.



'Stuart Dootson' on Mon, 20 Jul 2009 19:28:25 GMT, sez:

All you need to do is get it to write code to correct your test failures and TDD becomes practical...



'Farmer Jeb' on Mon, 20 Jul 2009 23:41:00 GMT, sez:

I can see no way that this ReBuilder could possibly fail!



'Miles Archer' on Tue, 21 Jul 2009 01:19:19 GMT, sez:

This is starting to sound like VB6



'gman' on Tue, 21 Jul 2009 21:26:49 GMT, sez:

it should then publish a blog article and hencewith this here comment itselfffff



'rtshiva' on Wed, 22 Jul 2009 04:23:07 GMT, sez:

was this blog generated using ReBuilder 2.0 blog version ? ;)



'Daniel Earwicker' on Wed, 22 Jul 2009 07:01:17 GMT, sez:

You want to fit internal DSLs into this somehow, they're fashionable!

So maybe you should be able to type absolutely anything, in any syntax, and ReBuilder should figure out what it ought to mean:

var elem = html <- { tag: body }

Isn't it obvious?!



'Fleischbeutel' on Mon, 27 Jul 2009 05:08:36 GMT, sez:

You might want to dub it 'ReCreator' with an option to drop the 'Re' later.

That's what I did anyway. Provided a natural speech interface and said 'let there be light' - had another language binding then. Well, created a lot of customer complaints.



'Tom Bull' on Mon, 27 Jul 2009 22:31:39 GMT, sez:

I laughed so hard, I nearly wet myself. Thanks.



'gerry lowry' on Sun, 09 Aug 2009 12:09:05 GMT, sez:

no sipping cocktails anywhere for you. we're now unemployed and hunting you down. you've just killed the planet's entire developer community, India included. You've nowhere to hide unless you can move in with the person who invented the carburator that gets 200 miles per gallon, assuming the oil companies have not refactored him yet.



'NinjaCross' on Tue, 25 Aug 2009 14:09:58 GMT, sez:

Nice one :D
It seems a little bit... well... Prolog ?



'Alwin' on Thu, 27 Aug 2009 07:27:03 GMT, sez:

really amazeing



'Alwin' on Thu, 27 Aug 2009 07:27:04 GMT, sez:

really amazeing



'Garthy' on Wed, 09 Sep 2009 09:36:15 GMT, sez:

You relise Resharper does quite a bit of this? Or was that the point of the post and I missed it?



'Radi' on Thu, 08 Oct 2009 06:40:11 GMT, sez:

What's that text layout view at the right side of your code window? Is this an addin for visual studio, or simply a mockup?



'lb' on Mon, 12 Oct 2009 20:14:57 GMT, sez:

@radi

> text layout view at the right side of your code window?

I love that tool!

it's called rockscroll, and googling for it will lead you to a hanselman article from which it can be downloaded.

it's hard to live without it.




name


website (optional)


enter the word:
 

comment (HTML not allowed)


All viewpoints welcome. But the right to delete any post for any reason is reserved. Don't make me do it. Comments may be republished, emailed to your loved ones or printed and used as toilet paper. Who reads this legal bit anyhow?

TimeSnapper is a life analysis system that stores and plays-back your computer use. It makes timesheet recording a breeze, helps you recover lost work and shows you how to sharpen your act.

TimeSnapper won last year's Developer Competition at Larkware.com, and is used by over 10,000 people.

Articles

What then, is b? What then, is b?
SQLike: A simple editor SQLike: A simple editor
Yet Another BizPlan Generator. Yet Another BizPlan Generator.
HOT GUIDS: A hot or not site for guids HOT GUIDS: A hot or not site for guids
How does life get better? One tiny hack at a time. How does life get better? One tiny hack at a time.
24 things to do, and 100 things *not* to do (yet) for building a MicroISV 24 things to do, and 100 things *not* to do (yet) for building a MicroISV
Venture capital won't kill Jeff Atwood, it will only make him Jeffer. Venture capital won't kill Jeff Atwood, it will only make him Jeffer.
A handy workflow image for newbie mercurial users A handy workflow image for newbie mercurial users
Fractal Feedback, a diversion into recreational programming Fractal Feedback, a diversion into recreational programming
Hump-Jumping: How the Education of Computer Science can be Saved, err, maybe. Hump-Jumping: How the Education of Computer Science can be Saved, err, maybe.
Suggested User Experience Improvements for DiffMerge Suggested User Experience Improvements for DiffMerge
SQL Style Extensions for C# SQL Style Extensions for C#
The Movie Hollywood (And My Wife) Doesn't Want You To See: Weekend at Jacko's The Movie Hollywood (And My Wife) Doesn't Want You To See: Weekend at Jacko's
Sysi: the ultimate administrators toolkit Sysi: the ultimate administrators toolkit

Archives .: secretGeek :: Complete Archives
TimeSnapper -- Automated Screenshot Journal TimeSnapper.com    
Version 3.3: true productivity boost

Next Action NextAction
Managing the top of your mind

World's Simplest Code Generator (html edition) World's Simplest Code Generator

25 steps for building a Micro-ISV 25 steps for building a Micro-ISV
3 minute guides -- babysteps in new technologies: powershell, JSON, watir, F# 3 Minute Guide Series
Universal Troubleshooting checklist Universal Troubleshooting Checklist
Top 10 SecretGeek articles Top 10 SecretGeek articles
ShinyPower (help with Powershell) ShinyPower
Now at CodePlex

Realtime CSS Editor, in a browser RealTime Online CSS Editor
Gradient Maker -- a tool for making background images that blend from one colour to another. Forget photoshop, this is the bomb. Gradient Maker


[powered by Google] 


How to be depressed How to be depressed
You are not inadequate.



Recommended Reading

The Best Software Writing I
The Business Of Software (Eric Sink)

Recommended blogs

Jeff Atwood
Joseph Cooney
Phil Haack
Scott Hanselman
Julia Lerman
Rhys Parry
Joel Pobar
OJ Reeves
Eric Sink

Aggregated Links

proggit
dzone
hacker news
dot net kicks

Human Link Machines

interesting finds
a continuous learner's weblog
arjan's world
weekly link post

LinkedIn profile
LogEnvy - event logs made sexy
ShuffleText - fuzzy search for .net
PC Smart Buys - Computer Hardware in Australia
 
home .: about .: sign up .: sitemap .: secretGeek RSS .: © Leon Bambrick 2006 .: privacy

home .: about .: sign up .: sitemap .: RSS .: © Leon Bambrick 2006 .: privacy