Re: question on func equal_from
- Posted by CChris <christian.cuvier at a?riculture.?ouv.fr> Jul 28, 2007
- 685 views
ChrisBurch3 wrote: > > jacques deschênes wrote: > > > > I'm not found of pushing everything in the core interpreter, it will become > > overwheighted and more difficult to maintain. > > A this time I would rather see: > > 1) adding object support > > Sorry, I feel very strongly about this. Euphoria is NOT an OOP language, and > should NEVER become so at its core. Using the add on libraries is fine for > those > that wish to do so, otherwise get off 'my' procedurals. There are many other > simpler > clearer ways of resorting to solutions rather than resorting to overly complex > and > needlessly obscure object orientated techniques - this is not the spirit of > Euphoria. > > > > 2) adding error handling support > > Do we not already have that? Admittedly it may not be the catch all that other > languages have, but does it not serve its purpose? Is it not flexible enough > to adapt with a little ingenuity on the part of the programmer? > > > > > As those 2 are parts of most used modern language. > > Some are afraid of oop but it's really easy to catch. > > Again, sorry, I have to disagree. Its not easy to learn, and it adds a totally > unnecessary > level of complexity to any programming task. All of the arguments in favour > of > oop can be equally dismissed by any procedural technique. If you want to use > objects > use an OOP language (C++, C#, Delphi, Visual Basic etc etc - Euphoria is not > trying to compete with these - is it?) > > Regards > > Chris > > > > jacques Deschênes > > > > > > Salix wrote: > > > > > > jacques deschênes wrote: > > > > > > > > > > > > equal_from() seem pointless to me as one can do, as you mention in your > > > > own > > > > message: > > > > }}} <eucode> > > > > r = match(x,s)=i -- no exertal perenthesis needed > > > > </eucode> {{{ > > > > > > > > regards, > > > > jacques deschênes > > > > > > > > > > I do not think so. > > > > > > Let's assume i=1000000. It means that x starts at position 1000000 in > > > sequence s. The match routine needs to go through the first 999999 > > > elements of s to be able to return a result. (The result is 1000000.) > > > > > > It is obviously a lot more time than jumping to position 1000000 and > > > to see if x is there. (But to jump there you would need to make sure > > > a few things including that 1000000<=length(s) and 1000000>=1.) > > > > > > I haven't included a test code here but give a try. > > > > > > So, my question remains. Why don't we have equal_from if speed > > > was such an important issue in case of find_from and match_from? > > > > > > Cheers, > > > > > > Salix > > > > > > P.S.: Even match_from doesn't replace equal_from because length(s) > > > can be easily 999999999 or something like that. While I completely disagree with each and every statement above, let me add a couple remarks. Euphoria doesn't have to be an OO language, and never has been. However, why shouldn't it _allow_ OO programming? If you don't like it, just don't use the relevant feature, why do you want to force your opinion upon us? And if it allows OO programming, it can hardly be done in external libraries. It can be done, but so inefficiently. For _certain_ types of programming tasks, OO makes coding lightning simple and maintainable. While everything OO can be done in a non OO way - machine language is not OO after all -, it is so at the cost of hacks, convoluted execution flows and much more pain, for a slowed down result. Why should we have to choose between Euphoria and C++? Let the language accommodate both types of programming. After all, this is what Methodica is trying to achieve if I got it right - I can't wait to see something rolling off from there. CChris