Man, it really sucks when you report a WTF and everybody defends it, doesn't it?
Personally, I prefer the example code...it is much more explicit, and exploiting relatively obscure syntactical decisions is a sure way to cause confusion. Impress people by doing it well, not by doing it short.
dasmb
@dasmb
Best posts made by dasmb
Latest posts made by dasmb
-
RE: Thought not required
-
RE: Condition framework/ludicrous design ....
You know, algorithms to express a graph of objects as a grammar or vica versa are pretty popular masters' thesis topics (search on the term "Abstract Syntax Tree") so most of the legwork for has already been done for you on this one...the real WTF is why the wheel was reinvented (and so badly).
A few simple guidelines to make anyone a better programmer:
1) If the problem's already well solved, don't solve it again unless it's absolutely necessary.
2) Don't think you can do better until you know everything it does.
3) Above all else, don't try to be clever. It won't seem that clever when it comes time to maintain. -
RE: When penny pinching gets really annoying...
This company I worked for a while back was pretty good with finding money for resources -- developers got new machines every two years or so and we usually had all the software we needed. But we were branching into a new field of development, potentially very lucrative but still sort of risky. My boss, sort of uneasy at buying anything sight unseen, arranged for me to get a huge stack of 90 day demos of all the major players' software, so I could try it out.
I made some really whiz-bang stuff off the demos, and wrote out what we needed to start working in the field. The number was pretty big (around $25k or so just for the software), but my boss agreed it was necessary if we were ever going to break in to the market. He just didn't want to spend all that money unless there was a pressing demand, so we dropped it.
About a year later, when somebody offered us a nice sum of money to be the pilot of our new software (the stuff we had only just played with, for 90 days). My boss assumed I could just use what I had -- the barely working, unpolished project I'd thrown together 270 days earlier with no experience and hardly any knowledge. I informed him that this swine would not levitate, and he'd need to buy at least half of the licenses so we could start working and more importantly start testing. I then went on vacation.
When I came back, there was a book on my desk. It was an introduction to the field of development, puzzling since I was already pretty well acquainted with it. Luckily, the accompanying post-it explained everything: "Book comes with a CD and 180 day academic license of everything, and it was only $40!"
(I think they're all licensed up now.)