Perl Turns 25
Several readers sent word that the Perl programming language turned 25 today. In his commemorative post at the Perl Foundation's website, mdk wrote,
"So what does the future hold for Perl? Well I don't have a crystal ball but I cannot see the language fading from usage in the next quarter century, the truth of the matter is that even though there are languages that can do some of the things that Perl does, some of them do some things better, others do things Perl wasn't designed for, there is no language that has been designed to do the things that Perl is very good at doing. No language in the current scripting languages seems to have the flexibility, maturity and extensibility of Perl. The main power of Perl has always been its ability to quickly adapt, and be adapted, to suit purposes. ... The greatest challenges we will face for Perl is a shifting end-user base that will become more reliant on devices that are feature focused but crippled in application choice, the rise in mobile devices will continue and Perl will need to evolve to work with that. A better challenge for us to face would be the integration with electronically aware, and connected devices and systems, the apocryphal internet of things, in this Perl could be a powerful tool. I also believe that the more we see a divergence of language uses in the other scripting languages the more they will face issues in their core designs, issues that Perl avoids due to its malleable nature, what some believe is the crippling factor for Perl is likely to be its saving grace as it has the power and flexibility to cope with the shifting goalposts of an increasingly technologically reliant world."
I recently became a fan of perl as my goals changed towards things it excels at - sticking together big other functionalities easily.
Why guess when you can know? Measure!
then Perl will be for a while too. Happy Birthday Perl. Your prime was memorable, and now you can just ask those kids to get off your lawn.
"The greatest lesson in life is to know that even fools are right sometimes" - Winston Churchill
Perl is few programmers' idea of an elegant language, but it gets the job done quickly and easily in situations where you'd otherwise be racking your brain and scrolling through endless Google hits to figure out how do it with sh, awk, and sed.
When the WWW first exploded into the public consciousness, there was a very simple standard called CGI for returning dynamic content. Although CGI apps could be written in practically any programming language, the use of Perl was so dominant that newbies used to post questions like "Where can I learn about this Perl CGI language?"
...And is sexier than ever.
If you want news from today, you have to come back tomorrow.
I wrote an app in Perl once. It was the only language that I could get to reliably connect to MSSQL from Linux.
It was fun to write, but I go back and look at the code now and it looks like Greek.
On the upside it's been running for over 5 years and having no problems at all.
Perl where are you tonight
how can I now run scripts on my own
I searched the filesystem
even looked in slash sbin
They rm'd the sym link and pffft you wuz gone
Wansu, th' chinese sailor
Please educate me on the camel icon for perl. I do not understand?
FTW!
Buzzing the information Superhighway at Warp speed
I remember when Perl was the workhouse behind all custom web server development. One of the few times I had "fun" writing code. Such a cryptic looking language that made perfect sense the moments you are writing it and completely alien days later.
Runesabre
Enspira Online
What can perl do that newer languages such as python and ruby can't do, and do more readably/maintainably?
I understand about path dependence and sunk costs, which is why we still have COBOL, I'm asking about language features that are unique to perl.
He doesn't forsee a time when Perl 6 is ever released.
Let the obfuscated congratulations begin.
Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
http://moritz.faui2k3.org/tmp/perl-cake.jpeg
the "guy before me" left a lot of undocumented Perl code. Some short scripts, some that are pretty involved.
I wonder how much easier it would be to understand the code were had the scripts been written in something else? Python?
On one hand, this is cool -- this is just the excuse I needed to learn Perl -- it is my job. On the other, it pisses me off that there are virtually no comments.
From an outsider perspective (not a Perl master at this time), Perl seems to me to be a distillation of Unix, albeit filtered through the idiosyncrasies of Larry Wall; the gift of Perl is brevity (and not having the declare the size of an array is pretty sweet, too).
if __name__=="__main__",
you'll get your turn, Guido.
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
My first exposure to Perl was 15 years ago, when I was doing 'web' programming (actually, writing dinky CGI scripts), using some really primitive library (at the time, CGI.pm was "advanced")
Maybe I'm just thick, but coming from more conventional language, I never 'got' context, or how to do OO properly in Perl. I simply was never able to form a mental model of how to use it correctly.
I never did use Perl for personal coding after that (went straight to Python, because at least I could get my head around the syntax and type system).
which perl? the one that everyone uses and the author abandoned or
perl 5?
the rise in mobile devices will continue and Perl will need to evolve to work with that
Does this mean Perl is considering to jump on to the tablet bandwagon? I cannot even imagine what that would mean for a programming language. All I do know is that we have lost many a great seamen to the sirens of tabletia. Shipwrecks, shipwrecks everywhere.
FCKGW 09F9 42
a good example of why perl is awesome
eval unpack u=>q{E')I;G0@7%[2&%P'D@0FER=&AD87D@4"%;GT[97AI=}
When considering a new project, I look first for libraries I want to use. CPAN has the most commonly used ones, but get a little obscure, and you're out of luck. For instance, CPAN has OpenGL, but not OpenSceneGraph. Then I find out what languages interface with them. It quickly narrows down until maybe one language is left, and most often that language is C/C++. Sometimes no languages are left, and then I have to decide if I want to go through the pain of linking multiple languages, or search for more libraries. I like Perl's data types and regular expressions, but the pain of interfacing with a C library is greater than the convenience of not having to hack up custom hash functions and not bother with dynamic memory management. At least there's PCRE.
Perl 6 is supposed to address this issue. Seamless interfacing with any C/C++ libraries. If it works, would make a lot of CPAN redundant. Been waiting for Perl 6 for years now.
Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
Okay, so let's have a roll call of those of us using Perl 6 in production.
Hands?
Anybody?
Kriston
Sounds like Perl. Powerful, accessible to a complete beginner, reliable, and practically unmodifiable once written.
Give me Classic Slashdot or give me death!
The syntax is unreadable, of course. And Perl 6 seems to have been rejected by the market. Still, it's a vast improvement over shell scripts.
That's partly because it was your first (or one of your few) programs in Perl. You likely made things more complicated than needed for lack of knowledge and experience.
I've always said that Perl is a good fit for programmers who can recall dozens of "idioms" (memes), and keep their understanding of its unique semantics fresh. Things like keys %{ {map {$_=>1} @list} } (implementing unique(@list)) and internalizing that every expression is ultimately evaluated as a list. Some are silly, but there's little argument about its expressiveness and flexibility.
This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
I believe an honorable mention of C is needed if we're discussing anniversary years.
Some people say Perl is a write-only language that is slowly losing importance in comparison to Python. It seems that it is the CPAN library that is important, not the Perl language.
I was waiting 4 years for Perl 6 to come, but she's barely a whisper in the programming world today. I think perl is simply too complex for the casual programmer. That complexity gives a lot of power. I was hoping for Perl 6 to fix the object oriented problems, but I gave up, and felt better. To this day, I still miss the power of perl.
Having been hard core perl for many years and built and sold businesses based on it I can attest that it is a capable platform. However, in my experience, good perl developers have become hard to come by and are typically more senior and hence more expensive. Additionally, perl (right or wrong) does not have a reputation in IT as cutting edge or capable and when seeking investment or taking a company to market gives the impression of development team stuck in ancient technologies for which few experts can be found. That and the tiresome nature of hack like coding fades to make perl more relevant (inside-out perl objects for example) prompted me to use python in my most recent undertakings and there is a palpable improvement in the ecosystem and respect level. Developer supply is a key determinant in which language and platform to use and sadly Perl's lack of sex appeal has become limiting.
Personally, I exclusively use Perl to re-factor C++ code with regular expressions.
It's like a better sed.
Perl's strength is that it's expressive. It's not a language which is easy to learn or which generates heavily optimized code.
In the demo phase, you're not really worried about performance. The goal is to have something working as quickly as possible, and not worry too much about how fast it runs, or how much memory it takes. Overspec your demo system for the time being (ie - make it really fast and install lots of memory), and once you have a reasonable interface go back and recode it in a simpler language which can be more easily optimized.
Languages which are simple to learn (c++, for example) are generally not very expressive. You end up wasting tons of time debugging issues of memory allocation, library interface details, and datatype conversion.
Languages which are expressive are a little harder to learn, but any individual line in the expressive language does a lot more. Since you are writing fewer lines, and since the fewer lines do more, you end up making programs more easily and in less time.
Yes, the programs will execute a little slower, but as mentioned, this is not important in the demo stage. Your productivity will be much higher.
And there are lots of places where performance simply doesn't matter. Scripts usually fall into this category.
Perl was written by a linguist, not an engineer. As such, it's harder to learn (it's got tons more keywords and context), but once you get the hang of it it's much more expressive. The following single line:
@Lines = sort { $a->{Name} cmp $b->{Name} } @Lines;
unfolds into several lines of C++, plus a subroutine definition with datatype definitions. The following line:
@Files = ;
can be implemented using one of over a dozen possible library calls in C++, but is builtin in perl. You don't have to look up the library call interface specific to your system.
Dafuq?
You do realize that the creator of Python's name is Guido van Rossum, and it's not a racial slur, right?
And, in python:
list = [1, 1, 2, 2, 3, 3, 4, 4, ]
unique = set(list)
Which is more readable?
I only use perl for small projects, utilities, converters, code generators and the like.
Have lost track of the number of times I've had to open specialized binary files or muck with transforms I hardly even understood only to quickly find exactly what was needed from CPAN archive every time.
I don't think I could ever trust myself to write a large program using perl or my perl mindset that comes with it but I also know it saves me a lot of time and allows me to automate things hard to imagine being cost effective to automate any other way.
only Guidos boast about their python in polite company.
practically unmodifiable once written
Come on, it's not that bad if you split everything up appropriately into well named subroutines and such like.
which is totally what she said
I like Perl. My company sells software that's primarily written in Perl. It's readable and maintainable because we follow strict coding guidelines, use proper modularization, and have unit tests that make sure our POD documentation is complete and up-to-date.
That said, a few things about Perl worry me. I think Perl 6 is a distraction; someone should take it out and shoot it. I predict it will eventually be abandoned the way PHP 6 was.
Also, while CPAN is awesome, inter-module dependencies are insane. Moose is all well and good, but sometimes you don't *want* 26MB of overhead in your Perl process just to use a fancy OO system. And since more and more CPAN modules are coming to depend on Perl, fewer and fewer of them are available for high-performance systems or where memory is an issue. Sure, you can get a 64GB server pretty cheaply, but (for example) when you're running 150 processes to scan email, 26MB/process adds up pretty fast.
The worry I have with Perl is that some developers are adding features that are pretty cool in theory and may make OO programming a bit nicer but which impose way too much overhead in many cases and which implement things 99% of people won't need.
What I found in using Perl was that no two Perl programmers could read each others code. Much of the expressiveness and versatility that people talk about comes at the expense of a huge amount of syntax and the ability of the language to assume values (like $_ instead of requiring them to be explicit). What happens in practice is people learn a subset of syntax which is large enough to do what they need to do and it often isn't the same subset that someone else learned. And when reading someone else's code, it can be very difficult to look things up because it often isn't even clear what the syntax is (in part because so much gets assumed).
When the boss hands me a flat text file with 50,000 lines in some random format that needs to be parsed and loaded into the database, I dust off my Perl book and write a short application to read each line and spit out SQL. I don't need the safety of Java or the byte processing of C. I don't need to handle every possible exception that could be thrown when opening a file. I don't need a GUI. I just need to open a file, read a line of text, use some regular expressions, do some tokenizing, and spit out more text into a separate file. Perl is fantastic for that. But I don't find much other use for Perl.
I often don't like the choices people make, but I like the fact that people make choices. That's why I'm a conservative.
practically unmodifiable once written
Come on, it's not that bad if you split everything up appropriately into well named subroutines and such like.
This is one of the most important things anyone approaching perl needs to grok. Perl gives you enough rope to hang yourself, that's why I use it. Lack of awareness of that has bitten me in the backside enough that I've learned this lesson.
That's why there's Mouse. And if that's still too large for you, there's Moo. And when even that's still to large, there's Mo
And you can select which one has the features you need, without the bits you don't care about ... but they've all got basically the same general API, so you can change it up as needed.
Build it, and they will come^Hplain.
And, in python: list = [1, 1, 2, 2, 3, 3, 4, 4, ] unique = set(list)
Which is more readable?
use List::MoreUtils qw(uniq);
my @words = qw(foo bar baz foo zorg baz);
my @unique_words = uniq @words;
What was that about readability?
What I found in using Perl was that no two Perl programmers could read each others code.
That's silly. I'm just a medium-grade Perl jockey and I read and understand other projects' code. I find bugs and submit patches.
Perl doesn't force good style on you, but if you follow the guides of Perl Best Practices and check yourslelf with Perl Critic you're going to produce code that most programmers can follow.
Some people aren't comfortable with 'enough rope to hang yourself', which is fine. Others think that forced indentation is the answer to good code style (I think semantic analysis is better). There are lots of options.
My God, it's Full of Source!
OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
a good example of why perl is awesome
The interfacing Linux and MSSQL, the running for five years, or the looking like Greek?
You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
There is more than one way to do it.
Perl can pretty much integrate anything with anything. Hardware or Software.
It is the Duct tape of the interwebs.
It is a swiss army chainsaw.
And yes,it can be nearly impossible to decipher what the code is doing, Oh, but the moment of enlightenment you have when you do figure out an obscure but elegant piece of code.
That, my friend, is "Why Perl?".
-Xanthos
Average Intelligence is a Scary Thing
Great plans are great, but how about decent Unicode/utf-8 support first??
And by decent I mean a single global flip switch to tell the Perl that the script runs in Unicode/utf-8 only environment, all regexes should be Unicode aware, all file and directory names are Unicode, all text files are Unicode and so on and so forth. Well, you know, a switch to tell Perl interpreter that it runs on a system made in 21st century.
Otherwise, Perl is a great thing. But the bastard Unicode (and locale) support already makes it way too crippled for modern tasks.
Well I don't have a crystal ball but I cannot see the language fading from usage in the next quarter century
One doesn't have to have a crystal ball to see that Perl is slowly fading into irrelevance. Most mobile platforms BTW, just like desktops and servers, are fully Unicode compatible - unlike Perl.
And heck, 25 years on - and we still do not have standard UI toolkit.
All hope abandon ye who enter here.
I ask this question in ignorance: what does the much-vaunted CPAN contain within it that has unit tests?
It is my current belief that any code lacking some sort of proof of correctness is valueless. In many cases it is worse than having no code at all.
I have strong feelings concerning the promotion of untested or untestable code, but will reserve them until I know whether they're warranted.
Those who advocate genocide deserve every protection afforded by law, and none afforded by common human decency.
Whats more readable french or German? Depends on which one you know.
"foo bar baz foo zorg baz"
how about you use good names instead of intentional vague ones to make some kind if ill advised point.
The Kruger Dunning explains most post on
WHAT?
Ahem. "Languages which are simple to learn (c++, for example)".
Perl has lots more reserved words than c++.
(Examples: "say", "not", "and", "open")
Perl has lots more operators than c++
(Example: "//" is an operator in perl. So is "<=>", "+/*", "..", and "eq").
(See if you can understand the flip flop operator on first reading.)
Perl has several contexts, and the meaning of an operator or function is context dependent.
(Example contexts: "scalar", "list", "null", "string")
(Example differences: Saying "$i = sort @array" has a completely different meaning from "@i = sort @array")
Perl distinguishes a variable from its value.
(Example: $i = 12; followed by $i = "twelve". The same variable, points to one of two values in memory. C++ binds the variable to the memory location, perl does not. Programmers have trouble wrapping their mind around this.)
Perl references are not pointers (but have some similarities). C++ programmers have a hard time with this also.
Perl has all the overloading and class syntax found in c++.
Perl doesn't have a precompiler.
What's racist about that comment?
The Tao of math: The numbers you can count are not the real numbers.
In theory, yes. In practice, no, because sometimes a CPAN module will insist on one specific module. And woe betide you if you want to mix modules that use different OO bases.
The mere existence of Moose, Mouse, Moo and Mo that purport to solve the same problem is an indication of a deeper underlying problem.
Guido is the guy with the car.
Where I grew up, most of the Guidos were Irish kids anyway.
My Heart Is A Flower
What I found in using Perl was that no two Perl programmers could read each others code. Much of the expressiveness and versatility that people talk about comes at the expense of a huge amount of syntax and the ability of the language to assume values (like $_ instead of requiring them to be explicit).
Hence the reason I always use explicit variable naming regardless of the programming language. On one project I inherited Perl code written every Perl idiom under the sun (the previous person was a Sun consultant). Not only was the code incapable of achieving the business requirements, it was terribly coded to the point that I started from scratch, gathered all the necessary business requirements for the entire lifecycle of the data, and reimplemented the entire system. The task took less than 3 months to complete and was so well documented, internally and externally, that I asked a co-worker to perform the final pre-production deployment QA assessment. Perl is capable of great things in the hands of a competent software developer / programmer.
You must not be aware that Moo and Moose play very nicely together. When Moose starts Moo classes are inflated and become full Moose participants. Many CPAN modules are migrating to Moo explicitly to support both. Now you can have your cake and eat it too.
Honestly, how can you not give that one to Python. I understand what a "set" might mean, so it's two lines make sense even if I know nothing about that language. It makes a list of a bunch of redundant stuff, makes a "set" out of it and you're done. So clearly Python natively supports lists and sets.
The Perl has got these "@" signs and "my" floating about for no obvious reason, never mind that "use" followed by gibberish that I would never have guessed. I mean, you make anything look simple by implementing it somewhere else and then just "use" it.
All languages have their strengths and weaknesses, but seriously, trying to claim "readability" for Perl? C'mon.
I've used it more than once, but not often enough that I don't have to go back and learn parts of over the next time I use it.
It just isn't very intuitive. The regex support can do awesome things, but just I can't seem to keep enough of it in my head to be productive. Or if I do, it leaks out when I'm off coding in some other language :-).
Slashdot is programmed in Perl. I would not consider that to be a recommendation.
I don't know why but I like your sense of humor. Rock on.
'I don't know what it's called. I just know the sound it makes, when it takes a man's life.' ~ Four Leaf Tayback
The Python is still more readable. First, you had to import an extra library (which, ok, python is built upon libraries). But, what the FUCK does "qw" mean? One can guess, and only guess, for the context that it's some sort of means to delineate a list. my @whatthefuck = ....;
considering that on a lot of perl you're going to see:
my $whatthefuck = ...;
and that the @ and $ variables are two different things...
And, you may hear the argument that "those are namespaces". bullshit. they're not namespaces. C++, Java, C# & Python have namespaces. @/$ does not denote a namespace. Especially, given appropriate context, you can use one of the other to change how the variable is treated. That's a cast, not a namespace.
Fact is, Perl is W.O.R.N. language: Write Once Read Never
You can write some pretty obtuse Perl, but that's mainly a style thing with the programmer, just using English.pm helps a lot.
Apocalypse Cancelled, Sorry, No Ticket Refunds
use List::MoreUtils qw(uniq);
But, what the FUCK does "qw" mean? One can guess, and only guess, for the context that it's some sort of means to delineate a list.
Fact is, Perl is W.O.R.N. language: Write Once Read Never
qw() is the quote word function it purpose is to keep you from wearing out your ['] key;
example
my @names = qw(Kernighan Ritchie Pike);
is the same as
my @names = ('Kernighan', 'Ritchie', 'Pike');.
Apocalypse Cancelled, Sorry, No Ticket Refunds
... then I asked myself: Why do I have to learn lots of subtle rules about "bare words", implicit $_, functions clobbering implicit things such as $_ or iterators, dynamic scope, disambiguation with a plus sign or a semicolon at the beginning of the block, "indirect object" notation, how file handles work, and how list and scalar context work, when virtually every other language has found simple and direct rules to almost all theses things and they let me move forward faster during the learning process?
C'mon, a programming language is supposed to be _designed_, it is supposed to be logical and simple enough so that a programmer can "run the interpreter in his head" in order to understand and debug things. It should _not_ use "heuristics" (as Perl docs and books say) to parse things. It should _not_ look like a spoken language that evolved haphazardly during hundreds of years. It should be flexible, but if it has sharp edges, it should have a good handle too!
Like many of you, I've been learning and using Perl since 1.0 was first released on CSU. I was privileged to be able to contribute to the early versions by porting Perl to the many various platforms I had access to at my employer (a compiler company) at the time. 25 years later, I still find Perl useful in my current job. Love it. Thanks Larry and everyone else!
Really like how in Perl I can do "{blah blah} if (condition)", and Perl's the only language I know of that has an "unless" keyword. I know it's basically an "if" with it's condition negated, but I still like it.
Sounds like Perl. Powerful, accessible to a complete beginner, reliable, and practically unmodifiable once written.
That brought up an interesting question in my mind. Could it be possible to grab some GPL-licensed OSS project, make modifications to it, run the source code through some insane obfuscator, and then still be legally able to redistribute it?
Happy Birthday Perl... you're the gateway that got me into programming in the first place and I always relish the opportunities I get to work with ya :)
http://www.gibby.net.au
Happy Birthday Perl. I'm 62 and have been using it as my main language since about 1995.
Actually, because it's linguistics based, rather than elegant computer science, DWIM [do what I mean] and TIMTOWTDI [there's more than one way to do it] it always feels very natural.
Also, although I agree its confusing sometimes [lots of sigils, autovivification zombie horror etc.] it's also very very expressive. Try COBOL, try Java and try APL if you want highly expressive but incomprehensible minimalism [and find a new keyboard].
Finally, as at least one poster has already said, CPAN gives nearly any project in Perl a running/sprinting start.
On y va, qui mal y pense!
Lots of comments about being unable to read code authored by someone else (as usual), but who are these "professional perl coders"? I'd say I'm an intermediate perl programmer, and I've had no trouble reading my old code or anyone else's provided it's been written sensibly. Hell I've even been able to decipher some pretty Byzantine code when required.
Perl isn't a language without faults, for example OO is not fun in perl. However, it mystifies me to see perl criticised for readability when the coder is, in no small part, responsible for making something decipherable. I've seen shocking code in several languages, where I work I know there's a particularly hairy example of cold fusion we're still struggling to tame... Diabolical use of in-line HTML, thousands of lines of code without so much as an attempt at basic formatting (no indents) etc, etc. It was written by a genius I'm told, but why they deserve that title when they weren't smart enough to write something we could maintain I'll never know.
See subject-line: I shot so many holes into your b.s. "test", it's not funny. To wit:
Tenebrousedge's "test method" is FLAWED -> http://tech.slashdot.org/comments.pl?sid=3239985&cid=41943501
How so?
---
1.) He used a LOCAL DNS SERVER most folks don't have these setup, as they waste CPU cycles, RAM, & other forms of I/O PLUS electricity as a result of those things, and more complexity - for doing what a custom hosts file can from a single file only, that's "tightly integrated" into the OS & IP stack!
(There is NO WAY a REMOTE DNS SERVER returns results in only 3ms when it hits NXDOMAIN queries unless it's local... no way, as they typically return results for host-domain name resolution to IP addresses in 30-100's of ms...) - NOR DID HE FLUSH THE LOCAL DNS CACHE!
---
2.) He used a LARGER custom hosts file set of "favorites" - mine has 20 @ the TOP of my custom hosts file (important) - NOT 34 entries/records in the hosts file (almost double)...
a.) That is THE only thing I care that gets speed out of MY custom hosts file - the rest are BLOCKED & I could care less HOW FAST they are gotten to - I never intended to get to them since they're blocked out, in the 1st place!
b.) I place my favorites @ the TOP OF MY HOSTS FILE, which even beats DNS server indexing up to around 2++ million records or so...
---
3.) He queried a local browser cache AND had the local DNS cache active, non-flushed first! This makes DNS results he posted again, much faster, but not honest regarding remote DNS servers.
a.) NEITHER AdBlock nor FF are able to obtain hosts-domain names resolutions, by themselves as he said, to IP addresses BEFORE the IP stack gets it for it, FIRST - that comes WAY before that... (more on that below, in detail).
b.) The IP stack is written in C & Assembly with over 40++ yrs. of optimization put into it, running in ring 0/rpl 0/kernelmode
c.) That is FAR faster than usermode browsers OR THEIR ADDONS are which slow up more with addons (firefox proves that much easily, load it up with addons & see)
d.) HOSTS act merely as a FILTER for the IP stack, & hosts are the FIRST THING YOUR SYSTEM QUERIES (then dns clientside caches, then remote DNS)) for host-domain name resolution to IP addresses...
---
4.) Nor did tenebrousedge account for time taken by AdBlock itself, parsing for WHAT to block out - this is NOT some "absolutely free operation", nothing is...
---
5.)
"Requests that are not generated by the browser are faster than ones that are and resolve locally in the hosts file." - by Tenebrousedge (1226584) on Thursday November 08, @06:20PM (#41925925)
Why on EARTH would the browser make requests to things that the Operating System & IP stack ALREADY KNOW ARE BLOCKED via the custom hosts file filter for? The IP stack, via the hosts file, has ALREADY determined that anything BLOCKED is blocked before the browser EVER HAS TO MAKE A DETERMINATION OF WHAT IT IS IT IS LOADING!
In fact, because of that fact?
Custom hosts file blocking makes AdBlock REDUNDANT & actually wasteful since what is blocked was blocked FAR BEFORE BROWSERS ARE INVOLVED IN THE PROCESS EQUATION, based on the entries in line item records the custom hosts file has in it...
It's the same principle advantage custom hosts files have over remote DNS servers:
I.E. -> You NEVER HAD TO CALL OUT TO THEM (NOT for favorites you 'hardcoded' into the custom hosts file, OR, NOT for blocked out known malicious sites)...
Plus locally resolving host-domain names to IP addresses is going to occur MUCH faster out of a custom hosts file, off mechanical HDD's even (7ms access on a 10k rpm one her
Most of my Perl scripts have no comments, since they're primarily for my own use, and I have no problems reading code I wrote 5 years or more ago. Unmaintainable code can be written in any language. To me Perl is the most elegant, expressive language. Maybe those who find Perl so unmaintainable or unreadable never bothered to learn the language properly in the first place.
Clearly the Python version, because it doesn't has strange array name operators and pseudofunctions like qw.
This is one of the most important things anyone approaching any programming or scripting language need to grok, at least if you want anyone (including yourself) to be able to figure out what your code does several years down the line.
Thanks, I just learned something useful on /.
What's hilariously funny is that most of these huge sites like Amazon and Facebook have moved to the language that all you "uber" geeks pontificate about to the language you all "love to hate"... yes, get ready... PHP.
You criticism of Perl is pretty common. (No two programmers can understand each other's code, code looks like gibberish, etc).
However, there is a serious fault in your reasoning. For some reason, you and many others judge Perl by the code of programmers who have not learned Perl well. Heck a lot of people learned their Perl from "Learn Perl in 24 hours" type of book or online tutorial. Such "programmers" generally do not have to share their code to begin with. Most just use it for one-off throwaway scripts. Getting started coding in Perl and producing useful code is deceptively simple. However, Perl is much deeper than say AWK, which can indeed be learned in an evening.
I would say, find code written by someone who has at least read "Programming Perl", the main reference book on Perl, or the complete set of Perl man pages, which are excellent and are much better than the bundled documentation of many other languages. The use of $_ and common Perl idioms will become pretty clear and intuitive after reading a good reference. If you want to see good code, or learn how to write good Perl code, there is no substitute for reading good Perl code. Take a look at the code of the standard Perl modules as well as most CPAN Perl modules and then still try to decide if no two Perl programmers can understand each others code.
Hi, APK. How's the life?
I have been working pretty hard on other projects; I haven't had time to set up my new computer let alone the tests we discussed. Really, it's quite depressing.
Your insistence that "the IP stack had to do some work first" is a complete departure from reality. A browser request starts in the browser, and may not even reach the DNS layer -- for instance, if you're requesting a local file (file://), your browser is not going to do a DNS request.
If you're the kind of guy who is going to completely ignore the factual when it suits him, then I'm probably not going to make these benchmark numbers a real priority.
And honestly, if you keep trolling my posts on here, writing a plugin to automatically hide your posts would be at least as much fun to write as doing these benchmarks would be. The next step would be to run a script to automatically post links to said plugin after every post of yours. So let's keep the drama to a minimum, shall we?
Those who advocate genocide deserve every protection afforded by law, and none afforded by common human decency.
BROWSERS CAN'T DO A THING UNTIL THE HOSTNAME QUERIED IS RESOLVED TO AN IP ADDRESS, FIRST!
E.G.-> How would a MERE BROWSER know where to go, by itself, first (as to an IP address from a hostname/domainname), hmmm?
Man, lol... You don't "get it", OR HOW IT REALLY WORKS, do you? READ THIS:
---
Microsoft TCP/IP Host Name Resolution Order:
"Host name resolution generally uses the following sequence:
The client checks to see if the name queried is its own.
The client then searches a local Hosts file, a list of IP address and names stored on the local computer.
Domain Name System (DNS) servers are queried.
If the name is still not resolved, NetBIOS name resolution sequence is used as a backup. This order can be changed by configuring the NetBIOS node type of the client."
---
The 1st thing a system looks @ is the hosts file for host-domain name resolution to IP address!
---
That also makes using AdBlock redundant for adblocking when you use a custom hosts file, by the way (not that anyone with any GOOD SENSE would use it now, since by default it DOESN'T BLOCK ALL ADS)
In hosts files, a good one has all known adservers blocked out & that grows here, constantly, from 12 reputable & reliable sources.
APK
P.S.=> Your "test hosts file" also was bogus... how so?
It used DOUBLE the entries mine has for the top 20 entries with 34 in yours, that's b.s. testing as well!
Why?
FIRST OF ALL:
They're my fav sites & only ones I care to get to (rest in my hosts files are below that & blocked out known bad sites, adbanners servers, etc. that I never INTEND to EVER reach), & that many place the way they are @ the top of the file even beats DNS indexing up to 2++ million entries for seek/access/read & they're read FIRST from the top of the file.
SECONDLY:
What did you do? WELL - you used 34 entries, nearly DOUBLE the size of mine & that is a b.s. test, because that means you had to "fake it" basically to produce the results you did, by doing twice as many reads for remote DNS resolutions to come back to you in the same speed as a custom hosts file read!
(Faster on mine here since 0ms seek/access off my Gigabyte IRAM SSD (since I relocate my registry path to hosts onto it), & since it's also cached into RAM by the local kernelmode disk subsystem)...
... apk