Fun with VB !!!

Fun with VB !!!

  • Comments 17

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?

Attachment: VBFun.zip
  • Hmmm...

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

    dm

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

  • "so the code retains it's shape"

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

  • 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.

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

  • 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!

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

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

  • I somehow feel stupider having witnessed this. :|

  • 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..

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

  • 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!

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

  • 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?

  • 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!

Page 1 of 2 (17 items) 12