Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 15th, 2004, 01:25 AM
Registered User
 
Join Date: Jul 2004
Location: Sydney, NSW, Australia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning ASP 3.0 - page 212 issue

Hi guys,

I am new to ASP and have decided to start developing in ASP with the aim to progress to ASP.NET. I have invested in the following book: Beginning ASP 3.0.

Overall, I am very surprised how well written the book is. Very easy to understand and it also has its funny moments. I have a smaller issue - referring to page 212. It state how I can improve my function listed below:

from this

<--
Select Case (varLocation)
Case "city"
varCost = CityCost(2)
Response.Write "The two day course will cost $" & varCost & "<BR>"
-->

to this:
-->
Select Case varLocation
Case "city"
Response.Write "The two day course will cost $" & CityCost(2) &"<BR>"
-->

The author claims that the latter piece of code is a faster technique, however, I am not sure what he means with this? Fact is that is took the same time to write both codes and when testing how quickly each code would take to execute I could not really see a major difference.

My point is the following - sometimes the author claims that it is quicker and better to write a code like this rather than like that. Overall, I am sure he is right, but sometimes these 'quick schemes' are not making any sense, and as an inexperienced ASP programmer I cannot at the moment look at a code and write a better (quicker) one. Often I have understood the code that was written prior to creating the quicker code, and suddenly I am lost. Hence, my question is how much should I put into the authors 'quick schemes'? What if I am quite happy with the code as it is? After all, it still works great.

Is it really that big a difference in the overall performance of a program? I have a feeling that writing code often depends on the programmers own programming experience. Please make some recommendation to how seriously I should take some of these recommendations. After all, improving a code could end up in a never-ending debate on who is right and wrong - do you prefer red or black, I hope you understand my point

Finally, I am also looking for a system that can help me evaluate when to use the many different programming techniques ( Functions, branching, and so on). In other words is there a book with real live examples that can give me an idea to how to program for certain scenarios? Initially, I am not interested in the actual code but more in the logic of thinking in programming.

As an example in the same book, page 208 the author provides a small introduction to what I about to develop. First, I was trying to understand what to develop and then relate it to the many functions and other programming elements that I have learned so far. It was a bit hard to evaluate which piece of code to program in, as I am not yet 100% sure on what to use. Are there any good books on this - how to thing as a programmer (ASP)? Please confirm

Cheers,

Dynamic2004


Dynamic2004

(moved topic to appropriate category - planoie)
  #2 (permalink)  
Old July 15th, 2004, 11:36 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Why do this:

varCost = CityCost(2)
Response.Write "The two day course will cost $" & varCost & "<BR>"

When you can do this:

Response.Write "The two day course will cost $" & CityCost(2) &"<BR>"

Why use an unnecessary variable assignment? It's just another line of code to run. Surely, in the grand scheme of things this tiny change will have little impact on the overall performance, but to use the camel and straw metaphor, if you make thousands of these types of optimizations in 10s of thousands lines of code, it can help.

I know the type of book you are looking for. I have found very few (if any) of these types of books. I have found that some people just know how to think programmatically. It's a hard way of thinking to teach people.

Peter
-------------------------
Work smarter, not harder
 


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
Expected Expression before')' token page 212 line martyds BOOK Beginning Linux Programming, 3rd Edition 0 November 9th, 2008 04:44 PM
Chapter 7 - page 212 asplundo BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 3 February 2nd, 2008 06:56 AM
Chapter07 page 212 romee BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 2 September 11th, 2007 07:21 AM
Beginning ASP 3.0: Passing ItemID from one page to AlanM Classic ASP Basics 0 July 1st, 2007 03:23 AM
Chapter 7 page 212 tgregory BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 4 May 3rd, 2007 01:44 PM



All times are GMT -4. The time now is 02:12 PM.


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