Code then and Code now

Every year, among several others, a student body from my institute holds a contest called “Mission Mars”. Essentially you write a little piece of code to behave like a little robot to explore the martian surface. Though this seems like much, it basically tells you what’s a few steps around you (the environment), and you have to decide where to move, and cover the maximum area within a finite time, making sure that the same regions aren’t covered over and over again, and the bots don’t collide into obstacles.

Essentially, you are given a small string, and you have to return another string, but it’s a lot more interesting than just that. But that’s not what I’m going to talk about. This post is going to be, as always, about: ME!! Yep, narcisstic ol’, nihilistic ol’, silly ol’ me.

More specifically, it’s about evolution in code. Essentially, while I submitted my code, which spanned nearly 3500 lines, I realized that gmail had archived a piece of code which I submitted for the same contest two years ago. When I opened it up, I had a similar reaction to what I do when I re-read some of my old emails, my large intestine has a strange desire to jump up and strangle my head for being such a clueless nicumpoop. But anyways.

Code then:

500 lines, out of which 150 were comments, out of which 90 were ascii art or something useless. 500 lines split across 9 header files. long_function_names_in_underscores annoyingly_cheesy_variable_names_also_in_underscores Did not compile implemented with structs Used printfs in random places to debug. Poorly planned and executed Code filled with lots of lame-ass smart alec-wannabe comments that makes you go “wtf was he thinking”.

Code Now:

3500 lines, of which about 200 were comments, of which two of them were ascii art or something useless. (if you count @#!$^$ as ascii art) Split across eight header files smallClearNames() Compiles with 1 warning Implemented with polymorphism and namespace allocation. lots of solid trace output so debugging the code was a breeze. No lame-ass smart alec-wannabe comments that go “wtf was he thinking”. I leave that for the weblog.

Overall, I’m proud of my behemoth code, no matter how it works (which it does quite well) but I just hope I look back at this post in three years and write a similar one.

Also a huge advantage is writing code on a widescreen, large monitor. It’s absolutely gorgeous, doesen’t hurt your eyes after fifteen minutes, and you can split the window and cross reference the code, and the best part is that you can actually use the f*king sidebars with the function names and references and still be able to read the code. Pure bliss.

Screengrab(click to enlarge):

Screen

0 Responses to “Code then and Code now”


No Comments

Leave a Reply







You are viewing a mobilized version of this site...
View original page here

How do you rate mobile version of this page?

Mobilized by Mowser Mowser