Fudge anyone? 80
Back in September, when I was just staring the Slim project, I made a crucial architectural decision. I made it dead wrong. And then life turned to fudge…
The issue was simple. Slim tables are, well, tables just like Fit tables are. How should I parse these tables? Fit parses HTML. FitNesse parses wiki text into HTML and delivers it to Fit. Where should Slim fit in all of this?
Keep in mind that Fit must parse HTML since it lives on the far side of the FitNesse/SUT boundary. Fit doesn’t have access to wiki text. Slim tables, on the other hand, live on the near side of the FitNesse/SUT boundary, and so have full access to wiki text, and the built in parsers that parse that text.
So it seemed to me that I had two options.
- Follow the example of Fit and parse wiki text into HTML, and then have the Slim Tables parse the HTML in order to process the tables.
- Take advantage of the built in wiki text parser inside of FitNesse and bypass HTML altogether.
I chose the latter of the two because the Parsing system of FitNesse is trivial to use. You just hand it a string of wiki text, and it hands you a nice little parse tree of wiki widgets. All I had to do was walk that parse three and process my tables. Voila!
This worked great! In a matter of hours I was making significant progress on processing Slim decision tables. Instead of worrying about parsing HTML and building my own parse tree, I could focus on the problems of translating tables into Slim directives and then using the return values from Slim to colorize the table.
Generating html was no problem since that’s what FitNesse does anyway. All I had to do was modify the elements of the parse tree and then simply tell the tree to convert itself to HTML. What a dream.
Or so it seemed. Although things started well, progress started to slow before the week was out. The problem was that the FitNesse parser is tuned to the esoteric needs of FitNesse. The parser makes choices that are perfectly fine if your goal is to generate HTML and pass it to Fit, but that aren’t quite so nice when you’re goal is to use the parse tree to process Slim tables. As a simple example, consider the problem of literals.
In FitNesse, any camel case phrase fits the pattern of a wiki word and will be turned into a wiki link. Sometimes, though, you want to use a camel case phrase and you don’t want it converted to a link. In that case you surround the phrase with literal marks as follows: !- FitNesse-!
. Anything between literal marks is simply ignored by the parser and passed through to the end.
Indeed, things inside of literals are not even escaped for html! If you put <b>hi</b>
into a wiki page, it will escape the text you’ll see <b>hi</b>
on the screen instead of a bold “hi”. On the other hand, if you put !- <b>hi</b>-!
on a page, then the HTML is left unescaped and a boldfaced “hi” will appear on the screen.
I’m telling you all of this because the devil is in the details—so bear with me a bit longer.
You know how the C and C++ languages have a preprocessor? This preprocessor handles all the #include
and #define
statements and then hands the resulting text off to the true compiler. Well, the wiki parser works the same way! Literals and !define
variables are processed first, by a different pass of the parser. Then all the rest of the wiki widgets are parsed by the true parser. The reason that we had to do this is even more devilishly detailed; so I’ll spare you. Suffice it to say that the reasons we need that preprocessor are similar to the reasons that C and C++ need it.
What does the preprocessor do with a literal? It converts it into a special widget. That widget looks like this: !lit?23?
What does that mean? It means replace me with the contents of literal #23. You see, when FitNesse sees !- FitNesse-!
it replaces it with !lit?nn?
and squirrels FitNesse
away in literal slot nn. During the second pass, that !lit?nn?
is replaced with the contents of literal slot nn. Simple, right?
OK, now back to SLIM table processing. There I was, in Norway, teaching a class during the day and coding Slim at night, and everything was going just great. And then, during one of my tests, I happened to put a literal into one of the test tables. This is perfectly normal, I didn’t want some camel case phrase turned into a link. But this perfectly normal gesture made a unit test fail for a very strange reason. I got this wonderful message from junit: expected MyPage but was !lit?3?
I knew exactly what this meant. It meant that the value MyPage
had been squirreled away by the first pass of the parser. I also knew that I had utterly no reasonable way of getting at it. So I did the only thing any sane programmer would do. I wrote my own preprocessor and used it instead of the standard one. This was “safe” since in the end I simply reconvert all the colorized tables back into wiki text and let the normal parser render it into HTML.
It was a bit of work, but I got it done at one am on a cold Norwegian night. Tests passing, everything great!
Ah, but no. By writing my own preprocessor, I broke the !define
variable processing – subtly. And when I found and fixed that I had re-broken literal processing – subtly.
If you were following my tweets at the time you saw me twitter ever more frantically about literals. It was the proverbial ball of Mercury. Every time I put my thumb on it1 it would squirt away and take some new form.
I fell into a trap. I call it the fudge trap. It goes like this:
forever do {
“I can make this work! Just one more little fudge right here!”}
I was in this trap for two months! I was making progress, and getting lots of new features to work, but I was also running into strange little quirks and unexpected bizarre behaviors caused by the fudging I was doing. So I’d fudge a little more and then keep working. But each little fudge added to the next until, eventually, I had a really nasty house of cards (or rather: pile of fudge) ready to topple every time I touched anything else. I started to fear my own code2. It was time to stop!
I knew what I had to do. I had to go back to my original architectural decision and make it the other way. There was no escape from this. The FitNesse parser was too coupled to the wiki-ness, and there was no sane way to repurpose it for test table processing.
I dreaded this. It was such a big change. I had built so much code in my house of fudge. All of it would have to be changed or deleted. And, worse, I needed to write an HTML parser.
I was lamenting to Micah about this one day in late November, and he said: “Dad, there are HTML parsers out there you know.”.
Uh…
So I went to google and typed Html Parser
. Duh. There they were. Lots and lots of shiny HTML parsers free for the using.
I picked one and started to fiddle with it. It was easy to use.
Now comes the good part. I had not been a complete dolt. Even when I was using the FitNesse parse tree, I ate my own dogfood and wrapped it in an abstract interface. No part of the Slim Table processing code actually knew that it was dealing with a FitNesse parse tree. It simply used the abstract interface to get its work done.
That meant that pulling out the wiki parser and putting in the HTML parser was a matter of re-implementing the abstract interface with the output of the new parser (which happened to be another parse tree!). This took me about a day.
There came a magic moment when I had both the wiki text version of the parser, and the HTML version of the parser working. I could switch back and forth between the two by changing one word in one module. When I got all my tests passing with both parsers, I knew I was done. And then the fun really began!
I deleted ever stitch of that wiki parse tree pile of fudge. I tore it loose and rent it asunder. It was gone, never to darken my door with it’s fudge again.
It took me a day. A day. And the result is 400 fewer lines of code, and a set of Slim tables that actually work the way they are supposed to.
Moral #1: “Fudge tastes good while you are eating it, but it makes you fat, slow, and dumb.”
Moral #2: “Eat the damned dog food. It’ll save your posterior from your own maladroit decisions.
1 I do not recommend that you actually put your thumb on any Mercury. Never mind that I used to play with liquid Mercury as a child, sloshing it around from hand to hand and endlessly stirring it with my finger. Wiser heads than I have determined that merely being in the same room with liquid Mercury can cause severe brain damage, genetic corruption, and birth defects in your children, grandchildren, and pets.
2 Fearing your own code is an indicator that you are headed for ruin. This fear is followed by self-loathing, project-loathing, career-loathing, divorce, infanticide, and finally chicken farming.
It sounds like the classic ‘good money after bad’ scenario. If anything, I sometimes irritate people I’m pairing with because I’m too eager to jump to something else when the current tack isn’t working.
Wow, this entry has the highest lesson density (lessons per word) that I ever read. So many good things to learn from this experiment. Thanks Uncle Bob!
And you playing with liquid mercury as a kid explains soooo many things ;)
Great blathering; I always enjoy your insights on our craft, Uncle Bob.
I learned about the new blog entry by viewing your Twitter content. Thanks for your updates there.
I had a similar experience this year. So much work wasted, at least it was good to learn from it.
I’m currently counting how many times during the last year I fell into this pitfall. Interesting to get to know, that there are people out there trapping in the same traps as me.
Haha, I’m eager to jump to something else when the current tack isn’t working …
This was a great post. I think that I will be able to use this in getting a more widespread focus on drug addiction and rehab. Thank you for sharing this information.
I sometimes irritate people I’m pairing with because I’m too eager to jump to something
Thanks for sharing this great article! That is very interesting Smile I love reading and I am always searching for informative information like this.
Living without an aim is like sailing without a compass. with a new http://www.handbags4buy.com/ idea is a crank until the idea succeeds.
Very quietly I take my leave.To seek a dream in http://www.edhardy-buy.com/ starlight.
you can have a ttr
ou can have a ttr
ou can have a ttr
thank you for sharing with us
Wow, this entry has the highest lesson density (lessons per word) that I ever read. So many good things to learn from this experiment. Thanks Uncle Bob!
Hello All, I just wanted to start by saying that the contribution here is simply amazing.
yes, I’m telling you all of this because the devil is in the details—so bear with me a bit longer
’t have access to wiki text. Slim tables, on the other hand, live on the near si
Armani Jeans is an Italian extension to the famous Italian fashion house Gucci Jeans For Men. However, it is more specialized in youthful clothes and men’s accessories for young ages. They produce summer wear, beach wear, youthful jeans, and more trendy attires and stuff.tattered denim. It is a true staple for the warmer weathers and on the runways of Dolce Gabbana Jeans. Designers Dominico Dolce and Stefano Gabbana gave us looks to coincide with their Crown Holder Jeans and Dolce Gabbana Jeans collection. The looks of this collection are very “preppy in the park” like a disheveled Chuck Bass almost. Along with the tattered denim, models were also sent down the runway in patchwork denim and a pair of denim shorts. You can check out the denim looks below.
Supra Greco Suprano were designed by Jim Greco. The simple design provides these shoes with a classic look. These creative recreation shoes High shoe consist of special features such as tongue foam and a thin collar as well as a mesh tongue that allows your foot to be ventilated, a little extra protection for your heel, and a vulcanized rubber outsole.creative recreations shoes can stand at a high position of Market for the pattern and material, the most “straighten up” and the material most shinny. So surpra bring more to the fashion field and the sports.More and more stars endorse creative recreations sneakers with condition. Such as Slash, JAY-Z, Lil Wayne, Lindsay Lohan, Heidi Klum, Mr. Diddy and so on. They always putting on a pair of SUPRA shoes to attend the parties. Well as a skateboarder, I often try my luck on the marketplace to find new skateboarding shoes. It just so happens that -White—Mint_p467.html”>creative cesario low mens are my favorite.
asdsadasd
Bape Jeans are popular with its fantastic design and wonderful condition. Bape Jeans are always in beautiful condition with no stains, holes, tears, smells, absolutely mint. In addition, Bathing Ape Jeans are available in diversity design features. They are well recognized around the world due to its flashy design and original art, and expensive material.We will offer you the best service and cheapest Authentic Bape Jeans. We can offer our clients a wide variety of styles of Bape Denim
I love your content & the way that you write.
I’ve been frsurtated by SLIM table processing in the past too :)
Good to see someone else involved with SLIM table processing.
I’ll remember to eat the damned dog food in future ;)
It seems unlikely that new Slim features will be needed very often.
Cant you use some open source libraries and tweek to suit?
u are writing well :)..really im enjoying on im reading your content
The best thing about purchasing on the web is you’re able to observe everything the actual offers, where in a store it can be challenging to type on the other hand her or his products to locate what’s right. Moms adore presents which have been remarkable. Attempt to found the mommy utilizing a present that is personalized, as a possible illustration a wedding ring employing their identify etched inside it. Gold jewelry lead to great gifts simply because immortalize your mom?¡¥s brand inside precious metal. A gold pendant and a durant creates a wonderful gifts on your mommy, and also products that are most often overlooked .
Come and make a change for your lovely iphone 4 white!
With Monster Beats Studio, you’ll hear every sonic detail the musicians and recording engineers laid down in the studio. Deep bass. Hard hitting drums. Bold midrange. And clean, undistorted highs. All in a comfortable fit you can wear for hours. Solos are compact and incredibly lightweight and ready for your active lifestyle, gym work out, or frequent travel. The Monster Dr Dre Headphones design allows Solos to fit into the included compact carrying case. With Dr Dre Earphones getting a great music experience has never been easier. Now, a new headphone in the Beats tradition, Beats By Dr Dre in ear brings you amazing sound in a smaller, lighter on-ear design.
Or so it seemed. Although things started well, progress started to slow before the week was out.
Wondershare Video to DVD Burner will not only copy movies to DVD from LimeWire to improve your viewing experience, but also save much of your precious hard disc space.
nice good STOP KORUPSI dan SUAP di Indonesia Cara Membuat Radio Streaming Murah
I was lamenting to Micah about this one day in late November, and he said: “Dad, there are HTML parsers out there you know.
but also save much of yhair extensions suppliers hair manufacturers human hair manufacturers wholesale hair extensions wholesale hair weave our precious hard disc space.
Fearing your own code is an indicator that you are headed for ruin. This fear is followed by self-loathing, project-loathing, career-loathing, divorce, infanticide, and finally chicken farming.
Well, the wiki parser works the same way! Literals and !define variables are processed first, by a different pass of the parser. Then all the rest of the wiki widgets are parsed by the true parser. The reason that we had to do this is even more devilishly detailed; so I’ll spare you.
GHD australia have fairly very rated for rather a few of elements just like pattern durability and ease of use.
This article is truly relevant to my study at this moment, and I am really happy I discovered your website.
for adaptive cushioning and a smooth, soft and responsive ride whether you’re running on the practice field or on the road.
lv backpack have fairly very rated for rather a few of elements just like pattern durability and ease of use
Buy $10 Replica Designer Sunglasses with 3-day FREE SHIPPING Buy $10 Replica Designer Sunglasses with 3-day FREE SHIPPING Buy $10 Replica Designer Sunglasses with 3-day FREE SHIPPING
your website shows me some useful information,thanks for sharing.
This was a great post. I think that I will be able to use this in getting a more widespread focus on drug addiction and rehab. Thank you for sharing this information.
The best thing about purchasing on the web is you’re able to observe everything the actual offers, where in a store it can be challenging to type on the other hand her or his products to locate what’s right.
cadran noir et solide en acier inoxydable avec un bracelet noir brillant, réplique montre Omega peut se produire danspar rapport à ceux bijoux finement con?u montres a publié un éloge et le doute Gossip sur les bijoux et les montres replique montres de luxe la mode des plus classiques, voir le CD en noir réplique montre rolex pour montrer la force et de caractère, partout dans le vague replique de montre noire en conformité avec l’horloge ma?tre, transformée en aval montres repliques de la classique pour hommes. n’importe.Selon vague “Black à l’alambic” série de montres montres de luxe suisses à l’aide mouvement à quartz et un rendement supérieur. Caisse noire,
This is very nice.
Dunyan?n en büyük online okey oyunu bu sitede sizleri bekliyor. Gerçek kisilerle sohbet ederek okey oyunu oyna ve internette online oyun oynamanin zevkini cikar.
The best thing about purchasing on the web is you’re able to observe everything the actual offers, where in a store it can be challenging to type on the other hand her or his products to locate what’s right.
where in a store it can be challenging to type on the other hand her or his products to locate what’s right????
Very instructive and yet amusing account. I actually enjoyed this post. I did not know mercury was so dangerous, sheesh.
New Barcelona Home Jersey of the season Rosetta Stone spanish Discount is still red and blue and white, but stripes to become narrower than before on the chest there Qatar Foundation commercials, rosetta stone discounts United Nations Children’s Fund signs appeared of the underside of the back of the shirt, Barcelona Home Jersey is rare black, goalkeeper clothing is dark green.
Well, the wiki parser works the same way! Literals and !define variables are processed first, by a different pass of the parser.
you best choose fashion Louis Vuitton Damier Azur Stresa MM onsale.The Best Site to buy CHEAP Louis Vuitton Damier Azur Stresa PM .Also has Louis Vuitton Damier Azur Canvas Neverfull MM, Louis Vuitton Pochette Milla MM outlet that can provide to you.
These are times of finer houses,but more broken homes;
Online UK costume and fashion jewellery shop with, sry5try
Hello Friend,Whichever style of Fashion Shoes you’re looking for, classical, fashionable, lovely or the latest design, you can find your favorite designer shoes in www.dunkpage.com ,several days ago I bought one pair of shoes from there,It’s beautiful and very comfortable!
Beats by dr dre studio with look after talk in white. extra attributes on Monster Beats By Dr. Dre Pro Headphones Black a specific tri-fold design and design and carrying circumstance which make for compact and uncomplicated safe-keeping when not in use. Beats by dr dre solo .
have access to wiki text. Slim tables, on the other hand, cairns fire helmets
I learned about the new blog entry by viewing your Twitter content. Thanks for your updates there.
The article give me many useful information.thanks.I will come here frequently.
Thanks for such a wonderful Blog. I really get useful information about software support and various related aspects. Keep posting such good writings.
Defiantly this is really enjoyed for visiting the nice technology in this blog. I am very much satisfied by the info in this blog. Thanks a lot for sharing the nice info in this blog.
Nice update uncle Bob Your guide to the amber gemstone , its history and origins
nice technology in this blog. I am very much satisfied by the info in this blog. Thanks a lot for sharing the nice info in this blog.high quality headphones new design headphones
During the World War Rudi joined the German army while Adi continued making shoes for the soldiers and this brought a rift between the brothers. Ever since, neither the families nor the business have been united. Rudi floated his own shoe company Puma and the same year he introduced the first football boot named Atom. Herbert Burdenski from the West German team scored the first goal for his team wearing the Atom. Adi too formed his own company Adidas which had its fair share of recognition in the world of sports.
Canada Goose Outlet is Marmot 8000M Parka. The Marmot 8000M Parka is really a waterproof, breathable jacket with 800 fill canada goose jacket feathers. It truly is design and light colored shell is produced for trendy, but uncomplicated, protection from cold temperatures. Reinforced shoulders, elbows and adjustable waist and hem make the Marmot a perfect alternate for skiing and other outdoor sports that want fairly a bit of arm motion. The 8000M Parka weighs three lbs., comes in bonfire and black colours and might be stuffed and stored like a sleeping bag to your convenience.This is one of well-know and prime down jacket brands.Hope our friends like its!Like canada goose womens and Canada Goose Expedition Parka.There are wholesale canada goose.
Cloudsourcing combines on-demand business process outsourcing (BPO) with crowdsourcing technologies to enable companies to purchase quality BPO services on-demand through a pay-per-use model.
Wonderful posts are display is visible in Director of Operations Job Description this blog that to using the great technology Accounting Job Description is visible in this blog Graphic Designer Job Description I am glad to see this info and providing the amazing info is display in this blog that to utilize the different Legal Assistant Job Description services in this blog
I worked in the media from the late 30’s through the early 70’s. Politics in general became more liberal both nationally and within the state as the years passed.
Christian Louboutin Rolando Hidden-Platform Pumps Golden is a fashion statement – that’s sexy, it makes you look longer highlight, and it highlights the curves in the woman body and makes the body look more elegant and thinner without any diet.
?Brand: Christian Louboutin ?Material: Golden leather ?Specialty: Signature red sole ?Color: Golden ?Heel height: Approximately 130mm/ 5.2 inches high and a concealed 20mm/ 1 inch platform ?Condition: Brand New in box with dust bags & Original Box
Fashion, delicate, luxurious Christian louboutins shoes on sale, one of its series is Christian Louboutin Rolando Pumps, is urbanism collocation. This Christian louboutins shoes design makes people new and refreshing. Red soles shoes is personality, your charm will be wonderful performance.
This blog is very nice and informative. it is pretty hard task but your post and experience serve and teach me how to handle and make it more simple and manageable.
Thousands wholesale snapback hatswholesale, wholesale cheap hats ,Monster Energy Hats,NewYork Yankees Hats,cheap wholesale snapbacks on sale,Dc Hats at discount price for you
I am glad that you can show us so professional article about programming. I think it is very useful for use to study here. So. why not try the way to improve ourselves and make a good code. Don’t waste everytime you get to run the application. thanks.
This is very much happy for the great info is display in this blog that to using the amazing technology is visible in this blog. Thanks a lot for using the amazing technology is display in this blog.
Fudge anyone? 77 good post97
Fudge anyone? 78 hoo,good article!!I like the post!99
Nice content, I trust this can be a nice blog. Want to see fresh content next time. Many thanks for sharing this post around. Stay the best.