![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Professional Programmer
|
Quote:
Love perl by the way. As for what language you should use, perl is better if you really have to do some crazy dirty work in collecting data for your webpage. Otherwise, go with php.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;} |
|
|
|
|
|
|
#12 | |
|
Programmer
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4
![]() |
Quote:
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup |
|
|
|
|
|
|
#13 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Perl is a well-designed language. Particularly when you consider that it began life as a mere report generator and was grown from there. Wall grew it with great good sense and a helluva smart attitude. Maybe it takes a certain kind of perception for the underpinnings to bubble through and draw notice.
That said, I prefer PHP currently. In my case, the reasons are simple. I'm new at PHP. Because of its strong C antecedents, I can search the manual for a function using the C function name as a starting point. I not only very often find it (though one has to be aware it won't be an identical twin), I often find in the same area an even better solution.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#14 |
|
Programmer
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4
![]() |
Hi,
@DaWei there are several pitfalls especially when your roots lie in C. I stumbled over this one a time ago. The handling of eof during file-io-operations in php. In C the eof-flag is set AFTER you tryed to read beyond the end of the file. In PHP this is not the case. It recognizes the end of file BEFORE you attempt to read beyond it. I was very confused about that. The syntax is so alike that i simply forgot for a moment that i was coding in php. But i believe that the php-reference warns c-programmers about that. This has nothing to do with my vote..... just wanted to mention that.
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup |
|
|
|
|
|
#15 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Yeah, I'm aware of the drawbacks, thus my comment that they won't be identical twins. Pitfalls accompany any unwarranted assumptions. Another good example is "strtok". The warts that accompany the C/C++ version have been mostly burned away in the PHP version. It would be absolutely foolhardy to go with a label and not read the documentation. Apparently there are a lot of foolhardy people about, lol. My little comment goes more toward explaining why my learning curve for PHP was very steep (ability gained, versus time, I guess "steep" could be misconstrued), compared to my learning curve for Perl. Obviously, the Perl helped too, since there are antecedents there, also.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#16 | |
|
Professional Programmer
|
Quote:
To say that perl is a particularly well-designed language is a bit of a laugh, probably just because of all the things it's collected through the decades in order to remain viable, but to say that it's a bad language is also far from the truth.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;} |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|