Crumpled

Friday, February 17, 2006

 

VBScript

I'm a PHP guy. I love the language. It's nice to me because I can do a great deal with it although I really only use a few different commands.

I really like making websites that are database driven. So I use MySQL for that because it does everything I've ever needed (and more) and I know how to get the data in and out with ease. SO I use PHP and MySQL to build most websites these days. Eventually I'm going to do more actionscript, but I'm not concerned about it quite yet.

Right now I'm working on adding pages to an ASP website that runs on VBScript, and the database it uses is MS Access. I redesigned the web site a couple years ago but I retained all the VBScript because it worked fine, and I couldn't read it anyway. Now I've got the task of adding new pages and features to the site. So What I get to do is add new tables to the Database and email the new database to the webhost who drags the file into position for the website to call on. Then I get to write some new VBScript to call on the data and format it into the HTML.

My first impression of VBScript: It seems like a bad language
granted I don't have any experience with it but it seems to be missing a lot of things that good languages have. not like abilities, but the basic structure is fucked. as in, there's not much logial structure to it. In PHP (or Perl or ActionScript) everything you tell it to do is packaged neat and clean.

PHP example:
if (these are true){
do "this stuff";
}
else {
do "this other stuff";
and "this stuff too";
}



VBScript example:

if these are true then do("this stuff") else do("this other stuff") and("this stuff too") end if


Now, it may seem like vbscript is easier to understand because it looks like can be written more like english without those extra squiggly brackets and semi-colons.
Well, we like those squiggly brackets they tell us where things begin and where they end. We need to know where things start and where they stop. We need to see those semi-colons to know that's the end of that instruction, and the next instruction is a different instruction, and not more details about the previous instruction. And it's easy to see which part of the line is the instruction and which part is the detail. This is really important.

I don't think people really use VBScript anymore now that there is .net. But I get to use it anyway! I gotta get back to figuring this out. bye.

[EDIT: 7:56pm]
It's actually not as bad as I made it out to be. I was wrong about it a little bit. It doesn't ignore whitespace the way php does, so a line break is the equivalent of PHP's semicolon. The example I gave above for VBScript is wrong, because it doesn't have these line breaks. I miss the squiggly brackets, but so long as i write my code using nesting (I always do) I should be able to see what contains what.
Now to figure out how to use "GET" data in my code...
Comments: Post a Comment





<< Home

Archives

October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   April 2006   May 2006   July 2006   August 2006   October 2006   November 2006   March 2007   April 2007   November 2007   February 2008   March 2008   May 2008   June 2008   July 2008   August 2008   September 2008   October 2008   November 2008  

This page is powered by Blogger. Isn't yours? Theme: Simple II (with minor edits). I use Blogger, but I don't necessarily endorse it.

Subscribe to Posts [Atom]