pseydtonne: Behold the Operator, speaking into a 1930s headset with its large mouthpiece. (Default)
pseydtonne ([personal profile] pseydtonne) wrote2007-03-21 11:45 am

JavaScript in the front, Perl in the back: the mullet of the web?

I've been reading about JavaScript as a counterpoint to what I'm learning about Perl. It helps me to chew over what I've just learned by learning how another language approaches or cannot approach an issue.

The biggest lesson I've had so far is that JavaScript is shiny but Perl gets work done. I could play with something like this JavaScript page for a good while, making it go from color blocks to blue letters to orange binary to lines to green crosses over and over. JavaScript lets you run tiny applications inside a user's web browser without having to make calls back to the server. Once it loads, it's on.

However, JavaScript is meant to stay in the safe zone inside the web browser. It can make a cookie in the user's browser cache, but that's just a text file which hangs onto some details. It is not meant to talk to the server dynamically: it can only encapsulate small amounts of material to hand back to the originating web server. This means you can't make a full web site work only in this one language.

In contrast, Perl is frickin' Perl. You got a gigabyte text file you need to reformat for CSS or take out all the pre-Soviet Cyrillic characters because it was inputted by an old Romanov? No problem, it's done. You want to make a database of people that sign up for your newsletter because they liked your site? No sweat, Suzie!

Meanwhile, most users do not have Perl installed on their local machines. While Perl is a given on Linux boxes as is having a few text editors, Perl would be missing from 98% of Windows desktops and laptops. This means the Perl script would have to run on the web server, thus talk to the server or simply be on the server and use that bandwidth. While that bandwidth is more plentiful than ever, users hate to wait.

Thus I am realizing my plans for a future web site of my writings (which I will build myself, but more about that later) will require that I learn enough about both languages. I will want to gather user responses and make some cute front-end goodies in JavaScript then pass those details back to the Perl scripts handling the back end. Here's a shiny catch phrase displayer in JavaScript and database details crunched in Perl about how many people subscribe just to turn off that gewgaw.

I'm fascinated by the difference between the Perl and JavaScript cultures. Web sites about Perl use a lot of Perl. Meanwhile, the titular JavaScript dot com page is the ugliest, least intesting page I've seen in a while and only has the tiniest amount of JavaScript on it -- it looks like it was made in 1999 and never updated by the very technology it promotes. Since Perl was invented by a proselytic Christian while JavaScript was invented by Netscape, maybe I shouldn't be shocked. I'm used to the cult leading the training sessions. I'm also not used to a community not calling dibs on the best domain name for its product: it looks like most of the good material is at The WebMonkey site's section on Javascript.

These dual paths of learning will let me make exactly the presentation system I desire for you, my readers. While I may be giving myself a long-term project, I feel I am ready for it. I tell people "Tolstoy made his own pencils, so why shouldn't I build my own writing tools?" I don't even like Tolstoy, although I appreciate that "War and Peace" shrank by 31 pages after the Soviets took five characters out of Cyrillic and dumped the excess tvyordi znak at the ends of most words.

I see the process of making all of my equipment as the foundation of my craft. I am not a victim of publishers or interlopers unless I know I can get a specific reward from the transaction. I will understand each step of the process intimately. I have built and configured the computers which let me type and store that work, installed the operating systems and keep them in good order, and now I am learning the languages which can process my words so that I don't waste time doing it manually. I write about each step that I take, thus fueling the creative process perpetually.

As I take that time and continue to document as I learn, I will be able to type up crap from anyway, send it to my machinery and let my scripts make it available to you. I will fix the problems and understand when my own tools are obsolete.

-should I even bother capitalizing the middle S? Dante

[identity profile] bedfull-o-books.livejournal.com 2007-03-21 05:54 pm (UTC)(link)
You just won the quote of the day award for your subject line.

Thought you'd want to know.

[identity profile] pseydtonne.livejournal.com 2007-03-21 06:51 pm (UTC)(link)
Thank you!

[identity profile] dobrovolets.livejournal.com 2007-03-21 06:21 pm (UTC)(link)
Tolstoy was a crank.

[identity profile] pseydtonne.livejournal.com 2007-03-21 06:52 pm (UTC)(link)
I wonder whether Tolstoy would have snorted crank had he lived now.