Linked by Eugenia Loli on Sun 14th May 2006 23:06 UTC
General Development The world is rapidly moving away from technology-based solutions toward end-user facilitation. Simple grammars provide a surprising solution to the problem of "driving" IT infrastructure to achieve business ends. In this article, Stephen Morris shows you how to use the interpreter design pattern to create a simple C++ grammar, which can be extended to produce surprisingly powerful capabilities.
Order by: Score:
business driven?
by evert on Mon 15th May 2006 07:53 UTC
evert
Member since:
2005-07-06

Business driven logic sometimes means no logic at all.

I rather prefer a sound technical approach above the fuss of marketing speak.

Reply Score: 1

Not everything is a pattern
by BryanFeeney on Mon 15th May 2006 08:46 UTC
BryanFeeney
Member since:
2005-07-06

Realistically a pattern is an enabling construct, without any fundamental algorithmic details behind it. This is just a basic introduction to tree based parsers, that isn't even very useful. If you want to make your application scriptable (and you'd need a good reason) a better bet would be to integrate either the Lua or Spidermonkey scripting engines, instead of reinventing the tree all over again.

Reply Score: 2

RE: Not everything is a pattern
by Bastian on Mon 15th May 2006 11:59 UTC in reply to "Not everything is a pattern"
Bastian Member since:
2005-07-25

Agreed. I use F-Script in most my applications, with uses ranging from configuration to allowing the user to add custom behavior, so I think I'm fairly familiar with the "grammar pattern," although I've been referring to it with slightly less buzzword-enabled words like 'scripting.' But the reinventing-boolean-algebra example he used to explain everything was so oversimplified that I really don't understand what the article was trying to tell me to do. The behavior he provides in the final example really isn't complicated enough to justify forcing the user to learn a(nother) scripting language; I can already think of one way to enable the user to ask the same question with a GUI.

Reply Score: 1

Seriously now...
by vinkelhake on Mon 15th May 2006 10:37 UTC
vinkelhake
Member since:
2005-12-16

Can you write a more retarded article intro than that? It's a pretty darn simple concept, why wrap it up in all that eBusiness-ROI-IT-solution boolsheet?

Anyway, the code itself is horrible. Does the author even know what the keyword 'explicit' means? Is he aware of std::string? Does the author know what a memory leak is? It's written in the old c-with-classes style that was popular 10 years ago. C++ has evolved since, this guy obviously haven't.

Reply Score: 4

RE: Seriously now...
by Get a Life on Mon 15th May 2006 20:14 UTC in reply to "Seriously now..."
Get a Life Member since:
2006-01-01

informit articles are worthless and are best avoided. If the synopses don't give it away, then the juvenile "my first tutorial" nature of the articles will. They're like little advertisements for books people can generally do better than.

Reply Score: 1

Philip Greenspun's Tenth Rule of Programming
by malkia on Mon 15th May 2006 15:29 UTC
malkia
Member since:
2005-07-17

"Any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp." — Philip Greenspun's Tenth Rule of Programming

http://en.wikiquote.org/wiki/Lisp_programming_language

Reply Score: 1

schala Member since:
2006-01-17

While I agree with you about Lisp, I was reading about this alternative C++ syntax:

http://en.wikipedia.org/wiki/Significantly_Prettier_and_Easier_C++_...

And I realized that, as this syntax makes very clear, C++ is basically a systems-programming version of ML, with a well-designed object system, and enough low-level features to write an operating system.

Sure, people write crap programs in C++, whether because they write C-in-C++, or think that everything should be object-oriented, or other similar reasons. But as awesome as Lisp is, there are definite benefits to static typing in some contexts, and programmers who understand that can use C++ to do amazing things that C or Java programmers can only dream of (and that Lisp simply isn't safe enough for).

Reply Score: 1

.
by corentin on Mon 15th May 2006 18:45 UTC
corentin
Member since:
2005-08-08

> The world is rapidly moving away from technology-based solutions toward end-user facilitation.

Bingo!

Reply Score: 1

Boolean algebra for whom?
by Shatai on Tue 16th May 2006 05:08 UTC
Shatai
Member since:
2005-09-27

Stephen Morris, in this wonderfully written cornerstone of modern technological journalism, unveils for us the secrets of turning a simple concept akin to "Hello World" into a world-class doctoral essay. Congratulations, Stephen Morris!

Reply Score: 1