Un-ravelling "Spaghetti Code" using the "Wall" method and a highlighter pen

Over this last year, I’ve struggled with a particular point in my code. A simple one-level undo function.

It’s not something that I’ve worked on all the time, and not crucial, but just an annoyance like a splinter in my mind. I’ve tried to sort this out (3 times), the last time I attempted to find the solution, I got up early on the weekend, had a few cups of coffee, a clear mind, but no. After a few hours of looking at my code, I was no closer to the solution.

I gave up for a few months, then last weekend I decided to take an “old school” approach. I printed out all the code pages of interest, stuck them up on a wall, attached pieces of twine linking the methods - then “voila”, the solution became clear. It’s nice to look at your code at head-height whilst casually walking along.

If you are coding all the time then you have the “big picture” in your mind and would think this method rather elementary. Perhaps it’s a product of getting older (poor memory). Nevertheless, this method works for me. I think sometimes we neglect these simple methods because we get caught up in superfluous things.

Now, if someone came up with an (approx.) 3mtr x 3mtr low res touch screen (or bigger) that allowed me to view my code without resorting to paper and sticky-tape, then I would say “shut-up and take my money”

Cheers.

I use a whiteboard and a non-permanent marker pen. Same principle.

Nice to know that someone else sees the validity of this principal. I think you can’t beat that sort of overview.

I do do a similar thing with my samsung tablet, Galaxy Note, the one with a stylus, and ‘link off the page’ to other pages, and as its always with me cahngings on the go aren’t an issue. This is quite handy to when I suddenly get inspired and scribble some more notes on it, and rub out/change bits. The software is the plain samsung notes, and it makes a nice pdf of my scribblings if required to view in hardcopy mode stuck on a whiteboard :slight_smile: which I have also done before now.

If it gets too convoluted on the whiteboard then it is time to rethink or at least refactor …

I use dual 27" monitors and occasionally add my 14" laptop to my desk if I need another computer for testing multi-user stuff. But then… I’m only 31, and admittedly have a good memory. [off topic] Someone once bet me I couldn’t memorize the sequence of numbers in a deck of 55 cards, in less than 2 hours. I did it in less than 30 minutes. [/off topic]

Easy. I can do it in 5 min, and I’m 55.

The trick is to sort the stack first.

2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 …

:wink:

VISIO and EXCEL can help believe or not as well… :slight_smile:

Good one. Unfortunately this deal included him mixing the stack.

I have done this sam time of thing with Network mappings/diagrams, with storage networks, storage mappings and with weird/odd database schemas. a large wall with pages/tape/yarn works well.

Yes I do the same on a whiteboard. If you need more space look into dry erase paint you can make any wall a whiteboard :slight_smile:

LOL that is how the FBI and other LEO agencies sort out a major case.

generally with whiteboards/whiteboard painted walls and less yarn. Or that is my experience when I worked at the Hoover building.

—sb

But movies show me the wall covered in red yarn! The more yarn, the deeper into the case they are!

Sounds like a yarn (2nd def.) to me. :wink:

hahahahaha and according to TV/movies you are right