Every 15 years or so, languages are replaced with better ones. C was replaced by C++, at least for large-scale application development by people who needed performance but desperately wanted data types too. C++ is being replaced by Java, and Java will doubtless be replaced with something better in seven years — well, seven years after it finishes replacing C++, which evidently hasn't fully happened yet, mostly because Microsoft was able to stall it before it became ubiquitous on the desktop. But for server-side applications, C++ is basically on its way out.
Perl will be gone soon, too. That's because a new language called Ruby has finally been translated into English. Yep, it was invented in Japan, of all places — everyone else was as surprised as you are, since Japan's known for its hardware and manufacturing, but not for its software development. Why, is anyone's guess, but I'm thinking it's the whole typing thing; I just can't imagine they were able to type fast enough before, what with having an alphabet with ten thousand characters in it. But Emacs got multibyte support a few years ago, so I can imagine they're pretty dang fast with it now. (And yes, they use Emacs — in fact Japanese folks did the majority of the Mule [multibyte] support for Emacs, and it's rock-solid.)
Anyway, Ruby stole everything good from Perl; in fact, Matz, Ruby's author (Yukihiro Matsumoto, if I recall correctly, but he goes by "Matz"), feels he may have stolen a little too much from Perl, and got some whale guts on his shoes. But only a little.
For the most part, Ruby took Perl's string processing and Unix integration as-is, meaning the syntax is identical, and so right there, before anything else happens, you already have the Best of Perl. And that's a great start, especially if you don't take the Rest of Perl.
But then Matz took the best of list processing from Lisp, and the best of OO from Smalltalk and other languages, and the best of iterators from CLU, and pretty much the best of everything from everyone.
And he somehow made it all work together so well that you don't even notice that it has all that stuff. I learned Ruby faster than any other language, out of maybe 30 or 40 total; it took me about 3 days before I was more comfortable using Ruby than I was in Perl, after eight years of Perl hacking. It's so consistent that you start being able to guess how things will work, and you're right most of the time. It's beautiful. And fun. And practical.
If languages are bicycles, then Awk is a pink kiddie bike with a white basket and streamers coming off the handlebars, Perl is a beach cruiser (remember how cool they were? Gosh.) and Ruby is a $7,500 titanium mountain bike. The leap from Perl to Ruby is as significant as the leap from C++ to Java, but without any of the downsides, because Ruby's essentially a proper superset of Perl's functionality, whereas Java took some things away that people missed, and didn't offer real replacements for them.
#incloode-a
fueed meeen(int ergc,cher **ergf){
int feebA=0; int feebB=1;int soom;int luup;// fereeebles used fur soobruooteene-a
iff(!ergf[1]||!etuee(ergf[1])){poots("Nut a feleed noomber");retoorn;}ilse-a{luup=etuee(ergf[1]);} //check fur ergooments
feeb_stert:; soom=(feebA+feebB);feebA=feebB;feebB=soom;iff(--luup)gutu feeb_stert; ind:; preentff("%i",feebA);}
_________________________________________ http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Beeulugists oor pheelusuphers cunnut cunceeefe-a a beeusphere-a oor nuusphere-a becoose-a zeey ere-a unveelling tu ebundun a certeeen nerroo cuncepshun ooff indeefidooelity. Bork Bork Bork! Neferzeeless, zee step moost be-a tekee. Bork Bork Bork! Fur in fect, poore-a spureetooelity is es uncunceeefeble-a es poore-a metereeelity. Bork Bork Bork! Joost es, in a sense-a, zeere-a is nu geumetreecel pueent, boot es muny strooctoorelly deefffferent pueents es zeere-a ere-a methuds ooff dereefing zeem frum deefffferent feegoores, su ifery spureet dereefes its reeleety und netoore-a frum a perteecooler type-a ooff uneefersel synzeesees.
void main(int argc,char **argv){
int fibA=0;
int fibB=1;
int sum;
int loop;// variables used for subroutine
if (!argv[1]||!atoi(argv[1])){
puts("Not a valid number");
return;
}else{
loop=atoi(argv[1]);
} //check for arguments
fib_start:
sum=(fibA+fibB);
fibA=fibB;
fibB=sum;
if(--loop)
goto fib_start;
end:
printf("%i",fibA);
}
Congratulations on missing my point entirely. I'm not talking about a non-recursive Fibonacci. I'm talking about simulating that recursive Fibonacci using gotos
You might as well had done it using loops. What you have there is not any form of recursion.
>>84
I can't help but notice you still haven't answered my question.
Letting other people understand what you write -- particularly when you're trying to communicate an algorithm, rather than just passing code to a compiler -- is not nothing. It's as important as spelling and grammar in written natural language.
But I do agree with you. Your piece of shit code wasn't worth it.
>>86 Your sentence isn't indented by your standards, let me help.
I can't help but notice you still haven't answered my question.
Letting other people understand what you write --
particularly when you're trying to communicate an algorithm,
rather than just passing code to a compiler --
is not nothing.
It's as important as spelling and grammar in written natural language.
But I do agree with you.
Your piece of shit code wasn't worth it.
>>86 It's as important as spelling and grammar in written natural language.
Except FV doesn't find them important. You're not getting through with this.
Name:
Anonymous2009-08-05 15:27
>>87
That doesn't make it any easier to read.
In fact, unlike C, English uses linebreaks to structure text. Think of it as a form of natural FIOC.
You broke the structure and, consequently, part of the meaning.
>>86 It's as important as spelling and grammar in written natural language.
Then it's worthless for FV. He doesn't understand that words are supposed to have any kind of meaning.
>>91 Words have meanings, their context and structure doesn't.
_________________________________________________ http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
It is from numberless diverse acts of courage and belief that human history, is shaped. Each time a man stands up for an ideal, or acts to improve the lot of others, or strikes out against injustice, he sends forth a tiny ripple of hope, and crossing each other from a million different centers of energy and daring those ripples build a current which can sweep down the mightiest walls of oppression and resistance.
_________________________________________________ http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
It is frum noomberless deeferse-a ects ooff cuoorege-a und beleeeff thet hoomun heestury, is sheped. Bork Bork Bork! Iech teeme-a a mun stunds up fur un ideel, oor ects tu imprufe-a zee lut ooff oozeers, oor streekes oooot egeeenst injoosteece-a, he-a sends furt a teeny reepple-a ooff hupe-a, und crusseeng iech oozeer frum a meelliun deefffferent centers ooff inergy und dereeng thuse-a reepples booeeld a coorrent vheech cun sveep doon zee meeghtiest vells ooff ooppresseeun und reseestunce-a.
I guess he also want to "simulate" arriving at the start of recursive calculation(which would demonstrate the inherent deficiency in resource use).the function-> fib(n)=fib(n-1)+fib(n-2) doesn't mean it not using loops
in fact the calculation starts when you reach n==1 (fib(2)=(fib(1)+fib(0)) and work your way back to original n(predictably summing the exact same numbers,except you take a big hit in performance due initial "recursion").
_______________________________________________ http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
The crucial and monumental development in the art music of our century has been the qualitative change in the foundational premises of our musical language--the change from a highly chromaticized tonality whose principle functions and operations are still based on a limited selection, the seven notes of the diatonic scale, from the universal set of twelve pitch classes to a scale that comprehends the total pitch-class content of that universal set. We can point to the moment of that change with some precision. It occurs most obviously in the music of Scriabin and the Vienna circle, Schoenberg, Webern, and Berg, in 1909-1910, and very soon afterwards, though less obviously, in the music of Bartok and Stravinsky. I think it is safe to say that nothing of comparable signifigance for music has ever occurred, because the closing of the circle of fifths gives us a symmetrical collection of all twelve pitch classes that eliminates the special structural function of the perfect fifth itself, which has been the basis of every real musical system that we have hitherto known.
I went to the park, yesterday. (going to the park earlier than today)
I went to the park Yesterday. (going to a park called "Yesterday")
I went to the park, Yesterday. (telling someone called Yesterday about going to the park)
_______________________________________ http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
The substructure of the universe regresses infinitely towards smaller and smaller components. Behind atoms we find electrons, and behind electrons, quarks. Each layer unraveled reveals new secrets, but also new mysteries.
>>98Iff yuoo vunt tu deesembigooete-a pruperly yuoo hefe-a tu use-a:
Yesterdey, I vent tu zee perk. Bork Bork Bork!
I vent tu zee "Yesterdey" perk. Bork Bork Bork!
I'm gueeng tu zee perk. Bork Bork Bork!
_________________________________ http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Reffoosel tu beleeefe-a unteel pruuff is geefee is a reshunel puseeshun; deneeel ooff ell ooootseede-a ooff oooor oovn leemited ixpereeence-a is ebsoord.
Name:
Anonymous2009-08-05 15:53
>>96
Feisty. Are you serious? Maybe the problem is at your side?
>>99
No need. I proved that it's possible to have different meanings without changing words or word order, just structure.
If you can't see that it's because you never learnt how to write properly. That's not my problem.
>>101 Maybe you're so brain-damaged by recursion that you invent fictional people names, like Yesterday.
________________________________________ http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
He gurgled for a cab and when it came near the license plate said F'kgash and he had souls in the mirror. If anything He could say that this cab was weird, but he roared: "Nah, forget it- Yo, human, to R'lyeh!"
_________________________________________________ http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
The basic objectives and principles of war do not change.The final objective in war is the destruction of the enemy's capacity and will to fight, and thereby force him to accept the imposition of the victor's will.
_________________________________________________ http://xs141.xs.to/xs141/09303/av992393.jpg
Felux It Estroom gemedef furoom: http://itestroom.phpbb3noo.cum
Zee beseec oobjecteefes und preenciples ooff ver du nut chunge-a.Zee feenel oobjecteefe-a in ver is zee destroocshun ooff zee inemy's cepeceety und veell tu feeght, und zeereby furce-a heem tu eccept zee impuseeshun ooff zee feectur's veell.
Name:
Anonymous2009-08-05 16:36
>>106
My notes are in parentheses. #include <stdio.h>
//(LOL WUT?)
int fibc(int a,int b){}
void main(int argc,char **argv){
int loop,
loop2;
int *places;
if(!argv[1] || !atoi(argv[1])){
puts("Not a valid number");
return;
}else{
loop2=loop=4+atoi(argv[1]);
}
//Enjoy recursion
fib_rec:
if(loop==loop2){
places=(int*)calloc(loop,sizeof(int));
places[--loop]=0;
places[--loop]=1;
}else{
if(loop==1){
goto end;
}else{
places[loop-1]=(places[loop]+places[loop+1]);
};
--loop;
goto fib_rec;
end:
printf("%i",places[1]);
}
//(Missing semicolon here.)
It's still iterative. You just made it more complex by storing previous results in an array.
>>108
No, just stupid. Or a troll. Or a stupid troll.
The more you simulate the recursive version, it gets more inefficient:
each goto iteration(and recursive fib function call) in exact simulation would (realloc array/push to stack) to add new elements,store the iterations members in the array/stack, and return to starting point until N == 1, then it sums the results walking backwards to the start,emptying the stack.
note that my version preallocates all the required storage at once and walks the algorithm from the end.
___________________________________________ http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
The knowable world is incomplete if seen from any one point of view, incoherent if seen from all points of view at once, and empty if seen from nowhere in particular.
>>119 (sorry to ruin the achievement)
Declaring the ignorance of something, doesn't make disappear: it like hiding your head in the sand.
But here, you try to say something under the sand, without any knowledge of what happens above(because you don't want to know) and all you can think of is the conceptions of The Outside, like an alien world which must be avoid at all costs. Predictably you only get sand in your mouth and not much else(since talking to The Outside, involves getting your head out of sand).