ASP VBscript vs Jscript

H

Harag

Hi All.

I'm stating out doing some web developing. I was wondering which of
the server side languages should I concentrate on and learn.

I Know CSS, HTML, T-SQL

I can look at the client javascript code and work out what it does but
I can't really write it from scratch.

I know mainly VBscript.

I was wondering should I drop VBscript and learn Jscript then code
both the client & server code in Javascript/Jscript

I have a couple "CLASS" files in VBscript and was wondering how does
Jscript do this ?

What books should I get to learn server side Jscript? is it the same
as client side? or is there a lot of differences.

Thanks for any help, pros & cons.

Al.
 
F

freaky friday

Use what you're comfortable with. There's really no clear advantage to
using one over the other.

However I will mention that the whole "use the same language in both
client-side and server-side" argument doesn't carry a lot of water. In
fact, I think it contributes to far more confusion than good.
 
C

Cowboy \(Gregory A. Beamer\)

If you plan on using Microsoft's web parts (forget the actual name for the
annoying little ASP scripts it installs), you are better to learn JScript,
as these snippets are all coded in JScript. Why is this important? Every
time the interpreter switches from VBScript to JScript, you get a perf
penalty. If you code in VBScript, you are more likely to encounter numerous
switches than you are with JScript (which will be 0 switches).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
F

freaky friday

penalty. If you code in VBScript, you are more likely to encounter
numerous
switches than you are with JScript (which will be 0 switches).

what are you talking about? switches to and from what?
 
S

Scott

I agree that you should use what you're comfortable with,
but what if you client is using JScript/JavaScript and not
VBScript? What do you do then?

I'm in a shop where JavaScript and VBScript are both being
used so I have a choice, but the client wants us to focus
on JavaScript. The claim is that JavaScript is more
robust than VBScript, but I tend to disagree. I think
both have their strengths and weaknesses for different
things.

I would be curious to know also what books are good to
learn JavaScript from, since I have extensive VB
experience and very little ASP experience. I will also be
taking C# & Advance VB.net college classes in January, and
I was curious to know in all three of these scripting
languages are part of the .Net framework?
 
S

Scott

Thanks Peter.

-----Original Message-----


Well, if you're designing for a client that specifically wants/needs
JavaScript/JScript instead of VBScript, there's not much you can do about
that. Many clients (IMO) don't know about the language that runs the ASP
application, but if they specifically request JavaScript, then you have to
give them what they want I suppose (or try to talk them into letting you
code with VBScript, or tell them you can't meet their needs if you can't do
it).


Yes and no. JavaScript probably is a little more robust than VBScript. But
the differences in an ASP environment are really not enough to put any real
distance between the two options, and for the most part you should be able
to do pretty much the same things with either language. And yes, they each
have strengths and weaknesses... for example, if you need to do any sort of
string manipulation, VBScript will probably be quicker and easier to write
than JavaScript equivalents. But if the customer insists, there's not much
you can do about it. If you have other guys in the shop that do JavaScript,
then perhaps they should take this job.



The O'Reilly book "JavaScript: The Definitive Guide" is a great book, both
for learning and as a reference.


C#, VB.NET and JScript.NET are all languages that can be used with the .NET
Framework.
Good luck,

Peter


.
 
C

Chris Barber

I used to be an ASP VBScript developer until a similar thread a few weeks
ago.

I tried using JScript in server-side ASP and since then I've dropped
VBScript entirely for web stuff since I can now code an entire library set
of functions and use them at both the server and client side. some of these
library routines are pretty complex and having to do them both ways was
beginning to get on my nerves. One such library is a couple of JScript
objects (using prototype etc.) that converts coordinate systems from LatLong
to UK National Grid and back.

Another one that I've been working on is a single JScript include file that
allows XSLT processing to HTML at either the server or the client without
any changes to code - it works so far (OK - there are a couple of minor
gotchas to work around).

So, all I can really say here is that keep VBScript under your belt but for
anything web oriented then spend the few minutes to ponder if an all JScript
solution will help reduce duplication.

Side Note:
I have to say that I'm unimpressed with the lack of intellisense for JScript
objects within Interdev - I really like the way that it does it for Class
definitions in VBScript and oh how I wish it were so with JScript objects!

Cheers,

Chris.

Hi All.

I'm stating out doing some web developing. I was wondering which of
the server side languages should I concentrate on and learn.

I Know CSS, HTML, T-SQL

I can look at the client javascript code and work out what it does but
I can't really write it from scratch.

I know mainly VBscript.

I was wondering should I drop VBscript and learn Jscript then code
both the client & server code in Javascript/Jscript

I have a couple "CLASS" files in VBscript and was wondering how does
Jscript do this ?

What books should I get to learn server side Jscript? is it the same
as client side? or is there a lot of differences.

