Routine id (was: GOTO - A fresh perspective?)
- Posted by Mike Nelson <MichaelANelson at WORLDNET.ATT.NET> Feb 11, 2002
- 546 views
Kat writes: <snip> > Simply allowing backwards-looking target resolution would have meant > routine_id() wasn't needed. It would have been simple, imho, simply don't > raise an error for undefined word until it is still undefined at the end of the > compile. Somehow, to me, tossing in patches like "routine_id()" breaks the > vision of the language far more than a moderately restricted "goto" like Karl > made. If nothing else, Rob could have made the "routine_id()" internal, acting > by default on all functions and procedures, and simply said "from now on, > you don't need to define the function before you call it". But instead, he > added a new word to the language. </snip> All of this is true enough. However, if Rob had added forward references and not created routine_id the language would have evolved very differently. I can concieve of no possible way Win32Lib could exsist without routine_id, unless Rob had added event-handling features to Eu itself -- no doubt there would be much agument pro and con about whether and how to build WIndows GUI support into Euphoria. Similarly, all of the OOP schemes depend on routine_id -- I wrote one of them, I know. So then we'd have a debate between OOP advocates and opponents over whether Rob should add OOP features to Euphoria (and which scheme to choose). But due to the flexibility of the language (includinge the flexibitlity of routine_id), all these and much more can be done through libraries without changing Euphoria at all. The advantage of this is obvious. If you don't like Win32Lib, don't use it--if you find it too complicated, use something else (such as Andrea Cini's excellent lib) or write your own. If you want to program OOP style in Euphoria, download Object Euphoria--if you like the OOP idea but don't like OE, download something else or write your own. If in your opinion OOP is the worst thing that happend to programming, Euphoria doesn't require you to use it. And most important -- the performance penalty for Win32Lib, Object Euphoria or any other library is ZERO for the people who don't use them. This is untrue of ANY feature added to the interpreter itself; I know that in some cases the cost of a given feature is trivial, but it is never zero. Euphoria is fast and also easy to learn because of its essential simplicity and its logical consistency. Consider this. To create C++, Bjarne Stroustrup had to rewrite C. To create Object Euphoria, I had to write a single include file. Am I a better programmer than he is--hell no, he could code circles around me. Euphoria is perhaps 20 times easier to program in than C, that's all -- Mike Nelson