Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 9th, 2003, 01:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default Things that bug you about ASP

I am keen to hear of the things that bug people about ASP and take comments on what annoys me about ASP for two reasons. Someone may point out a good reason for something that I see as a flaw, and someone may have a nice workaround for the flaw.

1. The language is quite verbose. Throw in descriptive variable names and you end up with a lot of lines of code split over multiple lines (_) or lines the scroll off the screen. This displays itself in a few ways:
    - The lack of some handy and succint operators, like ++, += *= etc.
    - The use of words for everything rather than using symbols

2. You can't 'stack' constants. eg:
Const BASE_PATH = "F:\inetpub\wwwroot"
Const BASE_FILE = "F:\inetpub\wwwroot" & "\default.asp"
This means you must use variables, which means that you can't

3. The poor support for classes.

4. Handling of subs and functions. IMO you shouldn't be able to call a sub or function without brackets and you shouldn't have to use Call to use brackets when calling a sub. Maybe this stems from the fact that I fail to see the reason for subs, as you can use a function and simply not return a value.

5. The need to use Set when setting the value of an object variable. The distinction between an object variable and a normal variable is artificial to my mind.

6. Poor handling of include files that include other other include files. Let me explain. If you have an include file (inc1.asp) that also includes another file (inc2.asp) and you include both the an ASP page you might get errors. This is very annoying as you can't treat the include file as a black box (which is the way a module should be able to be treated), you must manually check the include file tree. php as a function include_once(), C and C++ use preprocessor directives on header files.

regards
David Cameron
__________________
regards
David Cameron
Reply With Quote
  #2 (permalink)  
Old July 9th, 2003, 03:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

David, i agree with you on all of these, especially the lack of x++ and the Set thing. Some of my pet hates are:

- lack of error handling - On Error Resume Next, or nothing!
- lack of escape characters, so if you want a string that contains a single quote you end up with this ridiculous line: x = """"
- lack of inline variable expansion, so you have to do x = "string" & varname & "otherstring", which wouldn't be so bad if the performance of string concatenation wasn't so poor.
- lack of formatting functions, oh for printf...
Looking at the above makes we wonder why I bother with VBS, why don't I just use JS?

Don't you just love a good moan, I feel so much better already :-)
Reply With Quote
  #3 (permalink)  
Old July 9th, 2003, 06:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually I don't mind the error handling. I'd love to have C++ style exceptions, but ASP does have something very good, namely the ability to create your own 500 error page. This at least means you can catch all errors and either log them to a text file or email them to yourself.

I'm wondering why I haven't moved to js, at least problems 1, 4 and 5 would be solved. I think it is because most of the code samples out there are VBS asp.

Interestingly after reading Professional Wrox's ASP.Net (I haven't written any .Net code yet), it seems that some of these problems have been recognised and solved. Certainly 3, 4 and 5 have been, I don't know about 2 and 6, and 1 hasn't been solved. Another major annoyance of mine is that VBS is a very weakly typed language, and this was also fixed.

I'm still hoping that someone will have some answers as to why things are the way they are or some neat solutions.

regards
David Cameron
Reply With Quote
  #4 (permalink)  
Old July 12th, 2003, 06:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

I agree with both of you.

It seems that the question about the moving from VBS to JS is one of the simple questions without the good answer. I haven't too a real answer about the moving from VBS, although I have been angry many times with VB syntax and especially with new line concatenation (_). That's why I have decided to use C# as my main language in .NET technology. Now I use ASP.NET with C# (when I can choose, of course), and I feel comfortable with it. Generally, I think that C syntax is more programmer friendly and consistently than VB. This difference remains in .NET. VB.NET is better and more powerful than VB, but it's still VB syntax. I will always like to write this:
Code:
string MyFunc(string myArg)
{
    //some code
}

rather than

 Private Function MyFunc(ByVal myArg As String) As String
    'some code
 End Function
And David, prob No 1 and 2 has solved. You can use succinct operator you mentioned, you can use even a ternary operator for "skipping if's".
You can initialize a constant with the other one, and u can use concate operator in the initialization process, but you can use a variable in the expression for the constant's initialization. However, in C# there is one feature you like - read only fields. Read only field is some kind of constant - you can initialize it once, and after that you cannot change it. In the initialization you can use some variable which value is unknown in the compile time. Limitation is that you have to initialize read only field in the class constructor only.
I am not sure for include files. MS avoids speaking about this, so I suppose that they have not advanced this concept, but they recommend a using of user controls for the static text and custom controls or components for ASP.NET code reusability.

Regards,
NotNowJohn


...but the Soon is eclipsed by the Moon
Reply With Quote
  #5 (permalink)  
Old July 13th, 2003, 09:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm not a big fan of the ternary operator. I like succinct, but it can go too far. Take perl for example. I have written a little perl, and I often tell a joke.
"They were planning to have an internation obfuscated code competition for perl similar to the International Obfuscated C Code Contest (http://www.wurb.com/if/award/21), but they realised that all perl code would qualify"
There are times when my fingers itch to include a ternary if operator, I just worry about legibility for others reading the code. I haven't written any C#, but I like to write a little C++ in my spare time.

As for include files, I think that the need for them has disappeared with the arrival of custom controls and components, as you mentioned.

I think if it came to .Net I'd code in C# as well.

I really shouldn't whinge about the problems with ASP, because I think the answer in most cases is to move to .Net.

regards
David Cameron
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New to VC++ .Things to clear out kostasmammos Visual C++ 1 March 18th, 2007 12:54 AM
Bug or no to bug learning C using VS.Net to compil tesh All Other Wrox Books 0 February 14th, 2007 01:06 PM
Other things to try Martyn JSP Basics 0 August 29th, 2003 09:44 AM



All times are GMT -4. The time now is 07:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.