Fun with VB !!!

Published 06 September 07 01:08 PM

Who says you can't obfuscate VB code?

For fun, I tried writing some VB code which was shaped in the letters 'vb' (that's right, the code itself forms the shape of the letters), where the 'v' and the 'b' are formed from the Visual Studio inifinity logo. In case you're having trouble visualizing that, here's a picture. Because I'm forming the letters from the symbol, the v and b have to be visually interpreted of course:

OK, so we have the above shape, but how to create the code this way? Well, we do that by using the ':' line separator all over the shop in order to allow us to create statements on the same actual physical line as the previous statement. And of course, we need plenty of underscores to format the code as well.

Finally, and importantly, we have to turn off pretty listing so the code retains it's shape. Make sure if you download the attached file, that you turn pretty-listing off before opening it (or, just look at the txt file, you'll get the idea).

In the attachment you'll find the actual file for this, and yes, compile and run at will. To build on the 'infinity' concept, I have the code producing the same picture of itself in a winform, a 'recursive' concept at least visually.

Naturally, the code is ugly to read, since the point is ont to be readable, but impressive for the effort that goes into it. All coding standards are thrown out the window for the effect: this is one situation where they just don't apply. And of course, the actual code isn't colored like it is above, but you'll find a powerpoint slide in the attachment that has the colored code, in case you want to print it out.

The challenge I put to you now is: what VB code do YOU want to create this way?

by VBTeam
Filed under: , , ,
Attachment(s):VBFun.zip

Comments

# DM said on September 6, 2007 10:43 PM:

Hmmm...

Seems you have too much free time... does that mean that VS 2008 is close to being RTM'd ??? ;-)

dm

# dennis the menace said on September 7, 2007 8:47 AM:

Yes, too much time... I am a dev manager and at this point you get everybody elses bug on your plate!

# Andrew said on September 7, 2007 9:01 AM:

"so the code retains it's shape"

No!!!! "ITS shape" No apostrophe! Please!

# warren said on September 7, 2007 10:06 AM:

Makes a point...I use to have some basic programs that ran on an old TRS80 (i think) that had to be compacted because <space> eats memory.

# Jarold said on September 7, 2007 10:23 AM:

Really, you do have too much free time how about spending your creative talent on something like webdesign?

# Peter said on September 7, 2007 1:10 PM:

very impressive, good job team keep it up!

as for you complainers try stepping out of the box a bit, sometimes this kind of thing is just what's needed to a. blow off some steam in a constructive way, b. take your mind off of the difficult task at hand to give yourself a breather, and c. spark a thought that becomes the next best thing!

# Jay A. Allen said on September 7, 2007 1:30 PM:

The JetBrains folks won't be happy with you; this project somehow manages to crash ReSharper. :)

# Peter said on September 7, 2007 2:12 PM:

.... must resist creating an ascii art code obfuscator .... must resist

# Logan said on September 7, 2007 2:16 PM:

I somehow feel stupider having witnessed this. :|

# Will said on September 7, 2007 2:39 PM:

ive just started 1st year sixth form and im learning the basics or programming such as starting a cmd window!! good stuff!! nice picture if only i knew what made it so hard to produce..

# Dan said on September 7, 2007 2:42 PM:

I jut lost 10 IQ points myself.  Does that mean I am now qualified to work on the VB Team?

# Sandman said on September 7, 2007 8:03 PM:

Oh, the good ol' days! When all you had was an ASCII line form printer, and your DOS by your side...VB's soul is recaptured indeed!

# VbPassion said on September 7, 2007 8:52 PM:

And who said VB is just a toy language :-)

# WMB said on September 7, 2007 10:11 PM:

There use to be code around the turned the source code into a maze.  Similar technique, wish I had saved the code.  It was called something like CodeMaze.  It simply played with the white space areas, adding some comments when it needed extra text.  Anyone remember that?

# Anthony D. Green, MCPD said on September 10, 2007 12:17 AM:

OMFG,

I'll admit I thought this was kinda silly at first. I never thought looking at unreadable code could be so much fun and if you could have seen me when I hit F5 - I lit up like a kid at Christmas.

Well titled post, bravo!

# said on September 12, 2007 7:17 PM:

Ok. Eigentlich wollte ich ja schon im Bett sein aber das ist dann doch zu arg ;-) Noch cooler ist jedoch,

# Noticias externas said on September 13, 2007 12:15 AM:

Ok. Eigentlich wollte ich ja schon im Bett sein aber das ist dann doch zu arg ;-) Noch cooler ist jedoch

New Comments to this post are disabled

This Blog

Syndication

Page view tracker