Re:Use a real language.
on
Perl Medic
·
· Score: 1
print substr_count("string"," ") + 1;
?>
e.g. "this is a test" --> 3 spaces, 4 words.:)
Re:Use a real language.
on
Perl Medic
·
· Score: 2, Interesting
Let's see (just a real life thing I tested earlier today... so yes, before this article got published)
Running a "BOT" on the MSN Messenger network. Sending a 300 meg ISO to it, memory only "shot up" by an "amazing" 100KB. Average speed on sending, 150KB/s (as good as it get's on my connection).
Now we hook up another conversation. Response time is excellent, transfer is not suffering nor are other connections. Ping time is 0.0788 seconds (that is, me server perl app, so it has to pass 4 "pipes", 2 to my app, 2 back to me).
CPU usage stayed below 5% all the time. . The script has been running for nearly 3 days now, too. I'm sure your C app can shave off an amazing 0.01 something seconds and minimize memory usage to maybe only half. Point remains, Perl isn't slow when well written:)
Re:Perl != maintainable
on
Perl Medic
·
· Score: 1
Fairly easy. I work on some with a friend (which, even though a bit unrelated, is at the other end of the planet). I work on it for a bit, then swap code and he works on it. We have always been able to read each others code perfectly fine even though we have different ways of writing Perl.
We don't usually do weird stuff, either ("Keep it simple, Stupid!") so I think the code would be fairly simple for someone else to read. If it were open source, that is.
Though I don't know very much Perl at all, it looks like map{} can be done with array_map. For grep{} with regular expressions, there's preg_grep and for the general case, array_filter.i
array_map is great, but requires an extra function. map{} can handle pretty much any perl code instantly, without any extra subs or other weird constructs. While it's not a "real" problem, I am annoyed at PHP for the fact that I have to write a whole function for every simple map I want to perform, whereas perl can do them in a line. For larger projects, you might even want to create a whole file filled with just those functions.
preg_grep is great, too.. But lacks code support. For example, one could use functions, or any other expression that returns something (or nothing, undef) in Perl, whereas preg_grep only does regular expressions. array_filter is great too, but again requires additional functions.
This also immediatly shows the problem with PHP: Why does it require a gazillion functions for a couple of tasks that only one function could quite well accomodate? IMHO, this is mainly the reason for the "core bloatness" of PHP; the PHP developers have created a function for pretty much every simple task (and a whole lot of functions so obscure you will probably never will be able to use).
For example, you can do php.net/explode or php.net/strings and it'll take you to the proper pages. It's an example of documentation done right and while it does not address the issues you brought up, it does make them more bearable
As for the documentation, yes, I love the way PHP has set it up. Perl's manpages are nice, but still harder to read and slower to access. The php.net/function redirect is a very nice idea, indeed:)
On a sidenote, I still use PHP frequently when creating simple websites that don't need the power of Perl or need to quickly done. PHP is great for starters, but eventually you will want to try something else.
Okay. Sure. PHP does give some advantages over Perl.. To lazy programmers that is. Really, PHP has over 3125 core functions, while Perl has "only" some 150. Include a module and whoop, some more functionallity, including only those things you need.
Really, how often do you have to look up a PHP function's working (or even name, hence PHP isn't very consistant, something2something, something_to_something, somethingtosomething... the list goes on)? When I haven't worked with PHP for a while that starts to faint. Perl never does.
Oh and, rewriting a map{} and grep{} is left as an exercise to the reader;)
Re:Perl != maintainable
on
Perl Medic
·
· Score: 1
Maybe you should learn how to write maintainable Perl scripts/apps then.
I too have used for nearly 2 years now and have never had a problem with maintainabillity of one of my scripts. Not even of those from the very beginning.
... This years intergalactic golf competition has started with a complete revamp of the course including a new hole deep into the galaxy!
This looks like a promising season to me, so everyone, get your space-clubs out and try not to hit your little ball into that newly formed gas cloud!
Oh, and, we appologize 2.2 billion year delay of "this" years golf magazine from outer space.
paragraph - Pronunciation Key (pr-grf)
n.
1. A distinct division of written or printed matter that begins on a new, usually indented line, consists of one or more sentences, and typically deals with a single thought or topic or quotes one speaker's continuous words.
2. A mark ( ) used to indicate where a new paragraph should begin or to serve as a reference mark.
3. A brief article, notice, or announcement, as in a newspaper.
May I kindly point out that in MSN Msgr 7 there is a so called "Shield.xml" file that is being sent over the NS ("Notification Server", the main server that handles login, contactlist, etc) which is able to disable certain features?
For example, they did a testing "drill" in the BETA program not too long ago where they disabled Winks and DDPs, in another drill they disabled all clickable links. This in case a widespread virus would hit, they had the power to force the MSN Messenger 7 clients to stop accepting such material. Sure this can be circumvented by either a "man in the middle" or something similar, but if that happens then your PC has already been compromised.
Also, the dreaded.pif links have been disabled server-wise (all your messages containing ".pif" immediatly terminate the connection). On top of that there is file extension blocking in MSN Messenger 7, sending an exe for example will fail because the file is automatically being rejected. Microsoft can also force certain clients to be updated, for example when the PNG exploits appeared in the PNG library used by Messenge rthey forced 6.2 users to upgrade to the latest build. When there was an exploit found in the first leaked build of MSN Messenger 7 they disabled thae build from logging in as well (even though the blocking could be circumvented by a so called "CVR Patch", made by me;-).
It's not the companies which create the products are responsible anymore, they already do their best; instead, the users need to "grow up". There are dangerous links, they should learn about that. There are tons of patches out there to circumvent the protection put there by Microsoft. If a user applies those then hell I dont blame Microsoft if the user gets infected, its the users own stupid fault because they dilebaretly crippled the programs security features.
As for Trillian vs MSN argument, I find that Trillian and other clients (like gAIM, which for example cna't view DPs of people who dont have YOU on their contactlist while there is no technical limitation to this) still lack certain features I like to use. Sure, if sending messages is all you need then go with either, but I still prefer the official client over the 3rd party applications. They just don't cut it. Yet.
Not to mention that the toolbar and what not more are OPTIONAL. Or did you miss those checkboxes and license agreement while racing through the setup like any John Doe does nowadays?
Absolutely 100% true. Mod parent up :)
print substr_count("string"," ") + 1;
:)
?>
e.g. "this is a test" --> 3 spaces, 4 words.
Let's see (just a real life thing I tested earlier today... so yes, before this article got published)
:)
Running a "BOT" on the MSN Messenger network. Sending a 300 meg ISO to it, memory only "shot up" by an "amazing" 100KB. Average speed on sending, 150KB/s (as good as it get's on my connection).
Now we hook up another conversation. Response time is excellent, transfer is not suffering nor are other connections. Ping time is 0.0788 seconds (that is, me server perl app, so it has to pass 4 "pipes", 2 to my app, 2 back to me).
CPU usage stayed below 5% all the time. . The script has been running for nearly 3 days now, too. I'm sure your C app can shave off an amazing 0.01 something seconds and minimize memory usage to maybe only half. Point remains, Perl isn't slow when well written
from the my-password-is-***** dept.
Has a weak password.
Fairly easy. I work on some with a friend (which, even though a bit unrelated, is at the other end of the planet). I work on it for a bit, then swap code and he works on it. We have always been able to read each others code perfectly fine even though we have different ways of writing Perl. We don't usually do weird stuff, either ("Keep it simple, Stupid!") so I think the code would be fairly simple for someone else to read. If it were open source, that is.
Though I don't know very much Perl at all, it looks like map{} can be done with array_map. For grep{} with regular expressions, there's preg_grep and for the general case, array_filter.i
:)
array_map is great, but requires an extra function. map{} can handle pretty much any perl code instantly, without any extra subs or other weird constructs. While it's not a "real" problem, I am annoyed at PHP for the fact that I have to write a whole function for every simple map I want to perform, whereas perl can do them in a line. For larger projects, you might even want to create a whole file filled with just those functions.
preg_grep is great, too.. But lacks code support. For example, one could use functions, or any other expression that returns something (or nothing, undef) in Perl, whereas preg_grep only does regular expressions. array_filter is great too, but again requires additional functions.
This also immediatly shows the problem with PHP: Why does it require a gazillion functions for a couple of tasks that only one function could quite well accomodate? IMHO, this is mainly the reason for the "core bloatness" of PHP; the PHP developers have created a function for pretty much every simple task (and a whole lot of functions so obscure you will probably never will be able to use).
For example, you can do php.net/explode or php.net/strings and it'll take you to the proper pages. It's an example of documentation done right and while it does not address the issues you brought up, it does make them more bearable
As for the documentation, yes, I love the way PHP has set it up. Perl's manpages are nice, but still harder to read and slower to access. The php.net/function redirect is a very nice idea, indeed
On a sidenote, I still use PHP frequently when creating simple websites that don't need the power of Perl or need to quickly done. PHP is great for starters, but eventually you will want to try something else.
PHP?! PHP?!?!
;)
Okay. Sure. PHP does give some advantages over Perl.. To lazy programmers that is. Really, PHP has over 3125 core functions, while Perl has "only" some 150. Include a module and whoop, some more functionallity, including only those things you need.
Really, how often do you have to look up a PHP function's working (or even name, hence PHP isn't very consistant, something2something, something_to_something, somethingtosomething... the list goes on)? When I haven't worked with PHP for a while that starts to faint. Perl never does.
Oh and, rewriting a map{} and grep{} is left as an exercise to the reader
Maybe you should learn how to write maintainable Perl scripts/apps then. I too have used for nearly 2 years now and have never had a problem with maintainabillity of one of my scripts. Not even of those from the very beginning.
... This years intergalactic golf competition has started with a complete revamp of the course including a new hole deep into the galaxy! This looks like a promising season to me, so everyone, get your space-clubs out and try not to hit your little ball into that newly formed gas cloud! Oh, and, we appologize 2.2 billion year delay of "this" years golf magazine from outer space.
It's called "time zones". Google it.
paragraph - Pronunciation Key (pr-grf) n. 1. A distinct division of written or printed matter that begins on a new, usually indented line, consists of one or more sentences, and typically deals with a single thought or topic or quotes one speaker's continuous words. 2. A mark ( ) used to indicate where a new paragraph should begin or to serve as a reference mark. 3. A brief article, notice, or announcement, as in a newspaper.
May I kindly point out that in MSN Msgr 7 there is a so called "Shield.xml" file that is being sent over the NS ("Notification Server", the main server that handles login, contactlist, etc) which is able to disable certain features?
.pif links have been disabled server-wise (all your messages containing ".pif" immediatly terminate the connection). On top of that there is file extension blocking in MSN Messenger 7, sending an exe for example will fail because the file is automatically being rejected. Microsoft can also force certain clients to be updated, for example when the PNG exploits appeared in the PNG library used by Messenge rthey forced 6.2 users to upgrade to the latest build. When there was an exploit found in the first leaked build of MSN Messenger 7 they disabled thae build from logging in as well (even though the blocking could be circumvented by a so called "CVR Patch", made by me ;-).
For example, they did a testing "drill" in the BETA program not too long ago where they disabled Winks and DDPs, in another drill they disabled all clickable links. This in case a widespread virus would hit, they had the power to force the MSN Messenger 7 clients to stop accepting such material. Sure this can be circumvented by either a "man in the middle" or something similar, but if that happens then your PC has already been compromised.
Also, the dreaded
It's not the companies which create the products are responsible anymore, they already do their best; instead, the users need to "grow up". There are dangerous links, they should learn about that. There are tons of patches out there to circumvent the protection put there by Microsoft. If a user applies those then hell I dont blame Microsoft if the user gets infected, its the users own stupid fault because they dilebaretly crippled the programs security features.
As for Trillian vs MSN argument, I find that Trillian and other clients (like gAIM, which for example cna't view DPs of people who dont have YOU on their contactlist while there is no technical limitation to this) still lack certain features I like to use. Sure, if sending messages is all you need then go with either, but I still prefer the official client over the 3rd party applications. They just don't cut it. Yet.
Not to mention that the toolbar and what not more are OPTIONAL. Or did you miss those checkboxes and license agreement while racing through the setup like any John Doe does nowadays?
In 1950 they were still swimming around in oceans.. you know :)
Wouldn't it take nearly 50000 years for the light to reach us in the first place? *wonders*
Hoorah, more stuff to waste oil on -_- But nice nevertheless
http://neowin.net/comments.php?category=main&id=23 076#comment261899
Humtidum.. *Whistles*
As I can seem to edit my post: http://www.bot2k3.com/shell.gif
In MSN Messenger typing shell:\windows\system32\calc.exe prompted me to download my own calculator, with all the latest patches in place.
You mean the thing in my backyard is not Atlantis?!