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)