Thanks for any help, pros & cons.

Al.
 
C

Chris Barber

It does carry a lot of water but like all such statements needs to be taken
in context.

I (this is my personal experience) found that the switch from ASP VBScript
to JScript was easy and also gave a lot of flexibility in code reuse since
you can use the same .js file for both server-side and client-side usage
(within reason of course) in a lot of instances negating the need to code
things twice (on as VBScript and one as JScript).

Admittedly there are some instances where JScript is more difficult (some
specific cases with COM spring to mind) but these are generally easy to deal
with and a small foray into VBScript for a few lines is no big deal).

The support for arrays in JScript far outstrips VBScript (in my opinion
again) and if only for that I consider my own switch to ASP JScript to be
the right choice.

Database stuff is as-easy with JScript as it is with VBScript - I have a
number of working solutions quite happily using ADO / SQL Server stored
procedures etc. with no apparent ill effects.

My only bugbear with JScript is actually a go at Interdev - why oh why is it
not possible to have intellisense for JScript objects created using the
object.prototype functionality? No need to comment cos I know it ain't gonna
happen any time soon (does it do this in .NET perhaps?).

Chris Barber.

Use what you're comfortable with. There's really no clear advantage to
using one over the other.

However I will mention that the whole "use the same language in both
client-side and server-side" argument doesn't carry a lot of water. In
fact, I think it contributes to far more confusion than good.
 
H

Harag

The main reason I'm thinking of switching is that the client side code
is all javascript that I downloaded from "javascriptsource.com" and
altered to suit. I understand the basics of javascript to make the
changes I just don't know it fully as I code mostly VBscript during a
working day.

I don't have a "boss" or "client" to tell what to code in as its for
my own business so thats not really important.

For my project I'm still in the pen & paper design phase so not done
much coding. I do have several "VBscript Class" files that will need
to be changed.

Thanks for the info and points.

Al
 
G

Guest

The rule of thumb is VBScript for ASP server side and Javascript for client.
One cannot avoid Javascript as VBScript is not supported by clients other
then Microsoft's (Netscape, Opera etc whcich still account for a sizable
part of customers one cannot ignore)
 
F

freaky friday

The main reason I'm thinking of switching is that the client side code
is all javascript that I downloaded from "javascriptsource.com" and
altered to suit. I understand the basics of javascript to make the
changes I just don't know it fully as I code mostly VBscript during a
working day.

This doesn't explain why you want to use the same language for both
environments. In fact, the last statement sounds like an argument for
*staying* with VBScript on the server side.
 
H

Harag

This doesn't explain why you want to use the same language for both
environments. In fact, the last statement sounds like an argument for
*staying* with VBScript on the server side.

I want to keep to using Javascript on the client side so I can try to
be compatable with at least NS 7 users (not sure about earlier
versions as I have IE6 NS7 installed).

I thought that if I switch to Jscript now then it would be easier to
learn client javascripting. but looking into it a bit more I'm
thinking more and more of staying with VBscript for the serverside and
learn the basics of javascript for the client side. I've found some
reports and comparison pages and they all seem to lead to VBscript.
I'm not convinced I should drop VBscript completly and change to
Jscript.

As you say the last statment does sound like an argument for staying
with VBscript. I seem to know more about VBscript than I thought I
did. :p

Thanks
Al.
 
D

dlbjr

Try this:

<SCRIPT language="vbscript" runat="server">
sub DoThisVBScript()
dblItem = 0
for i = 0 to 1000
for i2 = 0 to 1000
dblItem = i + dblItem
Next
Next
End sub
</SCRIPT>
<SCRIPT language="javascript" runat="server">
function doThisjavascript(){
var dblItem = 0;
if(i=0,i<=1000,i++){
if(i2=0,i2<=1000,i2++){
dblItem++;
}
}
}
</SCRIPT>
<%
dlbTimer = Timer()
DoThisVBScript()
Response.Write Timer() - dlbTimer & " for the vbscript to process"
Response.Flush
Response.Write "<BR/>"
dlbTimer = Timer()
doThisjavascript()
Response.Write Timer() - dlbTimer & " for the javascript to process"
Response.Flush
%>


-dlbjr

Discerning resolutions for the alms
 
M

Michael D. Kersey

Harag wrote:
I was wondering should I drop VBscript and learn Jscript then code
both the client & server code in Javascript/Jscript
Microsoft does not support VBScript in .NET. In contrast JScript _is_
supported in .NET. So learning more about VBScript will not be useful in
the long run.

VBScript, like Latin, is now a "dead language" (although both are still
used in some quarters).

Good Luck,
Michael D. Kersey
 
D

Dave Anderson

The rule of thumb is VBScript for ASP server side and Javascript
for client.

There is no such rule. I haven't used VBScript for 3 years. JScript suits me
just fine on the server.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top